How to block domains (postfix) linux

Here a quick run down on how to block specific domains in postfix.

First edit the /etc/postfix/main.cf file

Add the following line:

smtpd_sender_restrictions = hash:/etc/postfix/deny

next create the deny file

/etc/postfix/deny (this is where you will put your list of domains)

Use this format:

yahoo.com    REJECT

Now use port map to that Postfix can read the file at startup.

postmap hash:/etc/postfix/deny

Now restart postfix

service postfix restart

Send a email from the domain… Yahoo for example to test, look at the log file.

tail /var/log/maillog

Note that after you add to the deny file you will need to use the portmap command again and restart postfix.

How to allow out of office responses to send to external domains. Microsoft Exchange 2003

Microsoft Exchange 2003 default settings do not allow out of office replies to leave the internal domain. A lot of users want this on if they deal with a lot of external clients.

Options to Change:

Using the Exchange System Manager, open Global Settings >> Internet Message Formats, right click “default” on the right hand panel. Select Properties >> Advanced. Check the “allow out of office responses” box, and “allow automatic replies” Click apply and then okay.

Restart SMTP Service

Go to Start>>Programs>>Administrative Tools >>Services>>Right click on the Simple Mail Transport Protocol and Click Restart

Your external senders should now get the out of office messages, keep in mind they will only get once per time the out of office is on, this is done for obvious reasons to prevent mail loops, etc.