1

I have a production mailing system in place. The initial setup was done with system users. Each domain has a system user and in the end all mail to the same domain goes to the same account (and later moved to specific folders based on procmail configuration for that system user). Dovecot responsibility is handling imap for Maildirs. Sendmail for SMTP.

The system users have a procmail configuration in their homedir as well as the Maildir itself. So the mail for the system users is in /home/{user}/Maildir. Procmail config is in /home/{user}/.

I'm now looking to switch to virtual users in an effort to make this more and easily scalable.

I've modified the dovecot configuration to use virtual users based on a passwd-file. The passwd-file (both userdb and passdb, together with a separate id for each virtualuser) path is /home/{domain}/passwd (I actually first wanted to have 1 passwd-file for all domains but I didn't got it to work, but perhaps I can revisit this later). The entries in the passwd-file point to /home/{domain}/, for which the {user} part is a symlink to the system user homedir (for example /home/{user} if he has such an entry). It enables me to first migrate the Dovecot part and later the Sendmail/procmail part.

The dovecot setup works fine. Sendmail is still delivering to the /home/{user} location but due to the symlinks Dovecot can reach the Maildirs.

I'm now looking into modifying my sendmail setup to deliver mail to these virtualusers's homedirs through Dovecot's LDA capability however I'm afraid at that point my procmail setup will be broken.

What's the proper way to make Sendmail use Dovecot LDA with still processing procmail config(or perhaps this is still a sendmail setting)? Sendmail now uses virtusertable to deliver email to the specific user account (so user1@example.com domain1user; user2@example.com domain1user, ...). Not sure if this is relevant.

Any other remarks are welcome as well as I'd rather have a full picture and don't break the setup. In a later phase Sendmail might be replaced by postfix but for now it's doing what it should be doing so that's low priority.

tripleee
  • 1,324
  • 3
  • 14
  • 24
  • 1
    You can call `deliver` from Procmail but the general advice seems to be to migrate your Procmail rules to Sieve instead. If you do want to go through Procmail, every Procmail file needs to be updated to call `deliver` instead of writing straight to a destination folder. – tripleee May 05 '17 at 06:15
  • Do I understand correctly that in that case Sendmail delivers to procmail and procmail delivers to dovecot LDA? So no ability of Dovecot itself to invoke procmail? (you're probably referring to a setup like https://wiki.dovecot.org/procmail) – th3penguinwhisperer May 05 '17 at 06:49
  • Not familiar enough with Dovecot to say for sure but quick googling suggests that interpretation. – tripleee May 05 '17 at 06:54
  • @th3penguinwhisperer Dovecot's `deliver` itself have all needed functionality so procmail can be retired completely. Sendmail should invoke dovecot's `deliver` directly. – Kondybas May 05 '17 at 09:16
  • Ok so first see how to migrate those procmail rules then. Thanks – th3penguinwhisperer May 05 '17 at 16:17
  • As it was mentioned that dovecot's deliver has all needed functionality I configured Dovecot with LDA/LMTP and enabled sieve and sievemanage. Now I'm looking how to get sendmail to use dovecot-lda. Note that the current implementation had a catchall (so any user @domain would go to the same user). This currently doesn't seem to work as expected. Do I need to use dovecot-lda or were you refering to something else with the "deliver" ? – th3penguinwhisperer May 13 '17 at 17:05
  • So I just migrated to postfix and made it use dovecot-lda through the master.cf file. Sieve is invoked by dovecot and the rules can be edited through a webinterface. Thanks for the pointers. – th3penguinwhisperer May 14 '17 at 18:17

0 Answers0