I've just configured email on my server. Gentoo, Postfix, Dovecot, Amavisd, ClamAV and Spamassasin

I am using LMTP for delivering virtual mails, works great. I am using standard postfix deliver method (mailbox_transport) for system users.

But since I'm using spamassasin I want to move all emails with Spam header to Junk/ directory. For this I use dovecot-sieve.

But now I have a problem with system accounts. Since they are not delivered with dovecot, sieve is not able to move them.

I tried to pass my local email to dovecot (also with lmtp, but setting mailbox_transport the same as virtual_transport) but next problem occured. I set up two passdbs and two userdbs, first with pam + passwd, second using passwd-file and static.

For local users whole username + domain is used causing PAM to fail in matching local users to itself. If i change variable auth_username_format to %n (which is user only) %d becomes empty and virtual mailboxes stops working.

How can I use lmtp for both system and virtual mailboxes?

This is my part of dovecot responsible for logging in:

passdb {
        driver = passwd-file
        args = username_format=%u /home/vmail/%d/passwd
        skip = authenticated
userdb {
        driver = static
        args = uid=500 gid=500 home=/home/vmail/%d mail=maildir:~/%n
passdb {
        args = imap
        driver = pam
userdb {
        driver = passwd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.