procmail
[Top] [All Lists]

Re: regular expression language in procmail

1997-03-10 09:46:34
On Thu, 6 Mar 1997, mark david mcCreary wrote:

...
* ^TO \/[a-zA-Z]+-on(_at_)(_dot_)*
...
However, when I sent a message to 
domain-name-on(_at_)dispatch(_dot_)mail-list(_dot_)com, no
match !!
...

Well, yes, that is true.  Look at your regular expression -- you only
want addresses with alphabetical letters, THAT'S IT!  If you want a dash,
add it to your subset.  Dashes have to be the first thing since anywhere
else they define a range.  Also your subset does not include numbers.
You might just be better off with [^ ,]+ which will get everything, no
matter what it is...




Good point, and I had tried that variation.  I had put the dash as the last
character in the set, and here is what I get.  I also tried it with the
dash in the beginning, and it works the same.


:0
* ^TO \/[a-zA-Z-]+on(_at_)(_dot_)*
* ^TO \/[a-zA-Z-]+
{
baselist=$MATCH
}



procmail: Matched "chistes-on(_at_)dispatch(_dot_)mail-list(_dot_)com"
procmail: Match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[
^a-zA-Z])?) \/[a-zA-Z-]+on(_at_)(_dot_)*"
procmail: Matched "chistes-on"
procmail: Match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[
^a-zA-Z])?) \/[a-zA-Z-]+"
procmail: Assigning "baselist=chistes-on"



procmail: Matched "domain-name-on(_at_)dispatch(_dot_)mail-list(_dot_)com"
procmail: Match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[
^a-zA-Z])?) \/[a-zA-Z-]+on(_at_)(_dot_)*"
procmail: Matched "domain-name-on"
procmail: Match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[
^a-zA-Z])?) \/[a-zA-Z-]+"
procmail: Assigning "baselist=domain-name-on"





So far so good.  However, I am still stumped on how truncate the -on
portion of the address.  I cannot find any substring or truncation commands
in procmail.  Or do I have access to shell commands ?  Does the $ command
to evaluate conditions according to sh give me some leverage ?

I am assuming that I need to use conditions and regular expressions to get
a value into a variable ?  If so, I don't know how to force a match on this
type of condition, as there is no unique delmiting character.

I have tried several variations including a $ at the end of the line.

Any insights would be appreciated.

mark




You might just be better off with [^ ,]+ which will get everything, no
matter what it is...


Yes, that is a most interesting regular expression, thanks !!  I don't have
any mailing lists with numbers or asteriks in my names now, but I will :-)



mark david mcCreary
Internet Tools, Inc.            4615 Post Oak Place, Suite 140
mdm(_at_)internet-tools(_dot_)com          Houston, Texas 77027
http://www.internet-tools.com   713.627.9600


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