procmail
[Top] [All Lists]

Re: regexp - question 1

2000-09-27 14:48:04
tomcat(_at_)visi(_dot_)com wrote:
...
I think + here instead of * before \/ because
if there is no line starting out "From:" the
email will fail anyway (for my purposes)
In that case, should I check for "Reply-To" ??

Good questions.  How about this?

REALSENDER=`formail -rtzxto:`

meaning... create a reply (-r), trusting sender to have used valid
return address (-t), then zap blanks (-z) and extract (-x) the "to:"
field of the reply (see
http://www.procmail.org/jari/pm-tips-body.html#always_use_formails_rt_switch 
)

...
=================================================

say the subject line in the header is
"Subject: Re: MailWeb: Test A xxxxxxxxxxxxxxxxxx 99bozo(_at_)bozo(_dot_)com"

* ^Subject:.[99]*\/.*
 { ORIGINATOR = $MATCH }

would this match
"Subject: Re: MailWeb: Test A xxxxxxxxxxxxxxxxxx 99"
and put "bozo(_at_)bozo(_dot_)com" in ORIGINATOR ??

I don't think so.  I'd rather see you use the method I mentioned in
the earlier posting (the plus-addressing one).  If you do things this
way, though, please be aware that the syntax [ab] means "a character,
either a or b" and thus [99] means "either 9 or 9" which I don't think 
is what you wanted.

So if you have
   Subject: Re: MailWeb: Test A xxxxxxxxxxxxxxxxxx 99bozo(_at_)bozo(_dot_)com

then to get match to be bozo(_at_)bozo(_dot_)com you should do something like:

  * ^Subject:.*99\/[^9].*$
  { ORIGINATOR=$MATCH }


Should I have "99 " so I put " bozo(_at_)bozo(_dot_)com" in for -I ?

would 

* ^Subject:.[/*/-]*\/.*
 { ORIGINATOR = $MATCH }

work for 

"Subject: Re: MailWeb: Test A xxxxxxxxxxxxxxxxxx *-bozo(_at_)bozo(_dot_)com"

Nope -- you need 

  * ^subject:.*\*\-\/[^-*].*

then $MATCH ought to contain the bozo stuff.

!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 Is there a limit to how long the subject line can be and
 not be chopped off??

Yes.

man procmailrc  -- then search for LINEBUF

-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.

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