我在 Ubuntu 21.04 上使用 postfix sendmail 发送电子邮件时遇到问题。(错误消息如下)有人遇到过类似的问题吗?我很乐意得到任何建议或指点。谢谢!
操作系统:Ubuntu 21.04
postfix 软件包:postfix/hirsute-updates 3.5.6-1ubuntu0.2 amd64 [可从 3.5.6-1 升级]
当我尝试使用 postfix 提供的 sendmail 发送邮件时出现以下错误:
... # verbose output omitted
postdrop: fifo_trigger: open public/pickup: cannot open file: No such device or address
postdrop: send attr status = 0
postdrop: send attr reason =
postdrop: vstream_fflush_some: fd 1 flush 18
sendmail: vstream_buf_get_ready: fd 5 got 18
sendmail: /usr/sbin/postdrop -r -v -v -v: wanted attribute: status
sendmail: input attribute name: status
sendmail: input attribute value: 0
sendmail: /usr/sbin/postdrop -r -v -v -v: wanted attribute: (list terminator)
sendmail: input attribute name: reason
sendmail: input attribute value: (end)
sendmail: /usr/sbin/postdrop -r -v -v -v: wanted attribute: (list terminator)
sendmail: input attribute name: (end)
Pickup fifo其实是存在的:
prw-rw-rw- 1 postfix postfix 0 Feb 24 12:29 /var/spool/postfix/public/pickup
我也尝试了使用 unix socket 而不是 fifo 的变体,但得到了相同的错误(只有 unix_trigger 而不是 fifo_trigger)。
以下是我的配置(域名和IP匿名):
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
content_filter =
daemon_directory = /usr/lib/postfix
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
defer_transports =
disable_dns_lookups = yes
disable_vrfy_command = yes
header_checks = pcre:/etc/postfix/header_checks
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = 127.0.0.1
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains = example.org
masquerade_exceptions = root
message_size_limit = 28000000
mime_header_checks = pcre:/etc/postfix/header_checks
mydestination = $myhostname, localhost.$mydomain
mydomain = example.org
myhostname = bastion.example.org
mynetworks = 127.0.0.0/8, X.X.X.X/16, X.X.X.X/26 canonical_maps = hash:/etc/postfix/canonical virtual_maps = hash:/etc/postfix/virtual relocated_maps = hash:/etc/postfix/relocated transport_maps = hash:/etc/postfix/transport sender_canonical_maps = hash:/etc/postfix/sender_canonical
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost = [mail.eclipse.org]
sample_directory = /usr/share/doc/packages/postfix/samples
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, reject_invalid_hostname, reject_unauth_pipelining, reject_non_fqdn_sender, reject_unknown_recipient_domain, permit
smtpd_sasl_auth_enable = no
smtpd_sender_restrictions = reject_non_fqdn_sender,reject_unknown_sender_domain,reject_invalid_hostname
smtpd_use_tls = no
strict_rfc821_envelopes = no
unknown_local_recipient_reject_code = 550
master.cf 的内容
smtp inet n - n - - smtpd
submission inet n - n - - smtpd
-o smtpd_sasl_auth_enable=yes
-o smtpd_tls_security_level=may
-o smtpd_tls_wrappermode=yes
-o content_filter=smtp-amavis:[127.0.0.1]:10026
pickup fifo n - - 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 300 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
relay unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
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
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
discard unix - - n - - discard
smtp-amavis unix - - n - 4 smtp
-o smtp_send_xforward_command=yes
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-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 smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
-o local_header_rewrite_clients=
retry unix - - n - - error
proxywrite unix - - n - 1 proxymap
我在网上找到的所有解决方案都指出了我已经进行的配置更改,即
pickup fifo n - - 60 1 pickup
或者
pickup unix n - - 60 1 pickup
任何想法?
答案1
事实证明,我使用了过时的配置指令,setgid_group = maildrop
而main.cf
不是setgid_group = postdrop