我的服务器崩溃了,之后 postfix 就无法再发送邮件了。日志中出现以下消息:
Dec 26 21:21:00 xx postfix/smtpd[14725]: connect from localhost[::1]
Dec 26 21:21:00 xx postfix/smtpd[14725]: warning: lookup [email protected], NIS domain xxx.nl, map mail.aliases: internal yp server or client error
Dec 26 21:21:00 xx postfix/smtpd[14725]: warning: nis:mail.aliases lookup error for "[email protected]"
Dec 26 21:21:00 xx postfix/smtpd[14725]: NOQUEUE: reject: RCPT from localhost[::1]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<gassoon>
昨天(当 postfix 运行时没有问题)我看到了一行日志:
warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
为什么 Postfix 现在认为应该使用 NIS?
postfinger 的输出:
postfinger - postfix configuration on Sun 26 Dec 2021 09:32:18 PM CET
version: 1.30
Warning: postfinger output may show private configuration information,
such as ip addresses and/or domain names which you do not want to show
to the public. If this is the case it is your responsibility to modify
the output to hide this private information. [Remove this warning with
the --nowarn option.]
--System Parameters--
mail_version = 3.4.14
hostname = gassoon
uname = Linux gassoon 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64 GNU/Linux
--Packaging information--
looks like this postfix comes from deb package: postfix-3.4.14-0+deb10u1
--main.cf non-default parameters--
alias_database = mysql:/etc/postfix/mysql-aliases.cf
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = $myhostname, [removed server names]
myhostname = [removed server]
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
non_smtpd_milters = inet:localhost:8891
readme_directory = no
recipient_delimiter = +
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_milters = inet:localhost:8891
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = gassoon[removed domain]
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/gassoon[removed domain]/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/gassoon[removed domain]/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
virtual_alias_maps = mysql:/etc/postfix/mysql-aliases.cf
--master.cf--
smtp inet n - y - - smtpd
submission inet n - y - - smtpd
-o smtpd_etrn_restrictions=reject
-o smtpd_enforce_tls=yes
-o smtpd_sasl_auth_enable=yes
pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 bounce
verify unix - - y - 1 verify
flush unix n - y 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
-o syslog_name=postfix/$service_name
showq unix n - y - - showq
error unix - - y - - error
retry unix - - y - - error
discard unix - - y - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - y - - lmtp
anvil unix - - y - 1 anvil
scache unix - - y - 1 scache
postlog unix-dgram n - n - 1 postlogd
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/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=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
-- end of postfinger output --
答案1
噗,搜索了几个小时,终于找到了
postconf
有一个输出行:
alias_maps = hash:/etc/aliases, nis:....
我添加了一行main.cf
alias_maps = hash:/etc/aliases
邮件如潮水般涌来。