15 messages in net.sourceforge.lists.courier-maildrop[maildropl] Re: Marking messages as r...
FromSent OnAttachments
Chris AndersonSep 30, 2003 7:48 pm 
Pedro HernadezSep 30, 2003 10:01 pm 
Martin LohmeierOct 1, 2003 5:32 am 
Robin BowesOct 1, 2003 8:30 am 
Sam VarshavchikOct 1, 2003 2:58 pm 
Robin BowesOct 1, 2003 3:16 pm 
Sam VarshavchikOct 1, 2003 3:30 pm 
Robin BowesOct 1, 2003 3:48 pm 
Sam VarshavchikOct 1, 2003 7:43 pm 
Robin BowesOct 2, 2003 1:30 am 
Sam VarshavchikOct 2, 2003 4:27 am 
Robin BowesOct 2, 2003 4:40 am 
Sam VarshavchikOct 2, 2003 1:29 pm 
Chris AndersonOct 2, 2003 5:04 pm 
Pedro HernadezOct 3, 2003 11:23 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] Re: Marking messages as read automaticallyActions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Oct 1, 2003 7:43:40 pm
List:net.sourceforge.lists.courier-maildrop

Robin Bowes writes:

You need to put the whole thing under an flock, and trap exceptions only from the maildirmake process.

How about something like this:

You're missing the point. Consider two delivery attempts running simultaneously, the mailing list folder does not exist.

if ( this is a mailing list ) { exception { to "${VMAILDIR}/.${LISTS}.${MATCH2}/" }

First of all, as you know, if the file does not exist, maildrop, for legacy reasons, creates an mbox file.

You want, instead: to "${VMAILDIR}/.${LISTS}.${MATCH2}/."

Anyway, with that correction in place, both delivery attempts fail here, and fall through.

exception { flock lockfile_${MATCH2} { `${MAILDIRMAKE} -f ${LISTS}.${MATCH2} ${VMAILDIR}` }

Delivery attempt #1 grabs the lock. Delivery attempt #2 waits for the lock to be released. Delivery attempt #1 creates the folder, releases the lock.

Then, delivery attempt takes the lock that it's been waiting on, and tries to create the folder itself, and fails, and the exception falls through, and the message is not delivered.

When flock cannot take the lock immediately, it waits for the lock to be released. Once the lock is obtained it STILL executed the instructions inside the flock statement. That's what you need to remember.