Postfix 2.10 block sender email ID on RHEL 7

Hi,

i am having issue blocking a particular email address via postfix 2.10.

I am using the following:

cat /etc/postfix/sender_access
someone@example.com    REJECT
postmap hash:/etc/postfix/sender_access

Following config in: /etc/postfix/main.cf

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access

Also i have a relayhost configured.

But emails are not being blocked.

On RHEL6, the same configs work but RHEL7 does not work.

Appreciate assistance on it.

Thanks,
Vikash

Try:

smtpd_recipient_restrictions = reject_unauth_destination, check_sender_access hash:/etc/postfix/sender_access

And restart the postfix smtpd service. For more info see http://www.postfix.org/postconf.5.html#smtpd_recipient_restrictions

HI nixcraft,

i tried that and still didn’t help.

i tried:

$>postconf -d | grep smtpd_reci

output:
smtpd_recipient_restrictions =

Not sure why is that, i did end the conf and restarted.

Thanks,
Vikash

Are you sure you are editing correct file? Sometimes you edit wrong file.

Hi Vivek,

Yes i am editing /etc/postfix/main.cf…

so far this morning, i am no longer seeing the messages for the account i was blocking…

I will keep an eye and if any issues arises, will reach out.

Once again, appreciate your help and assistance.

Thanks,
Vikash