procmail
[Top] [All Lists]

Re: Problem with ^TO_

2004-04-22 13:11:51
Toen wij LuKreme kietelden, kwam er dit uit:

* ^TO_(.*<)?<?\/(_dot_)*(_at_)subdomain\(_dot_)domain\(_dot_)com


There is another problem here:
- \/ is greedy to the left
- in front of the \/ you have 2 optional parts
- directly after the \/ is a .* that matches anything 
- so the optional parts in front of the '\/' will be 
  ignored, which leads to 
  * ^TO_\/(_dot_)*(_at_)subdomain\(_dot_)domain\(_dot_)com
- the ^TO_ macro is for 'specific addresses', so not for .*@ 
  cases (the ones that ^TO@ is good for) 
- the greediness of the \/ bends that last rule a little

The expansion of the ^TO_ (simplified, see man procmailrc) is:
(^To:(.*[^-a-zA-Z0-9_.])?), which also ends in optionals, 
which reduces it to ^To: when '\/.*' follows it.

I don't think it is ever 'good' to put a '.*' directly 
after the '\/'. 

It is possible to do it when the part at the left of the '\/' 
does not end in optionals, but even then it is better to put 
a discriminating element directly following the '\/', 
for example the '[^ <]+' that David used.

-- 
Grtz, Ruud

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