Difference between revisions of "Postfix whitelist"

From vpsget wiki
Jump to: navigation, search
(Created page with "These steps will allow specified mailboxes to send mail from your postfix mailserver and restrict the others. Tested on Centos 6 Create the whitelist nano /etc/postfix/whit...")
 
 
(One intermediate revision by the same user not shown)
Line 25: Line 25:
 
Restart postfix
 
Restart postfix
 
  service postfix restart
 
  service postfix restart
 +
 +
[[Category:Linux]]

Latest revision as of 16:26, 17 March 2015

These steps will allow specified mailboxes to send mail from your postfix mailserver and restrict the others.

Tested on Centos 6

Create the whitelist

nano /etc/postfix/whitelist

You can allow specified mailboxes, all mailboxes of the domain or all mailboxes of the domain and subdomains.

Respective lines of these three types of permissions:

user@examlpe.com OK
@examlpe.com OK
.example.com OK

Let postfix know about your database:

postmap /etc/postfix/whitelist

Configure postfix:

nano /etc/postfix/main.cf

Add these lines:

smtpd_sender_restrictions =
    check_sender_access  hash:/etc/postfix/whitelist,
    permit_sasl_authenticated,
    permit_mynetworks,
    reject_non_fqdn_sender,
    reject_unknown_sender_domain,
    permit

Restart postfix

service postfix restart