procmail
[Top] [All Lists]

Re: improvements on recipe solicted

1998-06-07 00:40:36
On 6 June 1998, mark david mcCreary <mdm(_at_)internet-tools(_dot_)com> wrote:
I would like to improve the following recipe


:0 hw
* ^Subject:.*unsubscribe \/.*
{
   LOCAL=$MATCH
   :0
   * LOCAL ?? (_dot_)*(_at_)\/.*
   {
      SENDER=$LOCAL
   }
}


This checks to see if the Subject line is attempting to unsubscribe
some email address, presumably a different email address than in the
from line.  It puts the email address in the variable SENDER, where it
is then used in SENDMAIL -f $SENDER.

Assuming the input is

      Subject: unsubscribe joe(_at_)aol(_dot_)com

this works just fine.

If they get fancy, and try to put in two email addresses, the whole
string after unsubscribe gets put in SENDER.

      Subject: unsubscribe joe(_at_)aol(_dot_)com 
sam(_at_)compuserve(_dot_)com

And SENDER = joe(_at_)aol(_dot_)com sam(_at_)compuserve(_dot_)com, which then 
bombs
SENDMAIL.

I would be happy just picking up the first email address, and ignoring
anything else.
[...]

    You might try something like

        :0 h
        * ^Subject:.*unsubscribe[       ]+\/[^  ]+([    ]|$)
        { SENDER=$MATCH }

(the whitespace in the brackets consists of a space and a tab).

    Regards,

    Liviu

-- 
Dr. Liviu Daia                   e-mail:   daia(_at_)stoilow(_dot_)imar(_dot_)ro
Institute of Mathematics         web page: http://www.imar.ro/~daia
of the Romanian Academy          PGP key:  finger 
daia(_at_)stoilow(_dot_)imar(_dot_)ro

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