Search code examples
emailpostfix-mtablacklist

Postfix Blacklist multiple EMails Reject


is there a possibility to block multiple EMails with* or % like this:

Emails I want to block:

[email protected] REJECT
[email protected] REJECT
[email protected] REJECT
[email protected] REJECT

My idea:

test*@domain.com REJECT

or

test%@domain.com REJECT

Is there a possibility to do this?

Thank you.


Solution

  • Ya that is possible. You can use pcre lookup type to achieve this.

    #/etc/postfix/blacklist.pcre
    /^test.*@domain.com$/   REJECT
    

    You can use this in your main.cf as pcre:/etc/postfix/blacklist.pcre.

    PS: Your postfix server will need to compiled with pcre support. You can confirm the same by typing postconf -m which should give pcre in output. Hope that helps. More info about Postfix lookup tables here