{"id":5628,"date":"2016-04-06T11:02:20","date_gmt":"2016-04-06T03:02:20","guid":{"rendered":"http:\/\/rmohan.com\/?p=5628"},"modified":"2016-04-06T11:02:20","modified_gmt":"2016-04-06T03:02:20","slug":"configuring-postfix-as-a-null-client","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5628","title":{"rendered":"Configuring Postfix as a Null Client"},"content":{"rendered":"<p>Configuring Postfix as a Null Client<\/p>\n<p>This howto assumes that the relay server\u2019s IP address is 192.168.1.22 and is running RHEL\/CentOS 7. Only mail from the 192.168.1.0\/24 network should be accepted and relayed.<\/p>\n<p>Install Postfix<br \/>\n[root@rhce-server ~]# yum install postfix<\/p>\n<p>Configure Systemd<br \/>\n[root@rhce-server ~]# systemctl enable postfix<br \/>\n[root@rhce-server ~]# ^enable^start<\/p>\n<p>Configure the Firewall<br \/>\n[root@rhce-server ~]# firewall-cmd &#8211;add-service=smtp<br \/>\nsuccess<br \/>\n[root@rhce-server ~]# firewall-cmd &#8211;add-service=smtp &#8211;permanent<br \/>\nsuccess<\/p>\n<p>Configure Postfix<\/p>\n<p>Postfix\u2019s main configuration file is located at \/etc\/postfix\/main.cf.<\/p>\n<p>Configure Postfix to listen on the correct interface.<br \/>\ninet_interfaces = all<\/p>\n<p>Configure the trusted network.<br \/>\nmynetworks = 192.168.1.0\/24<\/p>\n<p>Configure the list of domains that this Postfix service should consider itself the final destination for. In my case the server is named rhce-server.<br \/>\nmydestination = rhce-server, localhost.localdomain, localhost<\/p>\n<p>Configure all mail not destined for this server to be relayed to another SMTP server.\u00a0 The brackets tell Postfix to turn off MX lookups.<br \/>\nrelayhost = [smtp-server.rmohan.com]<\/p>\n<p>Restart Postfix<br \/>\n[root@rhce-server postfix]# systemctl restart postfix<\/p>\n<p>Send a Test Email<br \/>\n[root@rhce-server postfix]# mail -s &#8220;rhce-server test&#8221; josh@example.com<br \/>\ntesting our null postfix configuration<br \/>\n.<br \/>\nEOT<\/p>\n<p>With any luck we should be all set. You can verify the mail was successfully relayed in \/var\/log\/maillog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configuring Postfix as a Null Client<\/p>\n<p>This howto assumes that the relay server\u2019s IP address is 192.168.1.22 and is running RHEL\/CentOS 7. Only mail from the 192.168.1.0\/24 network should be accepted and relayed.<\/p>\n<p>Install Postfix [root@rhce-server ~]# yum install postfix<\/p>\n<p>Configure Systemd [root@rhce-server ~]# systemctl enable postfix [root@rhce-server ~]# ^enable^start<\/p>\n<p>Configure the Firewall [root@rhce-server ~]# [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5628"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5628"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5628\/revisions"}],"predecessor-version":[{"id":5629,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5628\/revisions\/5629"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}