Okay, here is what I have done so far to get spamgourmet to work with exim4 (Debian unstable). I am using the split config files option so I had to add two new exim4 config files and a small patch to spameater.pl. The patch is required because exim4 does not put angle brackets around the for in the received headers.
- Code: Select all
--- spameater.pl 19 May 2004 01:50:14 -0000 1.2
+++ spameater.pl 23 Nov 2004 02:13:15 -0000
@@ -116,8 +116,8 @@
}
if (!$for || $for eq $config->getOtherDomainEmail()) {
- $line =~ /^.*for <(.+)>/;
- $for = $1;
+ $line =~ /^.*for (<(.+)>|([^;]+))/;
+ $for = $2 || $3;
if (!$for || $for eq $config->getOtherDomainEmail()) {
$line =~ /^Delivered\-To\:\s+\w+\-\w{3}\-(.*)/;
$for = $1;
/etc/exim4/conf.d/router/950_exim4-config_spamgourmet
- Code: Select all
### router/9t0_exim4-config_spamgoumet
#################################
spamgourmet_backup:
debug_print = "R: spamgourmet backup for $local_part@$domain"
driver = accept
domains = +local_domains
local_part_prefix = *. : *~ : +*+*+
transport = spamgourmet_pipe_backup
unseen
spamgourmet:
debug_print = "R: spamgourmet for $local_part@$domain"
driver = accept
domains = +local_domains
local_part_prefix = *. : *~ : +*+*+
transport = spamgourmet_pipe
/etc/exim4/conf.d/transport/30_exim4-config_spamgourmet_pipe
- Code: Select all
spamgourmet_pipe:
debug_print = "T: spamgourmet_pipe for $local_part@$domain"
driver = pipe
path = "/bin:/usr/bin:/usr/local/bin:/home/spamgourmet/spamgourmet/mailhandler"
command = "/home/spamgourmet/spamgourmet/mailhandler/spameater.pl"
user = spamgourmet
# group =
environment = "SG_DIR=/home/spamgourmet/spamgourmet:SG_CONF_FILE=/home/spamgourmet/spamgourmet/conf/spamgourmet.config"
#return_path_add
#delivery_date_add
#envelope_to_add
spamgourmet_pipe_backup:
debug_print = "T: spamgourmet_pipe_backup for $local_part@$domain"
driver = appendfile
file = /var/mail/spamgourmet
# delivery_date_add
# envelope_to_add
# return_path_add
user = MYUSER
group = mail
mode = 0660
mode_fail_narrower = false
Then run
- Code: Select all
sudo update-exim4.conf; sudo /etc/init.d/exim4 restart
and you should be all set.
The reason I use two transports and two pipes is to make a backup copy of every email in /var/mail/spamgourmet before it gets delivered to spameater.pl. This is just for debug purposes.
I do not have a special domain for spamgourmet, so I had to find a way for exim4 to realize which emails should be routed to spameater.pl. I did this with
- Code: Select all
local_part_prefix = *. : *~ : +*+*+
It is a little crude (any email address with a . or a ~ in it, or any address that has 3 pluses) but it seems to work.
Omen