Author |
Topic  |
|

BaftaBaby 
"Always entranced by cinema."
|
Posted - 10/29/2010 : 12:17:13
|
Hi
I'm updating my mail server spam filter to BoxTrapper, which seems much more user-friendly than Spam Assassin.
It asks for white/black lists to be in standard Perl formula and gives this example: quote: The list should contain one entry per line. Entries should be in the format of a perl regular expression. For example: [email protected] would be john\@domain\.com and all addresses at domain.com would be .+\@domain\.com
My question is, suppose either the eMail preface (before the @ sign), and/or the domain id (.com, .net, etc) ALSO contain a dot. Would I then preface all the dots with a backslash?
So, if the example they give above were changed to [email protected] would my listing be formatted as john\.doe\@domain\.co\.uk
Your words of wisdom are worth more than Perls to me  Bigtime TIA!
|
|

benj clews  "...."
|
Posted - 10/29/2010 : 12:29:32
|
Not to be picky but this isn't the programming language Perl. It's regular expression notation- a commonly-used pattern matching technique used in most programming languages, text editors, operating systems and so on 
I have to admit I'm not sure of the differences between Perl's interpretation of regular expressions and standard regular expressions but from this example the two look identical.
The \ is called an escape character and as such says "whatever character follows me should be treated as what it literally is", rather than any special reserved function it may have in a regular expression. For example . by itself would effectively be saying "this can be any letter, number or symbol" (so 'b.n' would match 'ben' or 'bin') but by putting the \ in front of it you are looking to match the . character only (so 'b\.n' would match 'b.n' and nothing else)
In short, yes- you need to put the \ in front of the . (or indeed any full-stops anywhere in the email address) so your spam filter knows to treat it as only a full-stop. |
 |
|

BaftaBaby  "Always entranced by cinema."
|
Posted - 10/29/2010 : 12:45:14
|
quote: Originally posted by benj clews
Not to be picky but this isn't the programming language Perl. It's regular expression notation- a commonly-used pattern matching technique used in most programming languages, text editors, operating systems and so on 
I have to admit I'm not sure of the differences between Perl's interpretation of regular expressions and standard regular expressions but from this example the two look identical.
The \ is called an escape character and as such says "whatever character follows me should be treated as what it literally is", rather than any special reserved function it may have in a regular expression. For example . by itself would effectively be saying "this can be any letter, number or symbol" (so 'b.n' would match 'ben' or 'bin') but by putting the \ in front of it you are looking to match the . character only (so 'b\.n' would match 'b.n' and nothing else)
In short, yes- you need to put the \ in front of the . (or indeed any full-stops anywhere in the email address) so your spam filter knows to treat it as only a full-stop.
You see -- THIS is why you are benj, the genius -- to give you your full title! 
Thanks so much, benj, and here's to my spam-free world 
|
 |
|
|
Topic  |
|
|
|