当邮件从其他邮件服务器(yahoo/gmail)到达我的 postfix 服务器时,它会被拒绝,并且不会使用我配置的传输方式进行传输。我检查了一整天都没有发现任何东西,希望你们能帮助我。
收到此错误:
3 月 20 日 17:41:19 smtp postfix/smtpd[2103]: NOQUEUE: 拒绝:来自 mail.com 的 RCPT [xxx.xxx.xxx.xxx]: 554 5.7.1 user_at_transport.com: 中继访问被拒绝;来自=sales_at_mail.com 到=user_at_domain_on_transport.com proto=ESMTP helo=mail.com
queue_directory = /raid/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = smtp.example.com
unknown_address_reject_code = 554
unknown_client_reject_code = 554
unknown_hostname_reject_code = 554
mynetworks = /etc/postfix/mynetworks
relay_domains = /etc/postfix/relay_domains
relay_recipient_maps = hash:/etc/postfix/relay_recipient_maps
virtual_maps = hash:/etc/postfix/virtual
transport_maps = hash:/etc/postfix/transport
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mailbox_command = /usr/bin/procmail
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/header_checks
default_destination_concurrency_limit = 50
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
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.2.10/samples
readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
lmtp_tcp_port = 2003
maximal_queue_lifetime = 7d
message_size_limit = 32000000
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
reject_rbl_client b.barracudacentral.org
reject_rbl_client cbl.abuseat.org
reject_rbl_client zen.spamhaus.org
reject_rbl_client rabl.nuclearelephant.com
reject_rbl_client bl.spamcop.net
permit_mynetworks
smtpd_helo_required = yes
smtpd_helo_restrictions = check_helo_access hash:/etc/postfix/access
reject_unauth_pipelining
reject_invalid_hostname
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/access
reject_non_fqdn_sender
reject_unknown_sender_domain
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_access
check_recipient_access hash:/etc/postfix/access
reject_non_fqdn_recipient
reject_unknown_recipient_domain
permit_mx_backup
permit_mynetworks
reject_unauth_destination
smtpd_client_connection_count_limit = 5
smtpd_client_connection_rate_limit = 30
smtpd_client_connection_limit_exceptions = 202.xxx.xxx.xxx/24
smtpd_client_event_limit_exceptions = 202.xxx.xxx.xxx/24
permit_mx_backup_networks = /etc/postfix/mynetworks
203.xxx.xxx.xxx/32
address_verify_map = hash:/etc/postfix/verify
address_verify_sender = [email protected]
address_verify_negative_cache = yes
address_verify_negative_refresh_time = 1d
disable_vrfy_command = yes
smtpd_banner = $myhostname
smtpd_delay_reject = no
strict_rfc821_envelopes = yes
smtpd_error_sleep_time = 0s
smtpd_soft_error_limit = 5
smtpd_hard_error_limit = 10
html_directory = no
bounce_queue_lifetime = 60m
biff = no
unknown_local_recipient_reject_code = 450
smtp inet n - n - - smtpd
-o content_filter=smtp-amavis:127.0.0.1:10024
-o receive_override_options=no_address_mappings
pickup fifo n - n 60 1 pickup
-o content_filter=
-o receive_override_options=no_header_body_checks
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
smtp-amavis unix - - y - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n - y - - smtpd
-o content_filter=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o receive_override_options=no_header_body_checks
-o smtpd_bind_address=127.0.0.1
-o smtpd_helo_required=no
-o smtpd_client_restrictions=
-o smtpd_restriction_classes=
-o disable_vrfy_command=no
-o strict_rfc821_envelopes=yes
dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d ${recipient}
vacation unix - n n - - pipe
flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}
答案1
要允许您的服务器充当其他邮件域的中继,您需要三个不同的部分。首先,您需要告诉 postfix 它负责域。这通常在选项中完成virtual_mailbox_domains
,例如
virtual_mailbox_domains=/etc/postfix/virtual_domains.txt
您/etc/postfix/virtual_domains.txt
需要列出域,每行 1 个:
example.net
domain.com
然后需要告诉 postfix 最终目的地不是本地机器,这在传输表中完成:
example.net smtp:[1.2.3.4]
domain.com smtp:[mail.domain.com]
传输表有多种配置方式,读取文档建议找到最适合您情况的解决方案。我发布的示例使用[]
最终目的地来排除 MX 查找。
最后,您将需要为您想要中继的域名创建一个 MX 记录,指向您的邮件服务器。