Using dovecot pre-authenticated besides another IMAPd

  • Goal: Test Dovecot with Maildir style mailboxes under the same environment and circumstances as the current IMAPd (UW IMAP with MBX style mailboxes), but without modifying the current setup.
  • Method: Use pre-authenticated IMAP and ssh as secure tunnel. MUA supporting this method are e.g. mutt, pine and alpine.

What to change

  • If dmail or tmail are used from inside shell scripts to deliver mail, replace them by Dovecot's MDA (called LDA and residing in /usr/lib/dovecot/deliver in Debian). You need to use the -d option and add the user name since the setuid delivery still has EUID=0. In our case this was necessary in /opt/bin/spamdeliver.sh. (maildrop doesn't work very good here since it needs a filter rules file belonging to the recepient of the mail instead of a simple command line option.)
  • If dmail or tmail are used in the .procmailrc, replace them by the Maildir folder itself. Don't forget the trailing slash to tell procmail that this mailbox is a Maildir style folder.
  • .muttrc: Replace set tunnel=“ssh -q imap.phys.ethz.ch /etc/rimapd” with set tunnel=“ssh -q imap.phys.ethz.ch /usr/sbin/dovecot –exec-mail imap”. Calling /usr/lib/dovecot/imap directly will ignore the dovecot configuration.
  • Set the DEFAULT and MAILDIR variables in .procmailrc to the right Maildir style INBOX and folders directories.

What will be different

  • Dovecot has an mbox_snarf plugin to mimic UW IMAPd's snarfing of incoming mail from /var/mail/$USER to e.g. /var/imap/$USER/INBOX, but this only works if both are in mbox format and not with a Maildir style mailbox as snarf destination. So we deliver directly into the Maildir style INBOX using procmail.
  • The snarfing allowed to easily identify unused mail accounts by setting a per-user quota on /var/mail. With Maildir this can be replaced by checking the size of e.g. /var/imap/$USER/new/ with du.

See also

 
using_dovecot_pre-authenticated_besides_another_imapd.txt · Last modified: 2008/12/19 01:57 by abe
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Debian Driven by DokuWiki