Using procmail or forward with mdbox

 Due to the way email is delivered in the school, if you choose to use mdbox or maildir, you will need to take special care with .forward or .procmailrc configurations.  The advanced mailbox formats require that dovecot (the imap server) be responsible for final delivery.  This means that your configurations must be aware of dovecot.


For .forward that means using an #Exim filer command at the beginning of your .forward.

#Exim filter

unseen deliver
This will cause the message to be delivered to and also retain a copy locally.


To ensure that your mail is delivered via dovecot, you need to make the final destination a pipe to the deliver program.  The example below filters messages from priya into the Priya folder and delivers the remainder to the Inbox.

* ^From priya@*
| $DELIVER -d $LOGNAME -m Priya

:0 w
If you do not use the deliver command and allow procmail to deliver the message, it will deliver it to a file in your home directory which you cannot access from the IMAP server.  If this does happen, you can use imap_upload to transfer the message into your IMAP message store.