Spam rule wildcards...

Julian Field mailscanner at ecs.soton.ac.uk
Tue May 13 16:29:27 IST 2003


At 14:12 13/05/2003, you wrote:
>Julian Field wrote:
> > That should do it. However, you could give the explicit regular
> > expression in there if you want to:
> > To:     /^johndoe\+.*\@/        deliver
> > (nothing is needed after the "\@" except for the closing "/"
> > character.
>
>Ok -- sounds good.  I'd like to do both in one line though -- but I'm not
>great with regular expressions yet.  (Maybe the above already does both in one
>line?  Hmmm...  I'm not sure about the "." though -- makes me think it
>wouldn't catch both...)  Can someone give me a one line regexp that will cover
>with and without the "+<stuff>" addition?  So, basically, I want these two
>rules:
>
>To:     johndoe@*       deliver
>To:     johndoe+*@*     deliver
>
>...as one regular expression.  Of course, I don't want just johndoe*@* to
>match, since I might have a user that is named johndoejr at domain.com that I
>wouldn't want to match.  Maybe something like this?
>
>To:     /^johndoe(\+[_a-zA-Z0-9-]+)?\@/ deliver
>
>...but, again, I'm fairly new to regexp, so forgive whatever I have done there
>if it is incorrect.  :-)

Your last suggestion looks fine to me.
--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support



More information about the MailScanner mailing list