3

I have installed Postfix, I can send mails between local users as expected, but I would try to limit the access of a particular user to the server. I edited the /etc/postfix/access file in this way:

[email protected] REJECT

where example.com is $mydomain. I did also a postmap access to generate the validate file. Strangely, I can still send mail from the diego account using mutt. Here the maillog:

Jan 22 15:46:36 server postfix/pickup[6637]: 62117BF647: uid=500 from=<diego>
Jan 22 15:46:36 server postfix/cleanup[6737]: 62117BF647: message-id=<[email protected]>
Jan 22 15:46:36 server postfix/qmgr[6638]: 62117BF647: from=<[email protected]>, size=422, nrcpt=1 (queue active)
Jan 22 15:46:36 server postfix/local[6739]: 62117BF647: to=<[email protected]>, relay=local, delay=0.07, delays=0.06/0.02/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jan 22 15:46:36 server postfix/qmgr[6638]: 62117BF647: removed

2 Answers 2

2

Did you also changed the Postfix configuration file /etc/postfix/main.cf to look for restrictions:

check_recipient_access hash:/etc/postfix/access

Then generate the hash file:

/usr/sbin/postmap /etc/postfix/access

Restart the postfix service:

service postfix restart

Source

Example of /etc/postfix/access file:

[email protected]   permit_mynetworks,reject
[email protected] permit_mynetworks,reject

Other example

3
  • I did the modification you suggested in che main.cf file: check_recipient_access = hash:/etc/postfix/access and edited the access file: [email protected] permit_mynetworks,reject but still I can send mails from the "diego" account.
    – ludiegu
    Jan 22, 2014 at 14:03
  • You should only add [email protected] reject. Then you need to execute the following command : /usr/sbin/postmap /etc/postfix/access
    – Boogy
    Jan 22, 2014 at 14:55
  • I did that also, I tried then: diego@ REJECT edited the main.cf: smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access and restarted postfix, but the account diego can still send emails.
    – ludiegu
    Jan 23, 2014 at 9:51
1

I found finally the correct sintax. If you want to just block a user, you have to edit the main.cf file in this way:

smtpd_sender_restrictions =
 check_sender_access hash:/etc/postfix/access

and in the access file:

user@                        REJECT
[email protected] REJECT #this will REJECT only if sender is from server.example.com domain

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .