Next Previous Contents

3.3   Dovecot imap changes

From Bryan Hughes, Fri Nov 2 08:14:00 2007

We are upgrading our IMAP/POP software on mailhost to Dovecot IMAP.

This move will occur in two phases, first is moving to the software while keeping most of our existing setup.

The only change we have to make that the new Dovecot software does not do is handling ~/mbox files as Inboxes. The Inbox in IMAP terms is the mail folder were non-filtered emails are delivered. Most of the Inboxes are stored on /var/spool/mail/username on mailhost. However the old software has an option, if you touch the file ~/mbox whenever you log into IMAP/POP all mails in /var/spool/mail/username are moved to ~/mbox. Dovecot will only read Inbox as /var/spool/mail/username. Some users have been informed over the last several years, that they can use ~/mbox to have their mail backed up, as it is no longer in the spool directory.

So to work through this problem there are some options for the user.

  1. If they want to keep their inbox as it is, but lose backups on it. They will need their ~/mbox merged with their /var/spool/mail/username mailbox. This requires a TCC admin with root access to mailhost, so please file a ticket for this operation if the user chooses it.

    What we are doing here is using /var/spool/mail/<username> as the inbox. The merge process moves their mail from ~/mbox to /var/spool/mail/<username>, and removes the mbox file.

  2. If they want to archive their current mbox keep it backed up, but let only new mails go to the /var/spool/mail/username mailbox, they will need to archive their mail. This can be preformed on a linux login as the user. (archivefile can be any file name that is not already used)
    mv ~/mbox ~/archivefile
    

    then edit ~/.mailboxlist to add archivefile to the end of the list.

    The user will see in their folder list when they log into an IMAP session, archivefile as a new mail folder. It will have all the old mails that were in ~/mbox. All new mails will go to (what they see as Inbox which is now /var/spool/mail/username, which will not be backed up).

  3. User wants to keep all mail backed up. You will have to help them write a procmail recipe to deliver to their mbox file something like
           -----------------------------
           :0:
           * ^X-Spam-Status: Yes
           /var/spam/$LOGNAME
           
           :0:
           $HOME/mbox
           -------------------------------
           
    

    at then end of their ~/.procmailrc (less the dashes). And then subscribe ~/mbox by editing ~/.mailboxlist and adding mbox to the last line.

    Their inbox will work normally (same content also in mbox folder) until we switch software. Then INBOX will be empty, and all mail (new and old) will be in the mbox folder.

    NOTE:
    The example I gave is the mostly likely possibility, that the user doesn't have a custom .procmailrc only the symlink.   In that case you delete the symlink and write the posted section as that file.

    In other cases the user will probably have the first recipe (spam filtering) already in their .procmailrc and the last 2 line section is what does the actual delivery.   That needs to be the last line of the .procmailrc.

-- 
Bryan Hughes
NMTCC Systems Programmer

More info may be added here as this progresses: https://fedora.nmt.edu/tccwiki/MaildirConversion section 4.3


Next Previous Contents