Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have configured postfix like this to prevent spam (I am

smtpd_helo_restrictions         =
    check_client_access hash:/etc/postfix/check_client_access
    check_helo_access hash:/etc/postfix/check_helo_access

Because of that, I have the following logs:

Jul 30 00:04:14 stormrage postfix/smtpd[28116]: NOQUEUE: reject: RCPT from[]: 450 4.7.1 <>: Helo command rejected: Host not found; from=<> to=<> proto=ESMTP helo=<>

This example log is a legitimate email, so I whitelist in check_helo_access like this:

/etc/postfix/check_helo_access: OK

It works, but I think the whitelisting may be strengthen. I can whitelist by host or by sender, but not both.

How can I whitelist an email based on specific sender/domain-sender when sent though specific host ?

share|improve this question
I agree but I'm not sure this is doable. However, using your configuration plus some regular antispam should lead to pretty good results. – user130370 Jul 31 '13 at 9:40
Yes and furthurmore this part of the conf is useless against spam received from hacked/fake account (from gmail or microsoft live), but this is for personal and small business use, so I can accept to manually fix false positive (for now). – Veovis Jul 31 '13 at 13:35

1 Answer 1

up vote 1 down vote accepted

I can whitelist by host or by sender, but not both.

actually you could. All you need is to use smtpd_restriction_classes

smtpd_restriction_classes = sender_white_list
sender_white_list = check_client_access hash:/etc/postfix/check_client_access, reject

smtpd_helo_restrictions =
  check_helo_access hash:/etc/postfix/check_helo_access

/etc/postfix/check_helo_access sender_white_list

/etc/postfix/check_client_access OK
share|improve this answer
smtpd_restriction_classes is not practical however. – Veovis Jul 31 '13 at 13:13
Unfortunately, as I know, there is no other way to get such behavior in the postfix. If you need more flexible rules you could try to write you own policy service as described at – ALex_hha Jul 31 '13 at 13:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.