On 10.12.2017 17:03, Hadmut Danisch wrote:

> I'm getting tons of spam with mail senders or helo names from TLDs like
> .date, e.g.

> where the domain names (here: koan-shf.date) rapidly change and are
> obviously randomly generated. IP addresses also change daily.

> I'd therefore like to block TLDs like .date or .loan, which currently
> does not work with postfix. Following it's manpage 5 access, the block
> lists for mails and sender machines need at least  .domain.tld, i.e. two
> domain components.

The following works for me (with 2.11.x and 3.1.x):

/etc/postfix.main.cf:
    smtpd_recipient_restrictions =
        [...]
        check_sender_access pcre:/etc/postfix/sender_access.pcre
        [...]

/etc/postfix/sender_access.pcre:
    /\.bid$/                554 Mail from .bid is currently not accepted
    /\.click$/              554 Mail from .click is currently not accepted
    /\.link$/               554 Mail from .link is currently not accepted


Cheers,
  Juri

Reply via email to