Posts

Showing posts with the label smarthost

How to configure a mail server with Postfix and Dovecot for different requirements

Image
I had originally written this article for xmodulo.com Mail server admins may often have to deal with different types of requirements based on service policies or customer-specific requests. This tutorial will cover  common cases of mail server administration . More specifically, it will show how different mail server requirements can be met by tuning parameters of  Postfix and Dovecot . Useful Postfix Commands Before we start, let us look at some commands related to Postfix. 1. postfix reload vs. service postfix restart To reload Postfix with any updated configuration files, two commands can be used. postfix reload:  This command will check configuration files, and will update Postfix accordingly. As this command does not cause Postfix to shut down, it is highly recommended in production environments. service postfix restart:  This command will first shut down Postfix, and then start it again. This command will start a fresh instance of Postfix. De...

Sendmail: Bypass DNS and Forward Emails to Smart Host

Scenario: We need a dumb mail server that would forward all outgoing mails (originated in the server) to a relay host/smart host. We don't want our mail server to do any DNS queries (we leave the noble task for the smart host, after all, he's "smart"). Here's how it's done in sendmail- Create a new file in the / etc/mail directory vim /etc/mail/service.switch ####### start of file ######### hosts files aliases files ####### end of file ########### We add the "relay host" IP to sendmail.mc vim /etc/mail/sendmail.mc define(`SMART_HOST',`192.168.2.250')dnl ### obviously, replace the relay host address based on your requirements ### end ### m4 /etc/mail/senmdmail.mc > /etc/mail/sendmail.cf service sendmail restart NOTE : Make sure there is no dnl in the beginning of the line. The compiler will treat any starting with dnl as a comment. And it's done. Now our mail server will not do any DNS queries and forward all o...