35
CentOS - SpamAssassin and Exim
Install SpamAssassin and Exim on a CentOS
1. Install Spamassassin [SSH]:
sudo yum install spamassassin
2. Create file filters in /etc/exim/ folder with code:
if $h_X-Spam-Flag: contains "YES"
then
headers add "Old-Subject: $h_subject"
headers remove "Subject"
headers add "Subject: ***[SPAM]*** $h_old-subject"
headers remove "Old-Subject"
endif
3. In etc/exim/exim.conf after this line:
# $Cambridge: exim/exim-src/src/configure.default,v 1.14 2009/10/16 07:46:13 tom Exp $
put this line:
system_filter = /etc/exim/filters
4. In etc/exim/exim.conf replace:
#spamd_address = 127.0.0.1 783
with:
spamd_address = 127.0.0.1 783
5. In etc/exim/exim.conf replace:
# Bypass SpamAssassin checks if the message is too large.
#
#accept condition = ${if >={$message_size}{100000} {1}}
#add_header = X-Spam-Note: SpamAssassin run bypassed due to message size
# Run SpamAssassin, but allow for it to fail or time out. Add a warning message
# and accept the mail if that happens. Add an X-Spam-Flag: header if the SA
# score exceeds the SA system threshold.
#
#warn spam = nobody/defer_ok
#add_header = X-Spam-Flag: YES
#add_header = X-Spam-Subject: [SPAM] $h_Subject
#accept condition = ${if !def:spam_score_int {1}}
#add_header = X-Spam-Note: SpamAssassin invocation failed
# Unconditionally add score and report headers
#
#warn add_header = X-Spam-Score: $spam_score ($spam_bar)n
#X-Spam-Report: $spam_report
with:
# Bypass SpamAssassin checks if the message is too large.
#
# accept condition = ${if >={$message_size}{100000} {1}}
# add_header = X-Spam-Note: SpamAssassin run bypassed due to message size
# Run SpamAssassin, but allow for it to fail or time out. Add a warning message
# and accept the mail if that happens. Add an X-Spam-Flag: header if the SA
# score exceeds the SA system threshold.
#
warn spam = nobody/defer_ok
add_header = X-Spam-Flag: YES
#
accept condition = ${if !def:spam_score_int {1}}
add_header = X-Spam-Note: SpamAssassin invocation failed
#
# Unconditionally add score and report headers
#
warn add_header = X-Spam-Report: $spam_report
6. Check this code exist in /etc/mail/spamassassin/local.cf
# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)
# These should be safe assumptions and allow for simple visual sifting
# without risking lost emails.
required_hits 5
report_safe 0
rewrite_header Subject [SPAM]
required_score 1.3
7. Restart Spamassassin [SSH]:
/etc/init.d/spamassassin restart
8. Restart Exim [SSH]:
service exim restart
rated 35 times
(35)
(0)
comments: 0 / hits: 4686
/ 4 years ago, thu, sep 8, 16, 03:04:22
More From
» Plain Text
Comments
There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account