procmail
[Top] [All Lists]

Re: Doing 2 things in one recipe

2001-05-31 11:25:50
* On [010531 19:59] Stephen Patterson <s(_dot_)patterson(_at_)freeuk(_dot_)com> 
wrote:
# stuff I don't even want to hear about. Bounce
:0c:
* ^Subject:.*fe*project.* | \
  ^To:(_dot_)*spam(_at_)s\(_dot_)patterson\(_dot_)freeuk\(_dot_)com | \
  ^Subject:.*VMware Newsletter.* | \
 | (formail -brt ; \
      echo "Returned mail: User unknown."; \
      echo "Your message was sent to someone who does not have an " ; \
      echo "acount at this server." ;\
    ) | $SENDMAIL -oi -t
/dev/null

I'd like to have the original message dropped into /dev/null without
having to duplicate all the spam matching regexes, the code above
works except for filtering messahes away to /dev/null.

Anyone know what I'm missing?
What I think you want is the "A" flag:
,------------------------------------------------------------
|PROCMAILRC(5)                                  PROCMAILRC(5)
|  A    This recipe will not be executed  unless  the  condi­
|       tions  on  the  last preceding recipe (on the current
|       block-nesting level) without  the  `A'  or  `a'  flag
|       matched  as  well.   This allows you to chain actions
|       that depend on a common condition.
|
|  a    Has the same meaning as the `A' flag, with the  addi­
|       tional   condition  that  the  immediately  preceding
|       recipe must have been successfully  completed  before
|       this recipe is executed.
`------------------------------------------------------------
So you'd have your above recipe followed by:

:0a
/dev/null
should work, though I didn't try! ;-)

Lawrence

-- 
Lawrence Mitchell | http://members.tripod.co.uk/EVSvienna/
wence(_at_)gmx(_dot_)li      | Thunder rolled. ... It rolled a six.
        -- (Terry Pratchett, Guards! Guards!)
_______________________________________________
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>