Roland Schneider wrote:
--Mark Janssen wrote on 05.03.03 23:56 +0100:
It takes about two lines of code to record the contents of $BLOCK2 in a X-Spam-header for later filtering.
How would I do this... do you have a code snippet as an example
You still can assign 'non-false-positives-lists' like SBL, UPL, SORBS and alike to $BLOCK and reject them right away.
I have setup some of the DNS based filters to set the $BLOCK2 variable. I'm assuming I'll have to get maildrop to check this and then file the mail away in a spambox, but AFAIK maildrop can't access the BLOCK or BLOCK2 variables (running in delivery mode)
Inserting a header is the only way to communicate with the delivery-module. I am also planning a patch there so maildrop wont be needed anymore for quarantine to the Spamfolder.
At courier/submit.C, linenumbers are probably somewhat off due to other stuff, but copy&paste should work. One probably should sanitize the contents, non-ascii could mess up everything.
char *safe = rfc2047_encode_str(header, RFC2045CHARSET);
which works as epected, or maybe even script-alike:
header += rfc2047_encode_str(p, RFC2045CHARSET);
but I dont include that here until tested, and dont really know what would happen with embedded \n. Improved and tested patch welcome ;)
@@ -933,26 +958,112 @@ const char *p;
my_rcptinfo.submitfile.MessageStart(); +// PATCH: record some headers if received via esmtp + if(!strncmp(mf->module->name, "esmtp", 5)) + { + // PATCH: record contents of SPAM or BLOCK2 in topmost header + // may be set either from esmtpdaccess, dnsbl or per-user filter-api + // plan: messages with 'X-Spam:' should be delivered into spamfolder + if((p=getenv("BLOCK2")) && *p) + { + header = "X-Spam: "; header += p; + header.TrimRight(); header += "\n"; // fix up + my_rcptinfo.submitfile.Message(header); + }
line="Received: from ";
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users