15 messages in net.sourceforge.lists.courier-maildropRE: [maildropl] Re: Marking messages ...
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:RE: [maildropl] Re: Marking messages as read automaticallyActions...
From:Robin Bowes (robi@robinbowes.com)
Date:Oct 2, 2003 1:30:43 am
List:net.sourceforge.lists.courier-maildrop

Sam Varshavchik wrote:

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}/."

Hmmm. I don't see this behaviour. Where does the mbox file get created?

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.

OK, I think that makes things clearer.

I need something like:

if ( is a mailing list ) { flock lockfile { exception { to mailing_list_maildir } exception { create new mailing_list_maildir to mailing_list_maildir } } }

Actually, I think a better solution would be:

if ( is a mailing list ) { flock lockfile { if mailing_list_maildir doesn't exist { create new mailing_list_maildir } } exception { to mailing_list_maildir } to defaultdelivery }

Would you agree? If so, how can I check for the existence of the maildir before
attempting delivery?

Thanks,

R>