regex to block emails while having word bounce before @ sign.

Gregory Sloop gregs at sloop.net
Fri Mar 11 20:15:39 CET 2016



I think below regex matches everything up to @ sign.

/(bounce.*@)/i

it does NOT check anything after @ sign. This is WHAT I NEED

something like these. 

noreply at bounce.domain.com
noreply at bounce.com


Be exceptionally careful of ".*" [It very, *very* often matches more things than you expected it to.]

I can't think of a specific example of a line that would cause an issue, but your regex, will match something like this too. [Essentially anything with "bounce" with anything in-between, followed by an "@" later in the same line.

blah blah blah jimbo at bounce.com freddy at someotherdomain.com blah blah blah @ blah [In this case, it will match on the second "@", not the first - as an example of how .* works.]

or

blah blah blah jimbo at somedomain.com freddy-bounce at someotherdomain.com blah blah blah

or

blah blah blah jimbo at somedomain.com freddy at someotherdomain.com bounce blah blah blah @ blah

Any new regex, I'd monitor it carefully for some time to be sure it does what you expected it to do, especially if it has a .* in it.

-Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20160311/8fff4390/attachment.html>


More information about the amavis-users mailing list