1

Sieve isn't running on my system, and it looks like the reason why is that postfix is doing local maildir delivery instead of going through dovecot.

Details: System: 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

When I had tried either of the above commented options instead of virtual_transport, mails started becoming undeliverable.

/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 (excerpt):

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

/etc/postfix/virtual:

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

example.com         xxxxx
user1@example.com   user1
alias1@example.com  user1
alias2@example.com  user1
user2@example.com   user2
GeneC
  • 11
  • 3
  • If you share the configuration, issues can be properly pinpointed and explained in the answers. Check the descriptions of the tags, feel free to [edit] your question to add missing information. – anx Jan 14 '21 at 02:47

1 Answers1

0

You told postfix how to deliver mail for virtual destinations to dovecot.

What you probably did not tell postfix: Which destinations are to be handled via local and which are to be passed to virtual.

For example, this is how defining destination for local transport might look like:

mydestination = example.com, localhost
virtual_alias_maps =

Defining a destination for virtual transport might look like:

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

I suspect you want to remove the domain that shall go via lmtp to dovecot&sieve from mydestination. It is perfectly valid to have an empty mydestination, e.g. if all received mail is passed to dovecot.

anx
  • 8,963
  • 5
  • 24
  • 48
  • Thanks. Unfortunately, that didn't work. Dovecot replied with a `Debug: auth-master: userdb lookup(user1@mail.example.com): Userdb lookup failed` when I switched to `virtual_mailbox_domains`. I don't even know if virtual mailboxes is what I want to be using -- it's just that this setup had been working for me from years until I migrated to a new server. `user1` is a real system user. I just want to be able to alias a few non-system users such as `postmaster` and `admin` to user1. I've updated my original post with the full contents of `/etc/postfix/main.cf`. – GeneC Jan 14 '21 at 18:10
  • `virtual_alias_maps` looks good, what is confusing though is that the same domain `exampl.ecom` you use for virtual aliases and appear to wish to use with *sieve* also appear in `mydestination`. If that is a domain that is to be pushed to dovecot and sieve via lmtp, it should not also appear in the *local* destinations. – anx Jan 19 '21 at 11:00
  • `example.com`, in this example, is the local domain (hostname = mail.example.com). I suspect I am doing this incorrectly. I did find my old settings which do work, and that's by using this in postfix/main.cf: `mailbox_command = /usr/lib/dovecot/deliver -m "${EXTENSION}"`. Again, I don't know if that is the preferred way of doing local delivery. – GeneC Jan 22 '21 at 01:00
  • @GeneC I believe while the simpler `deliver` way should still work, the `LMTP` way is preferred nowadays, because that way postfix can verify and cached existing recipients and generally produce nicer status messages. Just got to be consistent in what you tell postfix to do. – anx Jan 22 '21 at 17:49