3 messages in net.sourceforge.lists.courier-maildrop[maildropl] Strange mailbox error - S...
FromSent OnAttachments
David J. Weller-FahyOct 11, 2007 1:17 pm 
Devin RubiaOct 11, 2007 1:35 pm 
David J. Weller-FahyOct 11, 2007 2:05 pm 
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] Strange mailbox error - SOLVEDActions...
From:David J. Weller-Fahy (dave@weller-fahy.com)
Date:Oct 11, 2007 1:17:28 pm
List:net.sourceforge.lists.courier-maildrop

I've had a problem with intermittent failure of my greenlisting script, and have finally (I believe) tracked down the problem, and solved it.

I believe the problem involves piping a message to a script as a delivery. If that script makes no use of the pipe, performs its function, then exits (as my greenlister script does) then maildrop never has a chance to finish writing larger messages to the pipe.

Of course, I may be wrong which is why I'm posting here. ;]

The recipe that was failing only on large messages follows. Note that this recipe only fires when a message has certain Delivered-To: headers, so most messages never see this code. #v+ # We don't want multiple messages trying to modify the greenlist at the # same time. dotlock "$HOME/.maildrop/greenlisting$LOCKEXT" {

# Grab all addresses from the appropriate fields. if ($MATCH2 =~ /^sender$/) GL_ADDRESSLIST=`reformail -c -xfrom:` else GL_ADDRESSLIST=`reformail -c -xto: -xcc:`

# Set the operation to perform (add or remove). GL_OP=$MATCH1

# Loop over each address found. foreach (getaddr($GL_ADDRESSLIST)) =~ /.+/ { # Add/remove the address to/from the greenlist. # NOTE - I do not check for the address in the # greenlist when adding, or for its absence when # removing. This keeps the recipe simple. My script # checks for each address, and only adds/removes if the # address doesn't/does exit (respectively). to "|$MAILDROP/greenlist-$GL_OP.sh \"$MATCH\"" } } #v-

The recipe that works correctly no matter the size of the message (because we filter it down to just the relevant addresses) follows. #v+ # We don't want multiple messages trying to modify the greenlist at the # same time. dotlock "$HOME/.maildrop/greenlisting$LOCKEXT" {

# Grab all addresses from the appropriate fields. if ($MATCH2 =~ /^sender$/) xfilter "reformail -c -xfrom:" else xfilter "reformail -c -xto: -xcc:"

GL_ADDRESSLIST=`cat`

# Set the operation to perform (add or remove). GL_OP=$MATCH1

# Loop over each address found. foreach (getaddr($GL_ADDRESSLIST)) =~ /.+/ { # Add/remove the address to/from the greenlist. # NOTE - I do not check for the address in the # greenlist when adding, or for its absence when # removing. This keeps the recipe simple. My script # checks for each address, and only adds/removes if the # address doesn't/does exit (respectively). to "|$MAILDROP/greenlist-$GL_OP.sh \"$MATCH\"" } } #v-

So... I have a few questions: 1) Have I diagnosed the problem correctly? 2) If not, what is the problem? 3) If so, am I over-complicating this? IOW, is there a better (simpler) way to do what I'm trying to do?

Hopefully that all made sense. If not, please don't hesitate to ask questions.

Regards,