procmail
[Top] [All Lists]

Re: variables

2002-10-10 18:15:32
Philip Guenther wrote:
> Tom Allison <tallison(_at_)tacocat(_dot_)net> writes:
>
>>Is there some way that I can do something that looks like this:
>>
>>| /usr/bin/foo  #This is a filter that returns an exit code
>>EXITCODE=$?
>>
>>And then, based on the exit code, either send the email to the
>>default delivery point or to an alternate (like /dev/null).
>
>
> You're pretty close:
>

I must be challenged....


----------ONE--------------
 From the command line, my application give me:

penguin:/home/tallison# cat /var/mail/tallison | /root/confirm.pl
penguin:/home/tallison# echo $?
75
-----
75 == EX_TEMPFAIL
---------------------------

---------TWO-------------
If I hardcode "EXITCODE = 75" into /etc/procmail I get this
wonderful message about temporarily undeliverable email

------------------------
/etc/procmailrc looks like this:

:0 W
| /root/confirm.pl

var = $?

EXITCODE = $var
--------
I get nothing but wonderful email delivery with no mention of
bounces etc.


I was thinking if I could do something like this:

-----------------------------
:0 W
| /root/confirm.pl

var = $?

:0
* $var !?? 0
/dev/null

EXITCODE = $var
-----------------------------

Which would, hopefully, only delivery email when EXITCODE==0

Unfortunately, some of the statements that I've seen so far in the
suggestions don't exactly appear in the man pages.  Where?  I'm
not even sure if I've got line one correct..  From what I
understand about procmail so far, this should be pretty close to
working.

ugh!?

--
Let sleeping dogs lie.
                -- Charles Dickens


--
That should probably be written:
    no !(_at_)#$%^&*:@!semicolon
             -- Larry Wall in <199710161841(_dot_)LAA13208(_at_)wall(_dot_)org>

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>