Spamfilter mit Exim

Filed in Netzwerk

Um Netzwerkweit Spamfilter einsetzen zu können, habe ich mittlerweile 2 Filter im Einsatz, Bogofilter und Spamassassin, ich verwende eine eigene, handgepflegte exim4.conf, die entsprechenden Änderungen sollten jedoch auch in die normale exim4.conf.template eingefügt werden können. Exim ist konfiguriert für maildir, was ich bevorzuge.

exim4.conf – Transports Abschnitt, Position egal. Das Verzeichnis /var/cache/bogofilter muss mit passendem Eigentümer angelegt werden (Debian-exim.Debian-exim)

# bogo_transport:
driver = pipe
 command = /usr/sbin/exim4 -oMr bogodone -bS
 use_bsmtp = true
 headers_add = X-Bogofilterd: true
 transport_filter = /usr/bin/bogofilter -d /var/cache/bogofilter -l -p -e -u
 group = Debian-exim
 user = Debian-exim
 home_directory = "/var/tmp"
 current_directory = "/var/tmp"
 log_output = true
 return_fail_output = true
 return_path_add = false
spamcheck:
 driver = pipe
 command = /usr/sbin/exim4 -oMr spam-scanned -bS
 use_bsmtp = true
 transport_filter = /usr/bin/spamc
 home_directory = "/var/tmp"
 current_directory = "/var/tmp"
 # must use a privileged user to set $received_protocol on the way back in!
 user = Debian-exim
 group = Debian-exim
 log_output = true
 return_fail_output = true
 return_path_add = false
 message_prefix =
 message_suffix =

In exim4.conf im Abschnitt Routers am Anfang

spamcheck_router:
  no_verify
  check_local_user
  # When to scan a message :
  #   -   it isn't already flagged as spam
  #   -   it isn't already scanned
  condition = "${if and{{!def:h_X-Spam-Flag:}
                       { and{{!eq {$received_protocol}{spam-scanned}}
                            {!eq {$received_protocol}{bogodone}}}}} {1}{0}}"
  driver = accept
  transport = spamcheck
bogo_router:
  no_verify
  condition = ${if !eq {$received_protocol}{bogodone} {1}{0}}
  domains = +local_domains
  driver = accept
  transport = bogo_transport

In der .procmailrc

# spamassassin
:0
* ^x-spam-level:.****
.Junk/
# bogofilter
:0:
* ^X-Bogosity: Yes, tests=bogofilter
.Junk
Oenology Post Formats
Click to view/hide
Posts Calendar
Click to view/hide
Januar 2019
M D M D F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  
Archive
Click to view/hide
Letzte Beiträge
Click to view/hide