Welcome to the mailbox.org user forum!
 

Filter/Rules with rexep

8746872 shared this question 2 years ago
Need Answer

Hi, I'm trying to create a filter rule to fight with spams. I have enabled catchall for my @mydomain.com and as expected suddently I'm getting a lot spams :)


I need advice or help to create a rule to REJECT any mails if the recipient is not in my list of accepted aliases. eg


alias1

alias2


So I tried regexp (!alias1|!alias2)@mydomain.com but this doesn't work.


Any idea how to make this work?


Thanks!

Comments (3)

photo
1

In case someone is trying to achive this, I was able to do it using Sieve filters (installed the plugin for Thunderbird)


## Flag: |UniqueId:4|Rulename:

if allof ( address :domain :is "To" "yourdomain.com" , not address :localpart :is "To" [ "myname" , "myalias1" , "myalias2" , "info" , "whatever" , "me" ] ) ## valid addresses, otherwise discard it

{

discard ;

stop ;

}

photo
1

the syntax is: [^mail@domain.com]

photo
1

Sorry - was thinking of something else with that last post. This should work:


^((?!alias).)*$

However I tried it and OX throws an error.


The good news however is that there now appears to be a "does not contain" filter rule so you can use that and avoid regex