Re: Matching literal dot in To
"Ruud H.G. van Tol" <[email protected]> Sun, 14 Jun 2015 14:31:41 +0200
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
On 2015-06-14 11:38, Erik Christiansen wrote: > On 13.06.15 18:21, Moby wrote: >> Thanks. >> >> This seems to suffer from the same issue that my simplistic recipe >> suffered from. Using the same email, here is the recipe I used >> together with the log snippet: >> >> To header from email: >> To: "[email protected]" <[email protected]> >> >> Recipe: >> :0w >> * ^TO_.*\<[^.@]+\.[^.@]+@ > > Ah, yes, the unanticipated match is due to allowing a match across ' '. > We need another tweak. This will be a great deal closer: > > * ^TO_.*\<[^.@ ]+\.[^.@ ]+@ > > That will not leap to the end of a mismatched address, but slide off it > in stages, because '\<' is only shorthand for `[^a-zA-Z0-9_]'. But we > needn't fuss over a lost microsecond here or there. It should do the job > now. Indeed, no win possible anymore. If you also want to log which address matched, try this: * ^TO_.*\<\/[^.@ ]+\.[^.@ ]+@[^, ]+ BTW, I see more and more UTF-8 encoded email addresses. https://en.wikipedia.org/wiki/International_email -- Ruud