Filtering with subject and certain recipient
Hi All, Sorry if I re-posting again, maybe someone has posted this one before. I am using postfix and want to certain recipient only receive email from outside with certain subject. such as t...@mydomain.com only receive email with subject test 1 and test 2 Is it possible? If yes does anyone has done it ? and how to do that?
Re: Filtering with subject and certain recipient
On 7/18/2011 1:29 AM, Marky Yehezkiel[SNC] wrote: I am using postfix and want to certain recipient only receive email from outside with certain subject. such as t...@mydomain.com only receive email with subject test 1 and test 2 Is it possible? If yes does anyone has done it ? and how to do that? Something like this is probably better and more easily implemented in your MDA's filter language. What MDA are you using? -- Stan
Re: Filtering with subject and certain recipient
Op 18-7-2011 8:29, Marky Yehezkiel[SNC] schreef: Hi All, Sorry if I re-posting again, maybe someone has posted this one before. I am using postfix and want to certain recipient only receive email from outside with certain subject. such as t...@mydomain.com only receive email with subject test 1 and test 2 Is it possible? If yes does anyone has done it ? and how to do that? Hi marky, Do you have a spamfilter running? (I have Spamasassin set up, which could do the trick) You could write a rule (in local.cf) only allowing very speciffic mails and giving all other mails an exptremely high SPAM-score resulting in deletion (do try to prevent auto-spam/ham learning at this point..) If you are a bit handy with regular expressions, you should get there, here is something that may help (worte this one down as an example, with !, you'll get the not, haven't tried that one here, but it should work) # SPAM TEST_1 header __TEST_1_1 From =~ /senderfa...@faultydomain.nl/i header __TEST_1_2 Subject =~ /A wrong subject/i body__TEST_1_3 /Stuff in the boddy you do not want to see/i metaLOCAL_TEST_1 ( __TEST_1_1 || (__TEST_1_2 __TEST_1_3) ) score LOCAL_TEST_1 99.0 describeLOCAL_TEST_1 LOCAL_TEST_1 for debugging your local filter use spamassassin --lint Best regards, Eesger
Re: Filtering with subject and certain recipient
On 2011-07-18 02:30:04 -0500, Stan Hoeppner wrote: On 7/18/2011 1:29 AM, Marky Yehezkiel[SNC] wrote: I am using postfix and want to certain recipient only receive email from outside with certain subject. such as t...@mydomain.com only receive email with subject test 1 and test 2 Is it possible? If yes does anyone has done it ? and how to do that? Something like this is probably better and more easily implemented in your MDA's filter language. What MDA are you using? What if the admin wants to reject the mail if the subject is incorrect (so that the sender knows that the message was not accepted)? Doing that in the MDA is too late if one wants to avoid possible backscatter. Or am I missing something? -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
Re: Filtering with subject and certain recipient
On 2011-07-18 13:18, Vincent Lefevre wrote: On 2011-07-18 02:30:04 -0500, Stan Hoeppner wrote: On 7/18/2011 1:29 AM, Marky Yehezkiel[SNC] wrote: I am using postfix and want to certain recipient only receive email from outside with certain subject. such as t...@mydomain.com only receive email with subject test 1 and test 2 Is it possible? If yes does anyone has done it ? and how to do that? Something like this is probably better and more easily implemented in your MDA's filter language. What MDA are you using? What if the admin wants to reject the mail if the subject is incorrect (so that the sender knows that the message was not accepted)? Doing that in the MDA is too late if one wants to avoid possible backscatter. Or am I missing something? If your receiving SMTPDs restrictions are sane, a reject from the MDA will not cause backscatter. It will cause the correct DSN to be sent to the correct sender. Anyway, if you must reject it at SMTP time, there is smtp_proxy to put $whatever in between. -- J.
RE: Filtering with subject and certain recipient
Thanks all for the input especially for Eesger. Yesterday we able block the certain subject to certain recipient using spamassasin by giving high score. But another question appear, how to allow certain words to certain recipient? Like firewall in freebsd or another OS that can allow certain IP by making the firewall default as block. As far as I know spamassasin will sum all scores, for example : first rule I want to allow subject word test with score -2 and second rule subject test2 with score -2 then third rule with subject character e as higher score and spamassasin should mark it as spam. If I test email with subject test then it will also hit the third rule, I know I should ask in milis spammasasin about this but if anyone know how to do that it will be great . I am using MDA courier with pop3 -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Jeroen Geilman Sent: Tuesday, July 19, 2011 12:58 AM To: postfix-users@postfix.org Subject: Re: Filtering with subject and certain recipient On 2011-07-18 13:18, Vincent Lefevre wrote: On 2011-07-18 02:30:04 -0500, Stan Hoeppner wrote: On 7/18/2011 1:29 AM, Marky Yehezkiel[SNC] wrote: I am using postfix and want to certain recipient only receive email from outside with certain subject. such as t...@mydomain.com only receive email with subject test 1 and test 2 Is it possible? If yes does anyone has done it ? and how to do that? Something like this is probably better and more easily implemented in your MDA's filter language. What MDA are you using? What if the admin wants to reject the mail if the subject is incorrect (so that the sender knows that the message was not accepted)? Doing that in the MDA is too late if one wants to avoid possible backscatter. Or am I missing something? If your receiving SMTPDs restrictions are sane, a reject from the MDA will not cause backscatter. It will cause the correct DSN to be sent to the correct sender. Anyway, if you must reject it at SMTP time, there is smtp_proxy to put $whatever in between. -- J.