
Я часами ищу решение, но не нахожу его, и это сводит меня с ума.
Можно ли, не используя 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/
.
.