实现的功能:------------------------------------------------------------------------------------------------来源                   目的             条件------------------------------------------------------------------------------------------------From: 本地域         To: 任何地址     必须认证且验证用户和From:必须一致From: 任何非本地地址     To: 本地地址     无需认证From: 任何非本地       To: 任何地址     拒绝------------------------------------------------------------------------------------------------打开 main.cf (注意加粗部分的参数设置)------------------------------------------------------------------------------------------------###################BASE##################myhostname=_HOSTNAME_mydomain = _DOMAIN_mydestination = $myhostnamelocal_recipient_maps = command_directory = /usr/local/sbin#local_transport = virtualsmtpd_banner = _DOMAIN_ ESMTP Mail Systemmessage_size_limit = 14680064#mailbox_size_limit = 512000000#################MySQL################virtual_alias_maps =mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cfvirtual_gid_maps = static:125virtual_uid_maps = static:125#virtual_minimum_uid = 125virtual_mailbox_base = /home/data/domainsvirtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cfvirtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cfvirtual_transport = virtual################Quota################virtual_create_maildirsize = yesvirtual_mailbox_extended = yesvirtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql_virtual_limit_maps.cfvirtual_mailbox_limit_override = yesvirtual_maildir_limit_message = Sorry,the user's Maildir has overdrawn his diskspace quota ,please tray again later.virtual_overquota_bounce = yes##############SASL####################smtpd_sasl_auth_enable = yessmtpd_sasl2_auth_enable = yessmtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_recipient_restrictions =    permit_mynetworks,    permit_sasl_authenticated,    reject_unknown_sender_domain,    reject_non_fqdn_sender,    reject_non_fqdn_recipient,    reject_unknown_recipient_domain,    reject_unauth_pipelining,    reject_unauth_destination,    permit#列出本地用户的列表,以便验证 From: 本地域 To: 本地域smtpd_sender_login_maps =    mysql:/usr/local/etc/postfix/mysql_virtual_sender_maps.cf,    mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cfsmtpd_reject_unlisted_sender = yes#本地域向本地域发信也需要SMTP身份验证smtpd_sender_restrictions =    reject_sender_login_mismatch,    reject_authenticated_sender_login_mismatch,    reject_unauthenticated_sender_login_mismatchcontent_filter = smtp-amavis:[127.0.0.1]:10024readme_directory = nosample_directory = /usr/local/etc/postfixsendmail_path = /usr/local/sbin/sendmailhtml_directory = nosetgid_group = maildropmanpage_directory = /usr/local/mandaemon_directory = /usr/local/libexec/postfixnewaliases_path = /usr/local/bin/newaliasesmailq_path = /usr/local/bin/mailqqueue_directory = /var/spool/postfixmail_owner = postfix------------------------------------------------------------------------------------------------通过MYSQL查询获得本地接收的邮件地址列表。mysql:/etc/postfix/mysql_virtual_alias_user_maps.cfmysql:/etc/postfix/mysql_virtual_user_maps.cf------------------------------------------------------------------------------------------------mysql_virtual_alias_maps.cf------------------------------------------------------------------------------------------------user = extmailpassword = _PASSWD_ hosts = localhostdbname = extmailtable = aliasselect_field = gotowhere_field = addressadditional_conditions = AND active = '1'------------------------------------------------------------------------------------------------mysql_virtual_sender_maps.cf------------------------------------------------------------------------------------------------user = extmailpassword = _PASSWD_ hosts = localhostdbname = extmailtable = mailboxselect_field = usernamewhere_field = usernameadditional_conditions = AND active = '1'以上文章也是参考了网上的一些文章后完成的一些设置,希望对你有点帮助!    

03-14 03:46