1 message in net.sourceforge.lists.courier-maildrop[maildropl] Advice and patch about 'c...
FromSent OnAttachments
Alain NAKACHEJul 9, 2003 9:05 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] Advice and patch about 'cc' followed by 'to' in .mailfilerActions...
From:Alain NAKACHE (ala@cal.fr)
Date:Jul 9, 2003 9:05:04 am
List:net.sourceforge.lists.courier-maildrop

Greetings All,

In maildropex man page I can read the following example : if (/^From: *boss@domain\.com/ \ && /^Subject:.*[:wbreak:]project status[:wbreak:]/) { cc "!john" to Mail/project } But in case of the 'to' temporary failure (Over quota for example) john will receive several times the same message until the message is successfully delivered or canceled which can be a problem.

I tried to simulate a better behaviour using an 'exception' command similar to this : if (/^From: *@domain\.com/) { OK=0 exception { cc "$DEFAULT/.domain" OK=1 } } echo 'EXITCODE=$EXITCODE' if ($OK == 1) { to "!john" } else { exit } But in case of failure, the result is : maildrop: maildir over quota. EXITCODE= and maildrop exits whith a null status. If I suppress the 'else' in the above mailfilter script, the message is delivered in the $DEFAULT maildir too (as expected ?).

By applying the following patch :

-- 8< -- --- maildrop-1.5.3.orig/maildrop/deliver.C Mon Apr 8 17:11:02 2002 +++ maildrop-1.5.3/maildrop/deliver.C Wed Jul 9 17:53:17 2003 @@ -152,7 +152,14 @@

if ( deliver_maildir.MaildirOpen(mailbox, deliver_file, maildrop.msgptr->MessageSize()) < 0) - throw 77; + { + Buffer name, val; + + name="EXITCODE"; + val.append((unsigned long)77) ; + SetVar(name, val) ; + throw 77; + }

format_mbox.Init(0); if (format_mbox.DeliverTo(deliver_file)) -- 8< --

I manage to obtain a good behaviour (which is valid only in the case of maildir deliver)

Did I miss something ?

Regards. Alain