我有一个包含几百个电子邮件地址的域。我们正在将我们的主机迁移到多个 ISPConfig 服务器。我的问题是,如果有人发送电子邮件,[email protected]
并且如果第一台服务器上不存在该电子邮件,我怎么能告诉后缀不要回复
550 5.1.1 收件人地址被拒绝:虚拟邮箱表中的用户未知(回复 RCPT TO 命令)
但是要将邮件转发到电子邮件所在的 MX 第二个服务器。
我试图像这样扩展我的后缀 main.cf 配置:
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf, hash:/etc/postfix/transport
/etc/postfix/transport
看起来像这样:
中继:[服务器的 IPv4 地址]
但它没有用。
我的配置是:
address_verify_virtual_transport = $virtual_transport
propagate_unmatched_extensions = canonical, virtual
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_outgoing_bcc.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender_login_maps.cf
smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re , permit_mynetworks, permit_sasl_authenticated, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_foreign.re
transport_maps = hash:/var/lib/mailman/data/transport-mailman, hash:/etc/postfix/transport, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
virtual_alias_address_length_limit = 1000
virtual_alias_domains =
virtual_alias_expansion_limit = 1000
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_alias_recursion_limit = 1000
virtual_delivery_slot_cost = $default_delivery_slot_cost
virtual_delivery_slot_discount = $default_delivery_slot_discount
virtual_delivery_slot_loan = $default_delivery_slot_loan
virtual_delivery_status_filter = $default_delivery_status_filter
virtual_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
virtual_destination_concurrency_limit = $default_destination_concurrency_limit
virtual_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
virtual_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
virtual_destination_rate_delay = $default_destination_rate_delay
virtual_destination_recipient_limit = $default_destination_recipient_limit
virtual_extra_recipient_limit = $default_extra_recipient_limit
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
virtual_initial_destination_concurrency = $initial_destination_concurrency
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_lock = fcntl, dotlock
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_minimum_delivery_slots = $default_minimum_delivery_slots
virtual_minimum_uid = 100
virtual_recipient_limit = $default_recipient_limit
virtual_recipient_refill_delay = $default_recipient_refill_delay
virtual_recipient_refill_limit = $default_recipient_refill_limit
virtual_transport = dovecot
virtual_transport_rate_delay = $default_transport_rate_delay
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
postconf |grep smtpd_recipient
smtpd_recipient_limit = 1000
smtpd_recipient_overshoot_limit = 1000
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf
transport_map 是确定如何交付的方法,但它在“smtpd_reject_unlisted_recipient”或 smtpd_recipient_restrictions = reject_unlisted_recipient, ...
因此,您还需要为 OTHER 邮件服务器中的收件人添加验证,而不仅仅是当前服务器中的用户。
您在 smtpd_recipient_restrictions = .... check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf,... 它还必须在其他邮件服务器中找到有效用户列表。可以直接使用 SQL 查找其他邮件服务器,也可以将列表导出到映射文件(定期使用 cron),以便在其他邮件服务器关闭时不会失败。在我的例子中,我使用 ldap 来查找有效用户,并创建一个包含所有有效收件人邮件地址列表的本地文件。您也可以使用相同的方法创建传输映射 + 一些脚本在每个邮件地址后添加 smtp:[ipaddress.othermailserver]
您可以在调试模式 (-D) 和/或详细日志记录 (-vvv) 下启动 postfix,以查看它如何评估拒绝。
另请参阅 http://www.postfix.org/postconf.5.html#smtpd_reject_unlisted_recipient
您今天如何验证收到的邮件、本地 linux 用户或 Ldap/SQl/xyz 的邮件地址?可以分享吗
sudo postconf |grep 虚拟
sudo postconf |grep 收件人