Archive dans avril 2019

Postfix : reject specific source domains

Edit the postfix configuration file to add a rejection on sender source :

smtpd_sender_restrictions = pcre:/etc/postfix/rejected_domains

Create the rejected_domains file, enter proper filtering like :

/$/ PERMIT specific sender from
/\.info$/   REJECT All info other info domains are rejected

Compile the file into a database with postmap command :

postmap rejected_domains

This will update/create the postmap rejected_domains.db

Reload the postfix configuration

service postfix reload