我搜索了几个小时却没有找到解决方案,这让我发疯了。
是否可以在不使用 Procmail 的情况下确保 Postfix 以 Maildir 的形式发送电子邮件{cur,new,tmp}
?
/var/spool/mail/$USER
如何做到?
我有mail_spool_directory = /var/spool/mail
,但是它把我扔掉了,因为它想在那里创建一个邮箱,并且它在那里找到了一个目录:
(cannot update mailbox /var/spool/mail/regine for user regine. cannot open file: Is a directory)
如果我添加home_mailbox = ./
或home_mailbox = /
,邮件将以 Maildir 格式传递,但在 中/home/regine/{cur,new,tmp}
。
我怎样才能拥有相同的 Maildir 格式/var/spool/mail/USER/
?
Postfix 的配置:
# postconf -n
append_at_myorigin = yes
append_dot_mydomain = no
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/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
home_mailbox = ./
html_directory = no
inet_protocols = ipv4
luser_relay = [email protected]
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 204800000
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
maximal_queue_lifetime = 30d
message_size_limit = 102400000
meta_directory = /etc/postfix
mydestination = localhost.$mydomain, localhost
mydomain = domain.fr
myhostname = vps1.domain.fr
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical_maps
recipient_delimiter = +
relay_domains = $mydomain domain.com
relay_recipient_maps = hash:/etc/postfix/relay_recipients regexp:/etc/postfix/relay_recipients-regexp
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix/${mail_version}
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_scache
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_non_fqdn_recipient reject_unknown_recipient_domain reject_unauth_destination reject_unauth_pipelining reject_rbl_client noptr.spamrats.com reject_rbl_client spam.spamrats.com reject_rbl_client dyna.spamrats.com
smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtpd_tls_cert_file = /etc/letsencrypt/live/vps1.domain.fr/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/vps1.domain.fr/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
unverified_sender_reject_code = 550
答案1
如果希望 postfix 使用 Maildirs,则必须在 mail_spool_directory 配置值的末尾添加一个斜杠。否则它将使用 mbox 样式的传递。
因此,在您的情况下,您需要将 mail_spool_directory 的值更改为mail_spool_directory = /var/spool/mail/
。
。