Re: Matching literal dot in To
"Ruud H.G. van Tol" <[email protected]> Sat, 13 Jun 2015 16:16:36 +0200
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
On 2015-06-13 15:56, Erik Christiansen wrote: > 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 [email protected]. >> >> 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? Ah, I misread the problem; I assumed that any address *without* a dot in the local part should lead to delivery. > 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. Yes. (Unless encodings or newlines are involved.) -- Greetings, Ruud