Den 12. feb. 2017 21:44, skrev ebroch at whitehorsetc.com:> > > Any opinion on dspam's interoperability with this? > >Just follow the wiki and replace sa-learn scripts with calling dspam. Dspam direct pipe needs mail-line-endings (\r\n) translated into unix line-endings (\r). like so: ----- learn-spam.sh --------- #!/bin/sh sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=spam ----- learn-ham.sh ---------- #!/bin/sh sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=innocent ------ Theese will be invoked with the owner of the mailbox as current uid, so that is all.
On 2017-02-12 23:00:49 +0100, H?kon Alstadheim wrote:> Just follow the wiki and replace sa-learn scripts with calling dspam. > Dspam direct pipe needs mail-line-endings (\r\n) translated into unix > line-endings (\r).tbh ... what do you do about mails which just use \r as separator? s|\r\n|\n| is safer. darix> like so: > > ----- learn-spam.sh --------- > #!/bin/sh > sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=spam > > ----- learn-ham.sh ---------- > #!/bin/sh > sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=innocent > > ------ > > Theese will be invoked with the owner of the mailbox as current uid, so > that is all.-- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org
Op 2/12/2017 om 11:00 PM schreef H?kon Alstadheim:> > Den 12. feb. 2017 21:44, skrev ebroch at whitehorsetc.com: >> >> Any opinion on dspam's interoperability with this? >> >> > Just follow the wiki and replace sa-learn scripts with calling dspam. > Dspam direct pipe needs mail-line-endings (\r\n) translated into unix > line-endings (\r). > > like so: > > ----- learn-spam.sh --------- > #!/bin/sh > sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=spam > > ----- learn-ham.sh ---------- > #!/bin/sh > sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=innocent > > ------ > > Theese will be invoked with the owner of the mailbox as current uid, so > that is all.Actually, Pigeonhole should be able to do that too: https://github.com/dovecot/pigeonhole/blob/master/doc/plugins/sieve_extprograms.txt#L112 Yes, I need to update the wiki. Regards, Stephan.
Den 12. feb. 2017 23:56, skrev Marcus Rueckert:> On 2017-02-12 23:00:49 +0100, H?kon Alstadheim wrote: >> Just follow the wiki and replace sa-learn scripts with calling dspam. >> Dspam direct pipe needs mail-line-endings (\r\n) translated into unix >> line-endings (\r).I had a typo here, (\r\n) gets replaced by just (\n).> > tbh ... what do you do about mails which just use \r as separator? >You are mistaken. Firstly: s/\r$// will remove \r from the end of any line, do nothing if there is no \r. Secondly: All line-endings as seen by transfer-agents is transferred with the same line endings (MTA-MTA: \r\n; locally: usually the same but may be different). "Line ending" here pertains to after each header, and between message-parts. If there are naked (\n) characters in the message body, that is of no concern. Point of filter is to make Dspam-signature parseable for dspam. If there is an (\r) at the end of the header, Dspam will not find a match, and be unable to reclassify the mail.> s|\r\n|\n| is safer. > > darix > >> like so: >> >> ----- learn-spam.sh --------- >> #!/bin/sh >> sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=spam >> >> ----- learn-ham.sh ---------- >> #!/bin/sh >> sed -e 's/\r$//' | /usr/bin/dspam --source=error --class=innocent >> >> ------ >> >> Theese will be invoked with the owner of the mailbox as current uid, so >> that is all. >
On 02/12/2017 05:28 PM, Stephan Bosch wrote:> > Actually, Pigeonhole should be able to do that too: > > https://github.com/dovecot/pigeonhole/blob/master/doc/plugins/sieve_extprograms.txt#L112 > > Yes, I need to update the wiki. > > > Regards, > > Stephan. >For DSPAM, with --client, one also needs a --user set. http://hg.dovecot.org/dovecot-antispam-plugin/file/5ebc6aae4d7c/src/dspam.c did this. Is there a way to feed this into the scripts mentioned? I imagine this is imap.user or imap.email, but how would one pass it to the script? Thank you. Trever -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 872 bytes Desc: OpenPGP digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20170224/95102812/attachment.sig>