DEV Community

Santiago Zarate
Santiago Zarate

Posted on • Originally published at foursixnine.io on

Setting up postfix, dovecot and sieve

The horror

While trying to set up my mail system, I ran into multiple tutorials to figure out what was the best way to avoid multiple error messages, mainly because you, like me (you silly human!), simply copy and pasted random stuff from stack overflow, and tutorials in howtoforge and places like that…

The mistakes

You tried something like this

spamassassin unix - n n - - pipe flags=DROhu user=vmail argv=/usr/bin/spamc -e /usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
Enter fullscreen mode Exit fullscreen mode

or this:

mailbox_transport = lmtp:unix:private/lmtp
virtual_transport = lmtp:unix:private/lmtp
Enter fullscreen mode Exit fullscreen mode

The pain

so you ended up with something that looks similar to this:

Oct 24 01:13:24 nergal postfix/pipe[10207]: fatal: get_service_attr: unknown username: vmail
Oct 24 01:13:25 nergal postfix/master[10104]: warning: process /usr/lib/postfix/bin//pipe pid 10207 exit status 1
Oct 24 01:13:25 nergal postfix/qmgr[10106]: warning: private/spamassassin socket: malformed response
Oct 24 01:13:25 nergal postfix/master[10104]: warning: /usr/lib/postfix/bin//pipe: bad command startup -- throttling
Oct 24 01:13:25 nergal postfix/qmgr[10106]: warning: transport spamassassin failure -- see a previous warning/fatal/panic logfile record for the problem description
Enter fullscreen mode Exit fullscreen mode

Resignation

So what worked for me was to leave the service in the master.cf as I had it working…

and simply add to master.cf

spamassassin unix - n n - - pipe flags=R user=app argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
Enter fullscreen mode Exit fullscreen mode

and in the main.cf

mailbox_command = /usr/lib/dovecot/deliver
Enter fullscreen mode Exit fullscreen mode

The light

Sieve filtering started to work after these changes :)

Top comments (0)