{"id":27,"date":"2008-08-20T10:31:05","date_gmt":"2008-08-20T15:31:05","guid":{"rendered":"http:\/\/www.popmartian.com\/tipsntricks\/?p=27"},"modified":"2008-10-03T11:32:00","modified_gmt":"2008-10-03T16:32:00","slug":"how-to-update-qmail-relay-rules","status":"publish","type":"post","link":"https:\/\/www.popmartian.com\/tipsntricks\/2008\/08\/20\/how-to-update-qmail-relay-rules\/","title":{"rendered":"How to update qmail relay rules"},"content":{"rendered":"<p>D. J. Bernstein&#8217;s Qmail, now in the public domain, is a powerful yet clumsy SMTP messaging system.  One of the most common problems is updating the rules for allowing SMTP relay, or denying the same.<\/p>\n<p>If you qmail-smtpd under tcpserver, the following will update relay allow and relay forbid rules.<\/p>\n<p>Create a file called \/etc\/tcp.smtp and put in it:<\/p>\n<p><code>127.:allow,RELAYCLIENT=\"\"<br \/>\n1.1.1.1:allow,RELAYCLIENT=\"\"<br \/>\n2.2.:allow,RELAYCLIENT=\"\"<br \/>\n2.2.2.5:deny<\/code><\/p>\n<p>Qmail uses simple pattern matching so only classful subnets are allowed.  Sorry, no CIDR notation.<\/p>\n<p>The example above will allow\/deny:<\/p>\n<ul>\n<li>Allow relaying from 127.* your localhost subnet of 127.0.0.0\/8<\/li>\n<li>Allow the \/32 address of 1.1.1.1<\/li>\n<li>Allow 2.2.* the \/16 subnet of 2.2.0.0\/16<\/li>\n<li>Specifically forbid 2.2.2.5<\/li>\n<\/ul>\n<p>In order to implement these rules you need to update the server tcp.smpt.cbd file and restart Qmail.<\/p>\n<p>First, back up \/etc\/tcp.smtp, then run the command:<br \/>\n<code>tcprules \/etc\/tcp.smtp.cdb \/etc\/tcp.smtp.tmp &lt; \/etc\/tcp.smtp<\/code><\/p>\n<p>If the rules don&#8217;t update, make sure <code>-x \/etc\/tcp.smtp.cdb<\/code> is after tcpserver in your start script, then restart Qmail.<\/p>\n<blockquote><p>Did you find this post useful or have questions or comments?\u00c2\u00a0 Please let me know!<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>D. J. Bernstein&#8217;s Qmail, now in the public domain, is a powerful yet clumsy SMTP messaging system. One of the most common problems is updating the rules for allowing SMTP relay, or denying the same. If you qmail-smtpd under tcpserver, &hellip; <a href=\"https:\/\/www.popmartian.com\/tipsntricks\/2008\/08\/20\/how-to-update-qmail-relay-rules\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,3,10],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-email-servers","category-how-to-do-stuff","category-qmail"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":5,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts\/27\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}