如果本地交付在postfix中失败,我如何将外发邮件发布到互联网?
我的服务器有configuration了mydomain.tld的虚拟域。 当我发送电子邮件到[email protected]它尝试本地交付,如果没有find用户失败。 相反,我需要将这些邮件发布到互联网上。
上述要求的原因是我有多个服务器configurationmydomain.tld。 不同的用户在不同的服务器,但同一个域 – mydomain.tld(我有一个传入邮件的工作机制)
这是我的main.cf文件。
# postfix config file # uncomment for debugging if needed # soft_bounce=yes # postfix main mail_owner = postfix setgid_group = postdrop delay_warning_time = 4 # postfix paths html_directory = no command_directory = /usr/sbin daemon_directory = /usr/lib/postfix queue_directory = /var/spool/postfix sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.2.2/samples readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES # network settings inet_interfaces = all mydomain = mail1.mydomain.com myhostname = mail1.mydomain.com mynetworks = all mydestination = localhost.$mydomain, localhost #relay_domains = proxy:mysql:/etc/configs/postfix/mysql-relay_domains_maps.cf # mail delivery recipient_delimiter = + # mappings alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases #transport_maps = hash:/etc/postfix/transport #local_recipient_maps = #local_transport = error:local mail delivery is disabled # virtual setup virtual_alias_maps = proxy:mysql:/etc/configs/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/configs/postfix/virtual_regexp virtual_mailbox_base = /var/vmail virtual_mailbox_domains = proxy:mysql:/etc/configs/postfix/mysql-virtual_domains_maps.cf virtual_mailbox_maps = proxy:mysql:/etc/configs/postfix/mysql-virtual_mailbox_maps.cf virtual_mailbox_limit_maps = proxy:mysql:/etc/configs/postfix/mysql-virtual_mailbox_limit_maps.cf virtual_minimum_uid = 150 virtual_uid_maps = static:150 virtual_gid_maps = static:8 virtual_transport = dovecot dovecot_destination_recipient_limit = 1 # debugging debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5 # authentication smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname broken_sasl_auth_clients = yes smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth # tls config smtp_use_tls = no smtpd_use_tls = no #smtp_tls_note_starttls_offer = yes #smtpd_tls_loglevel = 1 #smtpd_tls_received_header = yes #smtpd_tls_session_cache_timeout = 3600s #tls_random_source = dev:/dev/urandom #smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache # Change mail.example.com.* to your host name #smtpd_tls_key_file = /etc/pki/tls/private/mail.example.com.key #smtpd_tls_cert_file = /etc/pki/tls/certs/mail.example.com.crt # smtpd_tls_CAfile = /etc/pki/tls/root.crt # rules restrictions smtpd_client_restrictions = smtpd_helo_restrictions = smtpd_sender_restrictions = smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain # uncomment for realtime black list checks # ,reject_rbl_client zen.spamhaus.org # ,reject_rbl_client bl.spamcop.net # ,reject_rbl_client dnsbl.sorbs.net smtpd_helo_required = yes unknown_local_recipient_reject_code = 550 disable_vrfy_command = yes smtpd_data_restrictions = reject_unauth_pipelining
提前感谢任何答案。
我build议你删除所有的virtual_mailbox_ *参数,只使用transport_maps和relay_domains。
在master.cf中设置“dovecot:”运输,通过dovecot LDA或dovecot LMTP发送邮件。 例如:
dovecot unix - nn - - pipe flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}
接下来的动作是把mydomain.tld附加到你的relay_domains。
之后,为transport_mapsconfiguration一个SQLconfiguration文件,为每个现有用户提供诸如“dovecot:”的结果。 否则不要在这里返回任何东西。 还可以使用以下条目为transport_maps创build散列表:
mydomain.tld [other.mailserver.mydomain.tld]
最后一行是mydomain.tld的默认中继主机。 任何匹配的电子邮件地址将覆盖此默认值,因此会传送到您的本地dovecot服务器。