{"id":524,"date":"2013-12-30T15:27:19","date_gmt":"2013-12-30T23:27:19","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=524"},"modified":"2013-12-30T15:27:19","modified_gmt":"2013-12-30T23:27:19","slug":"sanitizing-email-recipient-list","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/sanitizing-email-recipient-list\/","title":{"rendered":"Sanitizing Email Recipient List"},"content":{"rendered":"
I wrote a couple articles on respectively using sendmail and postfix to block outbound email and only allow selective domains and selective email addresses. \u00a0I ran into problems with both sendmail and postfix doing exactly what I want. \u00a0Sendmail was fairly easy to satisfy the requirements for forwarding only to certain domains. Postfix got very close on doing domains plus a selective few email addresses. \u00a0I could not get the multi instance postfix method working 100% with my header checks though.<\/p>\n
Below is another method to sanitize outbound email addresses using python smtplib and sendmail.<\/p>\n
Sendmail answer on non standard port:<\/span><\/p>\n\r\nroot@myhost:\/etc\/mail\/cf\/cf# more usla-utility.mc\r\ndivert(-1)\r\n...\r\ndivert(0)dnl\r\nVERSIONID(`sendmail.mc (Sun)')\r\nOSTYPE(`solaris11')dnl\r\nDOMAIN(`solaris-generic')dnl\r\nDAEMON_OPTIONS(`Port=10026,Addr=127.0.0.1, Name=MTA')dnl\r\nMASQUERADE_AS(`arbonne.com')\r\nFEATURE(masquerade_envelope)\r\nFEATURE(`mailertable')\r\nMAILER(`local')dnl<br \/>\r\n\r\nroot@myhost:\/etc\/mail\/cf\/cf# \/usr\/ccs\/bin\/m4 ..\/m4\/cf.m4 myhost.mc > \/etc\/mail\/sendmail.cf\r\n<\/pre>\n