postfix 进行本地传送,而不是通过 dovecot lmtp

postfix 进行本地传送,而不是通过 dovecot lmtp

Sieve 没有在我的系统上运行,看起来原因是 postfix 正在进行本地 maildir 传递而不是通过 dovecot。

详细信息:系统:Ubuntu 20.10

/etc/postfix/main.cf:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, example.com, localhost
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 <IP ADDRESSES>
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = _
relayhost =
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_pipelining reject_non_fqdn_recipient reject_unknown_recipient_domain reject_unauth_destination reject
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = mail.example.com
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = no
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_cert_file = /etc/postfix/ssl/mailserver.crt
smtpd_tls_key_file = /etc/postfix/ssl/mailserver.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = hash:/etc/postfix/virtual

virtual_transport = lmtp:unix:private/dovecot-lmtp
#mailbox_transport = lmtp:unix:private/dovecot-lmtp
#local_transport = lmtp:unix:private/dovecot-lmtp

当我尝试使用上述任一选项而不是时virtual_transport,邮件开始变得无法送达。

/etc/dovecot/dovecot.conf:

!include_try /usr/share/dovecot/protocols.d/*.protocol
!include conf.d/*.conf
!include_try local.conf
protocols = lmtp imap

/etc/dovecot/conf.d/10-master.conf(摘录):

service lmtp {
 unix_listener /var/spool/postfix/private/dovecot-lmtp {
   group = postfix
   mode = 0600
   user = postfix
  }
}

在/etc/postfix/虚拟:

MAILER-DAEMON   admin
postmaster      admin
support         admin
abuse           admin
logcheck        admin
root            admin

example.com         xxxxx
[email protected]   user1
[email protected]  user1
[email protected]  user1
[email protected]   user2

答案1

你告诉 postfix如何将邮件递送virtual至 dovecot 的目的地。

你可能没有告诉 postfix:哪个目的地将通过 进行处理,local并传递给virtual

例如,定义local交通目的地的方式可能如下:

mydestination = example.com, localhost
virtual_alias_maps =

定义运输目的地virtual可能看起来像这样:

mydestination =
virtual_alias_maps = hash:/etc/postfix/virtual

我怀疑您想从 中删除将通过 lmtp 传输到 dovecot&sieve 的域mydestination。 有一个空的 是完全有效的mydestination,例如如果全部收到的邮件被传递给dovecot。

相关内容