[Dovecot] UW-IMAP style mbox snarfing from /var/mail/ to ~/mbox

Bernd Kuhls bernd.kuhls at informatik.uni-oldenburg.de
Fri Jul 6 12:54:41 EEST 2007


Timo Sirainen wrote:
> http://dovecot.org/patches/mbox-snarf-plugin.c

Hi,

small update from an end-user of this plugin:

generally it works like expected, but some problems I mentioned are not 
solved yet. Here are my main config settings:

mail_location = 
mbox:~/.imap_mail:INBOX=/var/mail/%u:INDEX=/var/mail/indexes/%u

mbox_snarf = ~/.imap_mail/inbox

- The index for $HOME/.imap_mail/inbox is created in
   $HOME/.imap_mail/.imap/inbox/, while the indexes for other mbox files
   are created in /var/mail/indexes/%u, like its supposed to be. How to
   disable creating index files in $HOME altogether without using links?

- if /var/mail/$user does not exist, syslog is cluttered with these
   messages for each POP3/IMAP login:

   Jun 10 22:33:33 server dovecot: IMAP(someuser): stat() failed with
   mbox file /var/mail/someuser: No such file or directory

- the biggest problem is the following scenario:
   - /var/mail/$user does not exist
   - Exim can not deliver a mail to $HOME/.imap_mail/ so a second router
     comes into action and delivers the mail to /var/mail/$user
   - /var/mail/$user now only contains the mail, without the IMAP headers
     Dovecot normally writes to a mbox file
   - the user logs into the account and Dovecot tries to snarf the mail
   - if snarfing is sucessful Dovecot must delete the mail from
     /var/mail/$user, but this fails due to the missing IMAP headers
   - when the user logs into the account the next time the mail is
     snarfed again, this can be repeated endlessly
   - the only situation where the snarf plugin works like expected is
     when /var/mail/$user contains the IMAP headers

To circumvent this problem I created a cronjob running once per minute 
which creates /var/mail/$user for $HOME/* with this content:

> From MAILER_DAEMON  Sat Apr 21 19:48:15 2007
> Date: Sat, 21 Apr 2007 19:48:15 +0200
> From: Mail System Internal Data <MAILER-DAEMON at server>
> Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
> Message-ID: <1177177695 at server>
> X-IMAP: 1177169799 0000003411 NonJunk Junk $Forwarded
> 
> Status: RO
> 
> This text is part of the internal format of your mail folder, and is not
> a real message.  It is created automatically by the mail system software.
> If deleted, important folder data will be lost, and it will be re-created
> with the data reset to initial values.

This solution is annoying because it does not really fix the problem.
Can you help me with this problem? I am using Dovecot 1.0.0, might 
updating to 1.0.1 help fixing some of the problems mentioned above?

Greetings, Bernd



More information about the dovecot mailing list