Greetings All,

In maildropex man page I can read the following example :
if (/^From: [EMAIL PROTECTED]/ \
    && /^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: [EMAIL PROTECTED]/)
{
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

Reply via email to