这是我的main.cf:
myhostname = mail.mydomain.co.za
myorigin = mydomain.co.za
mydestination = mail.mydomain.co.za, mydomain.co.za, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/24 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.mydomain.co.za/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.mydomain.co.za/privkey.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level=may
smtpd_tls_protocols = !SSLv2, !SSLv3
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
smtpd_relay_restrictions = permit_mynetworks, reject
smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
maillog_file = /var/log/mail.log
这是我的master.cf:
smtp inet n - n - - smtpd
submission inet n - y - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_tls_wrappermode=no
-o smtpd_sasl_auth_enable=yes
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
smtps inet n - y - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
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
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o syslog_name=postfix/$service_name
showq unix n - n - - showq
error unix - - n - - error
retry 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
postlog unix-dgram n - n - 1 postlogd
policyd-spf unix - n n - 0 spawn
user=policyd-spf argv=/usr/libexec/postfix/policyd-spf
现在我尝试在 main.cf 中不使用“smtpd_recipient_restrictions”,只在 master.cf 中使用,但 postfix 给出了错误。我尝试在两个文件中都使用“smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject”,但“smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination”仍然出现标题错误。我尝试在 master.cf 中注释掉“-o smtpd_recipient_restrictions”,但没有帮助。
请帮帮我,我该怎么办?我是新手。
答案1
感谢您提供关于这是中继问题的线索。我将 smtpd_relay_restrictions = permit_mynetworks, rejection 更改为 smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, rejection_unauth_destination,现在一切正常。