[Remops] Regualr Expressions for whitelisting

Steve Crook steve at mixmin.net
Tue Jan 26 19:14:28 GMT 2016


On Tue, Jan 26, 2016 at 05:34:40PM +0100, Stefan Claas wrote:
> Hi all,
> 
> i'm not familar with RegEx when it comes to whitelisting
> certain domains, which i may like to do in the future.
> 
> So my questions is how do i edit my config file to add
> additional domains. Examples would be like:
> 
> users at domain.de or users at samedomain.com
> and users at host1.domain.com or users at host2.domain.com
> 
> Regards
> Stefan

Hi Stefan,

Regexs are very powerful filtering tools, to explain them in detail here
would be difficult.  Here's a very short summary of the format used in
Mixmaster for white/blacklisting.

To match bob at domain.de:
/bob\@domain\.de/
The regex needs to be enclosed in /.../
Special characters (@ and . in this case) need to be escaped with a
preceeding backslash.

To match any user at domain.de:
/domain\.de/
The regex doesn't need to match from the beginning of a line so this
will match bob at domain.de and also alice at foo.domain.de.

To match only sub-domains of domain.de:
/\.domain\.de/
This matches bob at sub.domain.de but not bob at domain.de.

In all the above instances, domain.de.com would also match because we
didn't specify the regex must end with anything specific.  To match
domain.de but not domain.de.com:
/domain\.de$/
The dollar symbol means match to end of a line.

To match people called bob at any domain:
/^bob\@/
The ^ symbol means match from the beginning.  In this instance, it
prevents matching (for example) jimbob at domain.de.

There are virtually infinite possibilities with Regexs but this probably
covers the bulk of options you're likely to want in a white/blacklist.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.mixmin.net/pipermail/remops/attachments/20160126/94f105fc/attachment.sig>


More information about the Remops mailing list