LuKreme writes:

On 6-Dec-2009, at 13:53, Sam Varshavchik wrote:

LuKreme writes:

I am occasionally seeing duplicated files in my courier-IMAP folders.  Here's 
an example:
$ ls -nls 1260094560.39840_0*
6 -rw-------  2 1004  1005  4780 Dec  6 03:16 
1260094560.39840_0.mail.covisp.net:2,
6 -rw-------  2 1004  1005  4780 Dec  6 03:16 
1260094560.39840_0.mail.covisp.net:2,S
$ diff 1260094560.39840_0.mail.covisp.net\:2\, 
1260094560.39840_0.mail.covisp.net\:2\,S  $
looking at the content of the file it is the exact same email, but looking at 
my MUA the message only exists once.
Any ideas why this happens? Can I prevent it?
(the reason I want to prevent it is that I am scanning the maildir for
messages that are not marked as 'seen' with a terminal 'S'. I'm not
doing anything that would 'hold those messages, just doing a ls −1dA
$HOME/Maildir/.*/{cur,new}/*{net,','} 2>/dev/null | awk -F/ '{print $5}'
to count any unread messages)

What other scripts or software, instead of Courier-IMAP, do you use with your 
mailbox?

Nothing that moves the messages other than my MUA. I use procmail, but it 
writes the messages to .mailinglist-2009-12/ and does not access new or cur 
folders.

For procmail, or anyone else, it is impossible to actually accomplish the task of delivering a message to a maildir unless the tmp and new subdirectories are actually touched. Scribbling something into their parent directory will have no effect.

Last time I checked, procmail really doesn't support maildirs. What its documentation claims to be maildir support merely involves writing each message to a unique file. This is insufficient, there's more to it than that. There is a well defined process by which new messages get delivered to a maildir.

The filenames you've shown do not look like filenames that would be created by Courier or maildrop when delivering messages. Courier-IMAP itself does not deliver mail. An IMAP server provides access to existing mail in a mailbox, it does not deliver any mail.

the mailserver is running postfix.

The issue does not come up very often, so I haven't been able to track it to 
any particular event, and it's invisible from the MUA side since the duplicate 
files only show once in client.

The filenames you've shown appear to be formed by using the current timestamp and the delivering process's PID. Quite a while ago, it became apparent that modern servers that support modern of levels of mail traffic are quite capable of recycling the same process id during the same chronological second, as a result of rapid spawning of short-lived processes that typically occur when delivering mail. As such, the same filename may end up being generated for two discrete messages. The end results are unpredictable, message corruption is likely.

Whatever you're actually using to deliver mail, you should update it to something more current, that uses additional factors in composing the individual message filenames, removing the chance of potential filename collision.

Another possibility is filesystem corruption, of course. Take this partition offline and fsck, as a safety measure.

Attachment: pgpK1CLLAkO5w.pgp
Description: PGP signature

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to