procmail
[Top] [All Lists]

Re: problems with MATCH

2000-06-21 16:37:50
At 05:44 PM 6/21/00 +0200, 
Jan(_dot_)Niggemann(_at_)swl(_dot_)fh-heilbronn(_dot_)de wrote:

I have this:

:0 c :
* !^FROM_DAEMON
* !^From:(_dot_)*(_at_)special_domain
* ^TO_all_my_old_accounts
| (formail -tr -i"Subject: adress will soon expire" ; cat 
$HOME/.procmail/autoreply_texte/reply) | $SENDMAIL -oi -t

I'd like to make the Subject: line more specific, i.e. I want to have:
Subject: The Adress $ADR is going to expire

Now
* ^To[  ]*:[    ]*\/[a-zA-z0-9]+(_at_)[a-zA-Z0-9]+\(_dot_)(_dot_)*
{  ADR = "$MATCH" }
| (formail -tr -i"Subject: The Adress $ADR is going to expire" ; ...
does not work. But I can't figure out why.

First, "does not work" is not very helpful; you should say what DOES
happen, preferably also setting logging to VERBOSE.  That probably
would have answered your question.

The problem here is that there is exactly one action per recipe, and the
   {  ADR = "$MATCH" }
is it.  The line starting with | is thus extraneous text.

You could do it several ways; one is:
    :0
    * ^To...\/...
    {
        ADR = "$MATCH"
        :0
        | (formail...
    }

If you don't need $ADR for anything else and your procmail is recent
enough, you should be able to use MATCH directly:
    :0
    * ^To...\/...
    | (formail...$MATCH...

Hope that helps,
Stan

_______________________________________________
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>