make Postfix -> Dovecot delivery over LMTP (was LDA) (#305) (#360)

This commit is contained in:
Kai Ren 2016-10-24 16:03:08 +03:00 committed by Thomas VIAL
parent 50a3418d7f
commit a62062c382
6 changed files with 25 additions and 14 deletions

View file

@ -13,6 +13,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q --fix-missing && \
curl \ curl \
dovecot-core \ dovecot-core \
dovecot-imapd \ dovecot-imapd \
dovecot-lmtpd \
dovecot-managesieved \ dovecot-managesieved \
dovecot-pop3d \ dovecot-pop3d \
dovecot-sieve \ dovecot-sieve \

View file

@ -47,7 +47,8 @@ service pop3-login {
service lmtp { service lmtp {
unix_listener lmtp { unix_listener lmtp {
#mode = 0666 mode = 0660
group = postfix
} }
# Create inet listener only if you can't use the above UNIX socket # Create inet listener only if you can't use the above UNIX socket

View file

@ -0,0 +1,19 @@
##
## LMTP specific settings
##
# Support proxying to other LMTP/SMTP servers by performing passdb lookups.
#lmtp_proxy = no
# When recipient address includes the detail (e.g. user+detail), try to save
# the mail to the detail mailbox. See also recipient_delimiter and
# lda_mailbox_autocreate settings.
#lmtp_save_to_detail_mailbox = no
# Verify quota before replying to RCPT TO. This adds a small overhead.
#lmtp_rcpt_check_quota = no
protocol lmtp {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins sieve
}

View file

@ -58,14 +58,10 @@ smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes broken_sasl_auth_clients = yes
# Mail directory # Mail directory
virtual_mailbox_base = /var/mail virtual_transport = lmtp:unix:/var/run/dovecot/lmtp
virtual_mailbox_domains = /etc/postfix/vhost virtual_mailbox_domains = /etc/postfix/vhost
virtual_mailbox_maps = hash:/etc/postfix/vmailbox virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_alias_maps = hash:/etc/postfix/virtual virtual_alias_maps = hash:/etc/postfix/virtual
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
# Enable Dovecot Sieve
virtual_transport = dovecot
# Additional option for filtering # Additional option for filtering
content_filter = smtp-amavis:[127.0.0.1]:10024 content_filter = smtp-amavis:[127.0.0.1]:10024

View file

@ -45,7 +45,7 @@ retry unix - - - - - error
discard unix - - - - - discard discard unix - - - - - discard
local unix - n n - - local local unix - n n - - local
virtual unix - n n - - virtual virtual unix - n n - - virtual
lmtp unix - - - - - lmtp lmtp unix - - n - - lmtp
anvil unix - - - - 1 anvil anvil unix - - - - 1 anvil
scache unix - - - - 1 scache scache unix - - - - 1 scache
@ -63,12 +63,6 @@ mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user} ${nexthop} ${user}
#
# Dovecot LDA configuration
#
dovecot unix - n n - - pipe
flags=DRhu user=docker argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -m ${extension}
# #
# Amavis configuration # Amavis configuration

View file

@ -149,7 +149,7 @@
} }
@test "checking smtp: delivers mail to existing account" { @test "checking smtp: delivers mail to existing account" {
run docker exec mail /bin/sh -c "grep 'status=sent (delivered via dovecot service)' /var/log/mail/mail.log | wc -l" run docker exec mail /bin/sh -c "grep 'postfix/lmtp' /var/log/mail/mail.log | grep 'status=sent' | grep ' Saved)' | wc -l"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ "$output" -eq 6 ] [ "$output" -eq 6 ]
} }