On 13.06.15 12:58, Ruud H.G. van Tol wrote:
On 12.06.15 21:14, Moby wrote:
Chuck, the goal is to put the message in a particular folder if ~any~
of the addresses in the To field is of the form abc.def@some.domain.
Why call external processes like formail and egrep?
To process the "To:" header line _without_ anchoring the regex, so that
the stated goal can be met. (But mostly because the first workable
solution that comes to mind is sufficient if it does the job. :-)
Try this:
:0
* ^To:.*\<[^.@]+@
particular_folder
or use a macro:
:0
* ^TO_.*\<[^.@]+@
particular_folder
Err, how does that find xxx.yyy@zzz in any of many addresses on the
line?
But following your lead back into procmail regexes, so long as the .*
matches up until _all_ of the rest matches, then this may do the trick:
:0
* ^TO_.*\<[^.@]+\.[^.@]+@
particular_folder
That'll find a match in an nth address so long as the regex engine backs
into .* all partial matches until a full match is found. Should do.
Erik
--
Never worry about theory as long as the machinery does what it's
supposed to do.
- Robert A. Heinlein
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail