Sendmail: problems replacing procmail with dovecot-lda

Issue

This Content is from ServerFault. Question asked by QF0

I’m migrating an old server which used Sendmail, with procmail as the LDA, and dovecot as the imap server. The old setup was straightforward, but all the docs now suggest replacing procmail with dovecot-lda. Which turns out to be very difficult, even after many hours searching.

The server is responsible for several domains, with only virtual users. There is no delivery to system users.

With the old procmail setup, I created a (Linux) user for each virtual mail user. So, to support mail for ‘jo@domain1.com’ I created ‘account1’, and had a /home/account1 directory, with a Maildir. procmailrc contained DEFAULT=$HOME/Maildir/. virtusertable then had a line like

jo@domain1.com  account1

So sendmail knows that Jo’s emails had to go to /home/account1/Maildir, and Dovecot also knew this, so Jo could then log into the imap server as ‘account1’ and get his/her mail.

I have two problems with the new setup:

1 – I have set up dovecot so that

mail_home = /home/vmail/%d/%n
mail_location = maildir:~/Maildir

But how do I tell sendmail that incoming mails have to go in mail_home? In other words, how do I replace procmailrc? At the moment, sendmail is just dumping everything in /var/spool/mqueue. Note that I don’t want to create lots of system users and home directories if possible – everything should be under /home/vmail/.

2 – Sendmail is only accepting mail for system users, so there’s no ‘virtual’ mail at all. Unless Jo has a Linux A/C he won’t get any mail. I’ve added a virtusertable, with FEATURE('virtusertable') in sendmail.mc, with the line @domain1.com account1, but it makes no difference.

The Dovecot/Sendmail integration doc is here, but it doesn’t say anything about this. I have the MDovecot config in /usr/share/sendmail/cf/mailer/dovecot.m4, not sendmail.mc.

Any ideas? I’m thinking that I should just go back to procmail…



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from serverfault, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?