S
S
Satisfied IT2020-07-08 14:18:12
postfix
Satisfied IT, 2020-07-08 14:18:12

How to disable sending emails to a specific list of addresses in postfix?

We have a postfix mail server and it became necessary to prohibit everyone from sending letters to a certain list of addresses. How to organize? Google suggests how to prevent sending to a list of domains, but not a list of addresses.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Mezhuev, 2020-07-11
specialist @borisdenis

See smtpd_recipient_restrictions , in particular check_recipient_access . The file format is described in man 5 access .

Implementation example
/etc/postfix/master.cf
submission inet n       -       n       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_recipient_restrictions=$mua_recipient_restrictions
smtps     inet  n       -       n       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_recipient_restrictions=$mua_recipient_restrictions

/etc/postfix/main.cf
mua_recipient_restrictions = check_recipient_access hash:/etc/postfix/blacklist

/etc/postfix/blacklist
[email protected]     REJECT
[email protected]     REJECT

После внесения изменений выполняем:
postmap /etc/postfix/blacklist
postfix reload

A
Alexander Chernykh, 2020-07-08
@sashkets

I think I need to play around with header_checks
/^To:[email protected]/ REJECT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question