Postfix with restricted sender list / ACL

Discussion in 'Server Operation' started by schmidse, Jul 10, 2007.

  1. schmidse

    schmidse New Member

    Hello,

    our postfix-server is running fine and can sent mails to internal and external addresses.
    so what we want to do now is to restrict the access to this server through an ACL. therefore i have added two lines within /etc/postfix/access like the example:
    Code:
    ip1 OK
    ip2 REJECT
    Afterwards I have executed the command postmap /etc/postfix/access and restarted postfix with the result that no mail was delivered any more :-(
    Even when I load the original (working) config and start postfix with this config there is the same behaviour.

    There is something confusing for me within /var/log/mail.info
    Code:
    postfix/qmgr : [message-id] from: sender, size=xxx, nrcpt=1 (queue active)
    postfix/smtpd: disconnect client [client-ip]
    psotfix/smtp: [message-id] to: recipient, relay=relayhost, delay=yy, status=sent (250 message accepted for delivery)
    postfix/qmgr: [message-id] removed
    This seems to me that all the mails are deleted?! :confused:

    Our basic configuration is shown in the thread here
    http://www.howtoforge.com/forums/showthread.php?t=13200

    What is the right way to introduce an ACL to postfix?
    Modifying the variable smtp_client_restrictions and edit the /etc/postfix/access?

    It would be nice if someone out there can help me.

    Thanks in advance!
     
    Last edited: Jul 10, 2007
  2. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your mail log?
    Are the mails gone, or are they maybe in the mail queue? You can check with
    Code:
    postqueue -p
     
  3. schmidse

    schmidse New Member

    I can't find any error in our mail log.

    The Mail queue is empty, this is the result of the command postqueue -p

    Perhaps I made a mistake in my proceeding of generating an ACL:
    First I created a file like this one:
    Code:
    1.2.3.4 OK
    1.2.3 REJECT
    So only one server should be able to send mails through this postfix server.
    Then I executed the command:
    Code:
    postmap -q - /etc/postfix/access < file
    After this I have changed the parameter
    smtpd_client_restrictions from no value to hash: /etc/postfix/access

    Afterwards I restarted postfix.

    Is this the correct way or is there still more to do? Does such an ACL influence the parameter mynetworks?
     

Share This Page