{"id":1293,"date":"2020-09-15T09:58:24","date_gmt":"2020-09-14T21:58:24","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=1293"},"modified":"2020-09-15T15:33:22","modified_gmt":"2020-09-15T03:33:22","slug":"configuring-postfix-as-a-relay","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=1293","title":{"rendered":"Configuring Postfix as a Relay"},"content":{"rendered":"<h1>Installing Postfix<\/h1>\n<p>Run the following commands:<\/p>\n<pre style=\"white-space: pre;\">sudo apt-get update\r\nsudo apt-get install postfix<\/pre>\n<h1>Configuring Postfix<\/h1>\n<ol>\n<li>Run the following command:\n<pre style=\"white-space: pre;\">sudo dpkg-reconfigure postfix<\/pre>\n<p><strong>Configuration questions:<\/strong><\/p>\n<ol>\n<li>Select <strong>OK<\/strong> to proceed.<\/li>\n<li>Choose <strong>Satellite system<\/strong>.<\/li>\n<li>System Mail Name: <strong>&lt;EMAIL_DOMAIN&gt;<\/strong><\/li>\n<li>SMTP relay host: <strong>&lt;RELAY_HOST&gt;<\/strong><br \/>\n<blockquote><p>Where RELAY_HOST must include the port number (e.g. 192.168.1.1:465).<\/p><\/blockquote>\n<\/li>\n<li>Root and postmaster mail recipient: <strong>root<\/strong><\/li>\n<li>Other destinations to accept mail for: <strong>&lt;EMAIL_DOMAIN&gt;, localhost.localdomain, localhost<\/strong><\/li>\n<li>Force synchronous updates on mail queue? <strong>No<\/strong><\/li>\n<li>Local networks: <strong>127.0.0.0\/8 [::ffff:127.0.0.0]\/104 [::1]\/128<\/strong><\/li>\n<li>Mailbox size limit (bytes): <strong>0<\/strong><\/li>\n<li>Local address extension character: <strong>+<\/strong><\/li>\n<li>Internet protocols to use: <strong>all<\/strong><br \/>\n<blockquote><p>Feel free to answer the preceding questions based on your setup. Just replace the EMAIL_DOMAIN (i.e. example.com) with a valid value.<\/p><\/blockquote>\n<\/li>\n<\/ol>\n<\/li>\n<li><strong>Create<\/strong> the file <strong>\/etc\/postfix\/sasl_passwd<\/strong> with the following content:\n<pre style=\"white-space: pre;\">&lt;RELAY_HOST&gt; username:password<\/pre>\n<\/li>\n<li><strong>Create a postfix database<\/strong> based on <strong>\/etc\/postfix\/sasl_passwd<\/strong> using the following command:\n<pre style=\"white-space: pre;\">sudo postmap \/etc\/postfix\/sasl_passwd<\/pre>\n<\/li>\n<li><strong>Edit<\/strong> the file <strong>\/etc\/postfix\/main.cf<\/strong> to have the following entries added or updated:\n<pre style=\"white-space: pre;\">smtp_tls_security_level = encrypt\r\nsmtp_sasl_auth_enable = yes\r\nsmtp_tls_wrappermode = yes\r\nsmtp_sasl_security_options =\r\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd<\/pre>\n<\/li>\n<li><strong>Restart<\/strong> the <strong>postfix service<\/strong> with the following command:\n<pre style=\"white-space: pre;\">sudo systemctl restart postfix<\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Installing Postfix Run the following commands: sudo apt-get update sudo apt-get install postfix Configuring Postfix Run the following command: sudo dpkg-reconfigure postfix Configuration questions: Select OK to proceed. Choose Satellite system. System Mail Name: &lt;EMAIL_DOMAIN&gt; SMTP relay host: &lt;RELAY_HOST&gt; Where RELAY_HOST must include the port number (e.g. 192.168.1.1:465). Root and postmaster mail recipient: root Other [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[55,59,12],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1293"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1293"}],"version-history":[{"count":2,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1293\/revisions"}],"predecessor-version":[{"id":1296,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1293\/revisions\/1296"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}