From 69878951749e135ac56f0965557ad9df6a0dc522 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 26 Sep 2007 23:10:02 -0400 Subject: [PATCH] Make spam-checking in Exim really work --- conf.d/acl/40_exim4-config_check_data | 9 --------- conf.d/router/250_exim4-config_spamcheck_vmail | 9 +++++++++ .../550_exim4-config_spamcheck_localuser | 10 ++++++++++ conf.d/transport/20_exim4-config_spamcheck | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 conf.d/router/250_exim4-config_spamcheck_vmail create mode 100644 conf.d/router/550_exim4-config_spamcheck_localuser create mode 100644 conf.d/transport/20_exim4-config_spamcheck diff --git a/conf.d/acl/40_exim4-config_check_data b/conf.d/acl/40_exim4-config_check_data index 5f8f25b..fb219a0 100644 --- a/conf.d/acl/40_exim4-config_check_data +++ b/conf.d/acl/40_exim4-config_check_data @@ -61,15 +61,6 @@ acl_check_data: # X-Spam_bar: $spam_bar\n\ # X-Spam_report: $spam_report - # hcoop-change: Our more-competent solution - warn - # Only run through spamassassin if the user wants this - condition = ${if exists{/etc/spamassassin/addrs/${local_part}@${domain}}\ - {yes}{no}} - spam = nobody:true - add_header = X-Spam-Score: $spam_score ($spam_bar) - add_header = X-Spam-Report: $spam_report - # This hook allows you to hook in your own ACLs without having to # modify this file. If you do it like we suggest, you'll end up with diff --git a/conf.d/router/250_exim4-config_spamcheck_vmail b/conf.d/router/250_exim4-config_spamcheck_vmail new file mode 100644 index 0000000..1b46a4a --- /dev/null +++ b/conf.d/router/250_exim4-config_spamcheck_vmail @@ -0,0 +1,9 @@ +# hcoop-change: Pass email through spamc if it has not already been +# scanned. + +spamcheck_router_vmail: + no_verify + condition = "${if !eq {$received_protocol}{spam-scanned} {1}{0}}" + require_files = /etc/spamassassin/addrs/${local_part}@${domain} + driver = accept + transport = spamcheck diff --git a/conf.d/router/550_exim4-config_spamcheck_localuser b/conf.d/router/550_exim4-config_spamcheck_localuser new file mode 100644 index 0000000..1bedd3f --- /dev/null +++ b/conf.d/router/550_exim4-config_spamcheck_localuser @@ -0,0 +1,10 @@ +# hcoop-change: Pass email through spamc if its recipient is a valid +# HCoop user and it has not yet been scanned. + +spamcheck_router_localuser: + no_verify + condition = "${if !eq {$received_protocol}{spam-scanned} {1}{0}}" + check_local_user + require_files = /etc/spamassassin/addrs/${local_part}@localhost + driver = accept + transport = spamcheck diff --git a/conf.d/transport/20_exim4-config_spamcheck b/conf.d/transport/20_exim4-config_spamcheck new file mode 100644 index 0000000..c44f0a4 --- /dev/null +++ b/conf.d/transport/20_exim4-config_spamcheck @@ -0,0 +1,18 @@ +# hcoop-change: Pass email through spamc, back through exim again, +# marking it as scanned. Also, remove any pre-existing X-Spam +# headers from the message. + +spamcheck: + debug_print = "T: spamassassin_pipe for $local_part@$domain" + driver = pipe + command = /usr/sbin/exim4 -oMr spam-scanned -bS + use_bsmtp + transport_filter = /usr/bin/spamc + home_directory = "/tmp/exim4" + current_directory = "/tmp/exim4" + user = Debian-exim + group = Debian-exim + return_fail_output + message_prefix = + message_suffix = + headers_remove = X-Spam-Flag:X-Spam-Status:X-Spam-Level -- 2.20.1