diff --git a/roles/ispmail-dovecot/files/10-master.conf b/roles/ispmail-dovecot/files/10-master.conf index 737b3e0..ff5d9f8 100644 --- a/roles/ispmail-dovecot/files/10-master.conf +++ b/roles/ispmail-dovecot/files/10-master.conf @@ -46,15 +46,17 @@ service pop3-login { } service lmtp { - unix_listener lmtp { - #mode = 0666 + unix_listener /var/spool/postfix/private/dovecot-lmtp { + group = postfix + mode = 0600 + user = postfix } # Create inet listener only if you can't use the above UNIX socket #inet_listener lmtp { # Avoid making LMTP visible for the entire internet #address = - #port = + #port = #} } @@ -88,8 +90,8 @@ service auth { # permissions (e.g. 0777 allows everyone full permissions). unix_listener auth-userdb { #mode = 0666 - #user = - #group = + #user = + #group = } # Postfix smtp-auth @@ -115,7 +117,7 @@ service dict { # For example: mode=0660, group=vmail and global mail_access_groups=vmail unix_listener dict { #mode = 0600 - #user = - #group = + #user = + #group = } } diff --git a/roles/ispmail-dovecot/files/20-lmtp.conf b/roles/ispmail-dovecot/files/20-lmtp.conf new file mode 100644 index 0000000..cd3caaf --- /dev/null +++ b/roles/ispmail-dovecot/files/20-lmtp.conf @@ -0,0 +1,20 @@ +## +## 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 + mail_plugins = $mail_plugins sieve +} diff --git a/roles/ispmail-dovecot/tasks/main.yml b/roles/ispmail-dovecot/tasks/main.yml index 19d5350..41bd456 100644 --- a/roles/ispmail-dovecot/tasks/main.yml +++ b/roles/ispmail-dovecot/tasks/main.yml @@ -26,8 +26,8 @@ - name: Copying SSL configuration (10-ssl.conf) copy: src=10-ssl.conf dest=/etc/dovecot/conf.d/10-ssl.conf notify: restart dovecot -- name: Copying LDA configuration (10-lda.conf - enable sieve plugin) - template: src=15-lda.conf.j2 dest=/etc/dovecot/conf.d/15-lda.conf +- name: Copying LMTP configuration (20-lmtp.conf - enable sieve plugin) + copy: src=20-lmtp.conf dest=/etc/dovecot/conf.d/20-lmtp.conf notify: restart dovecot - name: Copying mailboxes configuration (15-mailboxes.conf - autocreate folders) copy: src=15-mailboxes.conf dest=/etc/dovecot/conf.d/15-mailboxes.conf diff --git a/roles/ispmail-dovecot/templates/15-lda.conf.j2 b/roles/ispmail-dovecot/templates/15-lda.conf.j2 deleted file mode 100644 index 2d7ccc9..0000000 --- a/roles/ispmail-dovecot/templates/15-lda.conf.j2 +++ /dev/null @@ -1,48 +0,0 @@ -## -## LDA specific settings (also used by LMTP) -## - -# Address to use when sending rejection mails. -# Default is postmaster@. %d expands to recipient domain. -postmaster_address = {{ispmail_postmaster_address}} - -# Hostname to use in various parts of sent mails (e.g. in Message-Id) and -# in LMTP replies. Default is the system's real hostname@domain. -#hostname = - -# If user is over quota, return with temporary failure instead of -# bouncing the mail. -#quota_full_tempfail = no - -# Binary to use for sending mails. -#sendmail_path = /usr/sbin/sendmail - -# If non-empty, send mails via this SMTP host[:port] instead of sendmail. -#submission_host = - -# Subject: header to use for rejection mails. You can use the same variables -# as for rejection_reason below. -#rejection_subject = Rejected: %s - -# Human readable error message for rejection mails. You can use variables: -# %n = CRLF, %r = reason, %s = original subject, %t = recipient -#rejection_reason = Your message to <%t> was automatically rejected:%n%r - -# Delimiter character between local-part and detail in email address. -#recipient_delimiter = + - -# Header where the original recipient address (SMTP's RCPT TO: address) is taken -# from if not available elsewhere. With dovecot-lda -a parameter overrides this. -# A commonly used header for this is X-Original-To. -#lda_original_recipient_header = - -# Should saving a mail to a nonexistent mailbox automatically create it? -#lda_mailbox_autocreate = no - -# Should automatically created mailboxes be also automatically subscribed? -#lda_mailbox_autosubscribe = no - -protocol lda { - # Space separated list of plugins to load (default is global mail_plugins). - mail_plugins = $mail_plugins sieve -} diff --git a/roles/ispmail-packages/tasks/main.yml b/roles/ispmail-packages/tasks/main.yml index d217fc3..9597e53 100644 --- a/roles/ispmail-packages/tasks/main.yml +++ b/roles/ispmail-packages/tasks/main.yml @@ -9,6 +9,7 @@ - dovecot-mysql - dovecot-pop3d - dovecot-imapd + - dovecot-lmtpd - dovecot-managesieved - phpmyadmin - spamass-milter diff --git a/roles/ispmail-postfix/tasks/main.yml b/roles/ispmail-postfix/tasks/main.yml index 6901256..5b7c357 100644 --- a/roles/ispmail-postfix/tasks/main.yml +++ b/roles/ispmail-postfix/tasks/main.yml @@ -30,12 +30,8 @@ - virtual-mailbox-maps - virtual-alias-maps -- name: Define dovecot service in master.cf - command: postconf -vM dovecot/unix='dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}' - notify: restart postfix - -- name: Set virtual_transport to dovecot - command: postconf virtual_transport=dovecot +- name: Make Postfix use LMTP to send emails to Dovecot + command: postconf virtual_transport=lmtp:unix:private/dovecot-lmtp - name: Restricting delivery to Dovecot to one email at a time command: postconf dovecot_destination_recipient_limit=1