Linux

後綴:拒絕reject_unknown_recipient_domain 並接收即時電子郵件通知

  • February 12, 2014

當電子郵件發送到不存在的域或收件人時,我希望發件人立即收到來自 mailer-daemon 的電子郵件,通知收件人不存在。

實際上,在我的系統上發生的事情是電子郵件進入延遲隊列並在配置中指定的時間停留在那裡。正如我 delay_warning_time = 30m在隊列中 30 分鐘後設置的那樣,發件人會收到通知,但這不是我想要的不存在的地址。我想要的是立即拒絕電子郵件並通知發件人。

有誰知道我做錯了什麼?多謝

目前,不存在的收件人電子郵件站在後綴隊列中:

# 郵件
-Queue ID---Size-- ----到達時間---- -Sender/Recipient-----
AA6CA48DCC 1496 2 月 12 日星期三 12:56:36 user@domain.com
(連接到 mx.email-srv.com[199.231.85.98]:25:連接超時)
foo@gmai.com

6FF9948DFF 1498 2 月 12 日星期三 13:07:04 user@domain.com
(連接到 mx.email-srv.com[199.231.85.98]:25:連接超時)
foo@gmai.com

這是我的後綴配置:

2bounce_notice_recipient = $delay_notice_recipient
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = 否
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
delay_notice_recipient = 管理員
delay_warning_time = 30m
disable_vrfy_command = 是
header_checks = 正則表達式:/etc/postfix/header_checks
html_directory = 否
inet_interfaces = 所有
inet_protocols = 所有
local_recipient_maps =
mail_owner = 後綴
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
masquerade_domains = mail.domain.es mail.domain.com hostname.domain.es hostname.domain.com
maximum_backoff_time = 8000s
maximal_queue_lifetime = 5d
milter_default_action = 接受
軍事協議 = 2
minimum_backoff_time = 1000s
我的目的地 =
mydomain = domain.es
我的主機名 = mail.domain.es
mynetworks_style = 主機
myorigin = domain.es
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
queue_directory = /var/spool/postfix
自述目錄 = /usr/share/doc/postfix-2.6.6/README_FILES
中繼主機 =
relocated_maps = mysql:/etc/postfix/mysql_relocated.cf
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_helo_timeout = 60s
smtp_tls_CAfile = /etc/ssl/certs/sf_bundle.crt
smtp_tls_note_starttls_offer = 是
smtp_tls_security_level = 可能
smtp_use_tls = 是
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org,reject_rbl_client blackholes.easynet.nl,reject_rbl_client dnsbl.njabl.org
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = 是
smtpd_hard_error_limit = 12
smtpd_helo_required = 是
smtpd_helo_restrictions = permit_mynetworks、permit_sasl_authenticated、warn_if_reject reject_non_fqdn_hostname、reject_invalid_hostname、permit
smtpd_milters = inet:localhost:8891
smtpd_recipient_limit = 16
smtpd_recipient_restrictions = reject_unauth_pipelining、permit_mynetworks、reject_non_fqdn_recipient、reject_unknown_recipient_domain、reject_unauth_destination、reject_unknown_helo_hostname、permit_sasl_authenticated、permit
smtpd_sasl_auth_enable = 是
smtpd_sasl_local_domain =
smtpd_sasl_security_options = 匿名
smtpd_sender_restrictions = permit_sasl_authenticated、permit_mynetworks、warn_if_reject reject_non_fqdn_sender、reject_unknown_sender_domain、reject_unauth_pipelining、permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/ssl/certs/domain.es.crt
smtpd_tls_key_file = /etc/ssl/private/domain.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = 是
smtpd_tls_security_level = 可能
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
transport_maps = mysql:/etc/postfix/mysql_transport.cf
transport_retry_time = 30s
unknown_local_recipient_reject_code = 450
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = 靜態:5000
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
virtual_uid_maps = 靜態:5000

postfix 應該如何知道電子郵件是否不存在,或者遠端伺服器是否不可用(您的隊列卡住的郵件似乎就是這種情況)。通常,postfix 會嘗試發送郵件,但除非它從遠端伺服器得到明確的答复,通常是 550 個答复(450 個範圍表示暫時不可用),postfix 無法確定郵件是否存在,或者是否存在是其他一些問題,可能允許稍後成功發送電子郵件。

引用自:https://serverfault.com/questions/574993