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 Fix – Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name.

Here is how to fix :

Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name.

You might get this error when restarting Apache. To resolve the issue add the following to your httpd.conf file:

ServerName xyz.yourdomainname.com

The file is usually located at – /etc/httpd/conf/httpd.conf

I use the same information that is in my reverse dns to my main public server IP.