Postfix Whitelists

  • Today I was configuring my existing email server with a smarthost to relay emails to a test domain hosted by i-mscp.


    Everything was fine. DNS, MX Records for lan resolutions etc.
    But when I tried to send email to that domain I got in return:


    Code
    1. Recipient address rejected: Mail appeared to be SPAM or forged. Ask your Mail/DNS-Administrator to correct HELO and DNS MX settings or to get removed from DNSBLs ##


    It seems that postfix policyd doesn't care of my local DNS configuration (correct me if I'm wrong) and look for an answer on internet.


    At first I look in this forum to find a quick solution, but I found only a few discussions in the German Corner..


    So I decided to create a whitelist for my internal mail server.
    I hope this could help someone else


    1. Make a copy of your /etc/postfix/main.cf
    2. Edit /etc/postfix/main.cf
    3. Look for smtpd_recipient_restrictions =
    4. Just above check_policy_service (.....) insert this line


    Code
    1. check_client_access hash:/etc/postfix/policyd_weight_client_whitelist,


    You can change the filepath or filename, but do not forget the comma at the end.


    5. Create the file /etc/postfix/policyd_weight_client_whitelist (or however you named it jist above)


    Code
    1. 192.168.0.1 permit_auth_destination


    The IP is just an example. Use the IP you want to whitelist.


    6. Reload postfix daemon
    7. execute postmap /etc/postfix/policyd_weight_client_whitelist

    Edited once, last by Botolo ().