Ê×Ò³ | Óʼþ×ÊѶ | ¼¼Êõ½Ì³Ì | ½â¾ö·½°¸ | ²úÆ·ÆÀ²â | ÓʼþÈ˲Š| Óʼþ²©¿Í | ÓʼþϵͳÂÛ̳ | Èí¼þÏÂÔØ | ÓʼþÖÜ¿¯ | ÈȵãרÌâ | ¹¤¾ß
ÍøÂç¼¼Êõ | ²Ù×÷ϵͳ | Óʼþϵͳ | ¿Í»§¶Ë | µç×ÓÓÊÏä | ·´À¬»øÓʼþ | Óʼþ°²È« | ÓʼþÓªÏú | ÒÆ¶¯µçÓÊ | ÓʼþÈí¼þÏÂÔØ | µç×ÓÊéÏÂÔØ

Óʼþ·þÎñÆ÷

¼¼ÊõÇ°ÑØ | Exchange | Domino | Sendmail | Postfix | Qmail | IMail | MDaemon | Foxmail | James | Kerio | JavaMail | WinMail | Winwebmail | Merak | CMailServer | ½ðµÑ | ÆäËü | ÓʼþÓ뿪·¢ |
Ê×Ò³ > Óʼþ·þÎñÆ÷ > Postfix > postfixÏÞÖÆÌØ¶¨Óû§ÊÕ·¢ÓʼþµÄ¸ß¼¶·ÃÎÊ¿ØÖÆ·½·¨ > ÕýÎÄ

postfixÏÞÖÆÌØ¶¨Óû§ÊÕ·¢ÓʼþµÄ¸ß¼¶·ÃÎÊ¿ØÖÆ·½·¨

³ö´¦£ºDocn.cublog.cn ×÷ÕߣºDocn ʱ¼ä£º2007-3-14 19:50:03

ÓʼþÓ¦ÓÃÖпÉÄÜ»ØÓÖÈçϵÄÓ¦ÓÃÐèÇó£º

ijÏúÊÛAÖ»ÄÜÊÕµ½À´×Ô163.com¼°sina.comµÄÓʼþ
ij¼¼ÊõÔ±BÖ»ÄܸøÄÚ²¿Óû§·¢Óʼþ£¬²»ÔÊÐíÏòÍâÍø·¢Óʼþ£¬µ«¿ÉÒÔÊÕµ½ÍâÍøÓʼþ
ijÖ÷¹Ü¿ÉÒÔÊÕ·¢ÄÚ¡¢ÍâÍøÓʼþ
......

Hello!

I have the same problem:

1. I need to permit some internal users (not all) to send mail to any
external user (Internet)
2. I need to permite any external user to send mail to some my internal
users (not all)

In fact, the problem is: just "some" of my internal users have permission to
receive mail from and send mail to the Internet.

How can I solve this?


View this article only
ÐÂÎÅȺ×飺mailing.postfix.users
ÈÕÆÚ£º2002-12-04 15:18:04 PST

In the example below, the same list of restricted_users is used for
controlling both who can send and who can receive internet mail. If you
don't require the local_plus feature, just leave that part out.

  1. in main.cf:
  1. use restriction classes to make restricted_users file more readable.
    smtpd_restriction_classes = local_only, local_plus

local_only =
reject_unauth_destination
permit_mynetworks
reject

local_plus =
check_recipient_access hash:/etc/postfix/local_plus
check_sender_access hash:/etc/postfix/local_plus
reject_unauth_destination
permit_mynetworks
reject

  1. this is the default setting, required for this setup.
    smtpd_delay_reject = yes
  1. we'll do this in sender restrictions to avoid open relay problems.
    smtpd_sender_restrictions =
    check_sender_access hash:/etc/postfix/restricted_users
    check_recipient_access hash:/etc/postfix/restricted_users

and in /etc/postfix/restricted_users
# /etc/postfix/restricted_users
# this file contains a list of users only allowed to send and receive local
mail
# postmap this file after changes
# local users not listed here have no restrictions
user1@miodemi.com local_only
user2@miodemi.com local_plus

and in /etc/postfix/local_plus:
# /etc/postfix/local_plus
# this file contains allowed destinations and senders
# for users restricted to local_plus
# postmap this file after changes
miproveedor.com OK

Remember to "postmap local_plus" and "postmap restricted_users" after
making changes to them.
Remember to run "postfix reload" after changing main.cf

hzqbbcµÄÏÞÖÆ·½·¨£¨×ª×ÔhzqbbcµÄblog£©

Óм¸¸ö·½·¨£º

1) smtpd_restriction_classes = local_only
ÉèÖÃÒ»¸öÏÞÖÆÀà±ð½Ðlocal_only£¬È»ºó²Î¿¼access(5)µÄ¸ñʽ×öÒ»¸ö·ÃÎÊ¿ØÖÆ£º

local_only = check_recipient_access hash:/etc/postfix/maps/my_rcpt

Îļþmy_rcptÄÚÈÝ£º

163.com RELAY
21cn.com RELAY
hzqbbc.com RELAY

È»ºó£¬ÉèÖãº

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/maps/mysender 

mysenderÄÚÈÝ£º

hzqbbc@local.hzqbbc.com   local_only 

ÕâÑù·²ÊÇMail from:µÄÐÅÖ»ÄÜRCPT TO: µ½163.com, 21cn.com¼° hzqbbc.com Èý¸öµØ·½ÁË¡£ÆäËûµÄ¶¼·¢²»³öÈ¥¡£

°´Õâ¸ö·½·¨£¬»¹¿ÉÒÔÉèÖøü¶àµÄÀà±ð£¬ÀýÈçremote_onlyÒÔ¼°²»ÏÞÖÆµÄÕʺŵȡ£µ«ÕâЩ¶¼Ö»¶Ôfrom:ÏÞÖÆ¡£¶øÇÒ²»¹ÜÊÇ·ñSASLºóµÄ¡£ËùÒÔÓÐÒ»¶¨È±ÏÝ¡£²»¹ý£¬ÒѾ­´ïµ½Ä¿µÄÁË¡£

2)ʹÓÃsnapshot°æµÄpolicy²ßÂÔ
¸ù¾Ýij¸öhash±í»òÅäÖÃÎļþ£¬Åж϶ÔÓ¦µÄsenderºÍrecipientÊÇ·ñÆ¥Å䣬ƥÅä¾Í·µ»ØOK»òÕßDUNNO»òÕßRELAYµÈ£¨¿ÉÄÜRELAYÒѾ­¹ýʱ£¬Õâ¸öÊÇpostfix 1.1.xµÄ£©Èç¹û²»Æ¥Åä¾Í·µ»Ø´íÎó´úÂë

°´postfixËù´øµÄsmtpd-policy.plģʽ£¬ÐÞ¸ÄһϾͿÉÒÔʹÓÃÁË¡£Ïêϸ²Î¿¼POLICY_READMEµÈ¡£

ÎÒ×Ô¼ºµÄÀý×Ó£º

1)¶¨ÒåÀàsend2hrall£º
smtpd_restriction_classes = send2hrall
send2hrall =
    check_sender_access mysql:/usr/local/etc/postfix/mysql-send2hrall.cf,reject
ÅäÖÃÎļþ send2hrall.cfÄÚÈÝÈçÏ£º
hosts = localhost
user = mailuser
password = mailpasswd
dbname = maildatabase
query = select access from mysql-send2hrall where source = '%s'

2)¶Ô·¢¸øhrall@mydomain.com.cnµÄ·¢¼þÈ˽øÐÐÉóºË£º
smtpd_sender_restrictions =ÖÐÌí¼Ó£º
        check_recipient_access hash:/usr/local/etc/postfix/hrallclass
ÔÚ/usr/local/etc/postfixĿ¼Ï½¨Á¢¸ÃÎļþ
# ee /usr/local/etc/postfix/hrallclass
# postmap /usr/local/etc/postfix/hrallclass(»áÉú³Éhrallclass.db)
Îļþ/usr/local/etc/postfix/hrallclassÄÚÈÝÈçÏ£º
hrall@mydomain.com.cn    send2hrall
 
3)É趨Êý¾Ý±ímysql-send2hrall¼Ç¼ÄÄЩÈË¿ÉÒÔ¸øhrall@mydomain.com.cn·¢ËÍÓʼþ
Êý¾Ý¿âÖн¨Á¢±ímysql-send2hrallÖÐʹÓÃµÄ±í£¬
±í½á¹¹ÈçÏ£º
CREATE TABLE `mysql_send2hrall` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `ctime` int(11) unsigned default NULL,
  `source` varchar(128) NOT NULL default '',
  `access` varchar(16) NOT NULL default '',
  `type` char(1) NOT NULL default 'S',
  PRIMARY KEY  (`id`),
  KEY `source` (`source`,`type`,`access`,`ctime`)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=gb2312;
¶ÔÓ¦Êý¾Ý¸ñʽÈçÏÂ
source                     access
oksender@mydomain.com.cn     OK
oksender@otherdomain.com     OK
 
¹ý³Ì´ó¸ÅÈçÏ£º
   ÔÚsmtp·¢ËÍÓʼþµÄʱºò£¬Í¨¹ý check_recipient_access ÖлñÖª£ºhrall@mydomain.com.cn¸ÃÓʼþ½ÓÊÕµÄʱºòÐèÒª¸ù¾ÝÀàsend2hrallºË²é£¬¶ø¸ÃÀàÖж¨ÒåÁË·¢¼þÈ˺˲éµÄÐèÇ󣬴ÓÊý¾Ý¿â±íÖлñÈ¡´ËÐèÇóµÄ¾ßÌå½á¹û¡£Æ©ÈçÉÏÀýÖУ¬Èç¹û·¢¼þÈËÊÇoksender@mydomain.com.cn£¬»ñÈ¡µÄ½á¹û¾ÍΪok£¬ÕâÑùsmtp½«´ËÈË·¢¸øhrall@mydomain.com.cnµÄÓʼþ½øÐÐÕý³£Í¶µÝ£»ÆäËûÈç¹û²»ÔÚÊý¾Ý¿â±ímysql-send2hrallÖеÄÈË£¬½«¸ù¾ÝÏÂÃærejectµÄ¶¨Òå½øÐлؾø¡£
Ïà¹ØÎÄÕ ÈÈÃÅÎÄÕÂ
  • 9.4 Æô¶¯ºÍÍ£Ö¹Postfix·þÎñ
  • 9.3.1 postfix·þÎñµÄ»ù±¾ÅäÖÃ
  • 9.2 PostfixÓʼþ·þÎñµÄ°²×°
  • 18.16 PostfixÓʼþϵͳ
  • ÕýÈ·ÅäÖÃPostfixÀ´×èÖ¹À¬»øÓʼþ
  • Postfix µç×ÓÓʼþϵͳ¾«Òª
  • PostfixÅäÖÃStep By Step£¨Íê³Éƪ£©
  • PostfixÅäÖÃStep By Step£¨Èý£©
  • PostfixÅäÖÃStep By Step£¨¶þ£©
  • PostfixÅäÖÃStep By Step£¨Ò»£©
  • PostfixÓʼþϵͳµÄ°²×°ÓëÅäÖÃ
  • ÓÃPostfix¼ÜÉèFreeBSDÏÂÖÐС¹æÄ£Óʼþϵͳ
  • Install and configure Postfix with Cyrus-SASL+Cyru..
  • ÔÚFreeBSDÉϽ¨Á¢Ò»¸ö¹¦ÄÜÍêÕûµÄÓʼþ·þÎñÆ÷
  • postfix Óʼþ²¡¶¾¹ýÂË
  • ÔÚFedoraÉϽ¨Á¢×Ô¼ºµÄÓʼþ·þÎñÆ÷
  • Postfix + SpamAssassin °²ÑbÊÖƒÔ
  • Postfix + Courier-IMAP + Cyrus-SASL + MySQL + IMPÍ..
  • Postfix + Cyrus-SASL + Cyrus-IMAPD + PgSQL HOWTO
  • ÔÚFreeBSD5.1º††Î°²ÑbPostfix+Qpopper+Openwebmail
  • ÔÚRHEL 4 ÉÏÅäÖÃÈ«¹¦ÄܵÄPostfix ·þÎñÆ÷
  • Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP Íê..
  • ÎÒµÄPOSTFIX°²×°±Ê¼Ç
  • Postfixµç×ÓÓʾֵÄÅäÖò½Öè
  • ×ÔÓÉ¹ã¸æÇø
    ¡¡
     
    ×îÐÂÈí¼þÏÂÔØ
  • ORF Enterprise Edition 4.2 Õýʽ°æ
  • WinWebMail 3.7.7.3 ±ê×¼°æ
  • WinWebMail 3.7.7.3 ÆóÒµ°æ
  • BMailì÷ÓÊ
  • Merak Email Server for Windows 9.3.1..
  • Merak Email Server for Linux 9.3.1 ¼..
  • Merak Email Server 9.3.1 For Windwos..
  • AXIGEN Mail Server 6.1.1 for Windows
  • AXIGEN Mail Server 6.1.0 for Linux
  • ADModify.NETÏÂÔØ
  • symantec10.1»ù±¾°²×°¼°ÅäÖÃÊÓÆµ½Ì³Ì
  • Backup Exec System RecoveryÖ®±¸·ÝÊÓÆ..
  • ½ñÈÕÓʼþ¼¼ÊõÎÄÕÂ
  • ÃÀ´óѧÉúÇÖÈëÅåÁÖÖݳ¤¸öÈËÓʼþÕË»§±»´þ²¶
  • ˼¿ÆIronPort·¢²¼Ðµç×ÓÓʼþ°²È«É豸
  • Éî¸û"Èí¼þ+·þÎñ" ΢Èí300³ÇÊÐѲչî£ÓÊ
  • ´ÓºÚ¿Í³£Óù¥»÷Êֶο´WEBÓ¦Ó÷À»¤
  • ÏûÏ¢ÈËʿ͸¶ÑÅ»¢ÓëAOLºÏ²¢Ï¸½Ú½«ÓÚ±¾Ô..
  • ¹È¸èÌṩµÄµç×ÓÓʼþ´æµµÊ±¼äÑÓ³¤ÎªÊ®Äê
  • ÑÅ»¢½«ÔÚÓÊÏä·þÎñÖÐÕûºÏаæÔÚÏßÈÕÀú
  • 9ÔÂÀ¬»øÓʼþ×ÜÁ¿¼õÉÙ ÓëISPµ¹±ÕÓйØ
  • À¬»øÓʼþ·¢Õ¹µÄËÄ´óÇ÷ÊÆ
  • º«¹úÒéÔ±³ÆÖйúºÚ¿Íð³äÇàÍß̨·¢ËͲ¡¶¾..
  • VistaÄÑ³ÉÆøºò Windows XPÊÙÃü±»ÑÓ³¤
  • ÈüÃÅÌú¿ËÉý¼¶DLP²úÆ·¼°·´À¬»øÓʼþÍø¹Ø
  • ×îÐÂרÌâ
  • Sendmail ÓʼþϵͳÅäÖÃ
  • ×齨Exchange 2003Óʼþϵͳ
  • Windows Server 2008 רÌâ
  • ORF ·´À¬»øÓʼþϵͳ
  • Exchange Server 2007 רÌâ
  • ISA Server 2006 ½Ì³ÌרÌâ
  • Windows Vista ¼¼ÊõרÌâ
  • ¡°ºÚÝ®¡±£¨BlackBerry£©×¨Ìâ
  • ÒÆ¶¯µç×ÓÓʼþרÌâ
  • Apache James רÌâ
  • IMail Server ²Ù×÷Ö¸ÄÏ
  • ISA Server 2004 ʹÓÃרÌâ
  • ·ÖÀർº½
    ÓʼþÐÂÎÅ×ÊѶ:
    ITÒµ½ç | Óʼþ·þÎñÆ÷ | ÓʼþȤÎÅ | ÒÆ¶¯µçÓÊ
    µç×ÓÓÊÏä | ·´À¬»øÓʼþ|Óʼþ¿Í»§¶Ë|ÍøÂ簲ȫ
    ÐÐÒµÊý¾Ý | ÓʼþÈËÎï | ÍøÕ¾¹«¸æ | ÐÐÒµ·¨¹æ
    ÍøÂç¼¼Êõ:
    ÓʼþÔ­Àí | ÍøÂçЭÒé | ÍøÂç¹ÜÀí | ´«Êä½éÖÊ
    Ïß·½ÓÈë | ·ÓÉ½Ó¿Ú | Óʼþ´æ´¢ | »ªÎª3Com
    CISCO¼¼Êõ | ÍøÂçÓë·þÎñÆ÷Ó²¼þ
    ²Ù×÷ϵͳ:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | ÆäËü²Ù×÷ϵͳ
    Óʼþ·þÎñÆ÷:
    ³ÌÐòÓ뿪·¢ | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    ½ðµÑÓʼþϵͳ | ÆäËü |
    ·´À¬»øÓʼþ:
    ×ÛÊö| ¿Í»§¶Ë·´À¬»øÓʼþ|·þÎñÆ÷¶Ë·´À¬»øÓʼþ
    Óʼþ¿Í»§¶ËÈí¼þ:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | À×Äñ | Eudora |Becky! |Pegasus
    IncrediMail |ÆäËü
    µç×ÓÓÊÏä: ¸öÈËÓÊÏä | ÆóÒµÓÊÏä |Gmail
    ÒÆ¶¯µç×ÓÓʼþ:·þÎñÆ÷ | ¿Í»§¶Ë | ¼¼ÊõÇ°ÑØ
    ÓʼþÍøÂ簲ȫ:
    Èí¼þ©¶´ | °²È«ÖªÊ¶ | ²¡¶¾¹«¸æ |·À»ðǽ
    ¹¥·À¼¼Êõ | ²¡¶¾²éɱ| ISA | Êý×ÖÇ©Ãû
    ÓʼþÓªÏú:
    EmailÓªÏú | ÍøÂçÓªÏú | ÓªÏú¼¼ÇÉ |ÓªÏú°¸Àý
    ÓʼþÈ˲Å:ÕÐÆ¸ | Ö°³¡ | Åàѵ | Ö¸ÄÏ | Ö°³¡
    ½â¾ö·½°¸:
    Óʼþϵͳ|·´À¬»øÓʼþ |°²È« |ÒÆ¶¯µçÓÊ |Õбê
    ²úÆ·ÆÀ²â:
    Óʼþϵͳ |·´À¬»øÓʼþ |ÓÊÏä |°²È« |¿Í»§¶Ë
    ¹ã¸æÁªÏµ | ºÏ×÷ÁªÏµ | ¹ØÓÚÎÒÃÇ | ÁªÏµÎÒÃÇ | ·±ówÖÐÎÄ
    °æÈ¨ËùÓУºÓʼþ¼¼Êõ×ÊÑ¶Íø©2003-2007 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   ÔÁICP±¸05009143ºÅ