3 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] cc "| perl_script.pl"...
FromSent OnAttachments
Alexey KuzmenkoMar 14, 2006 10:43 am 
Sam VarshavchikMar 14, 2006 3:02 pm 
Alexey KuzmenkoMar 14, 2006 11:16 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:Re: [maildropl] cc "| perl_script.pl" message size limitActions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Mar 14, 2006 3:02:40 pm
List:net.sourceforge.lists.courier-maildrop

Alexey Kuzmenko writes:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Dear All,

I am experiencing strange misbehavior with maildrop. There is following rule in maildroprc:

exception { `test -f $YAA_FLAGS/$LOGNAME.yaa` if ( $RETURNCODE == 0 ) { log "size - $SIZE" cc "| /some/perl/script.pl" } }

When IF expression is true maildrop should pass a copy of the message to the perl script and it does... But when the message size is bigger than approximately 66000 bytes I have a lot of following errors (note the size, it is about 66000 but it is wrong, the real size is bigger):

size - 138194 Date: Tue Mar 14 20:05:18 2006 From: Bla <bl@example.com> Subj: big test !Err: | /usr/local/yaa/bin/yaa.pl (66703)

size - 138194 Date: Tue Mar 14 20:16:58 2006 From: Bla <bl@example.com> Subj: test !Err: | /usr/local/yaa/bin/yaa.pl (66639)

Due to EXCEPTION the message is actually delivered by maildrop because I have final TO "$DEFAULT" line and the perl script works exactly as it is expected... But due to the error (error code 255) senders receive and bounce notification with "command died with status 255 /usr/local/bin/ maildrop. Command output: maildrop: error writing to mailbox."

Thank you in advance for your help and advice.

Your Perl script fails to read the entire message it is supposed to deliver somewhere. maildrop detects that, and correctly assumes that your Perl script has crashed and failed to deliver the message.

Because of the way pipes work, maildrop may not be able to detect this error condition with very small messages.

You must make sure that your Perl script reads everything on standard input, and does not terminate prematurely.