Home · Latest · Trends  /  Plain Text
35

CentOS - SpamAssassin and Exim

rated 35 times [  35] [ 0]  / comments: 0 / hits: 2856  / 3 years ago, thu, sep 8, 2016, 15:04:22
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
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
 
Share
Snippets
Common SSH commands for CSF [ConfigServer]
2 years ago, wed, dec 28, 2016
Simple CSS javascript social share buttons
2 years ago, tue, jan 3, 2017
Basic ClamAV antivirus engine SSH command line commands
2 years ago, thu, jan 19, 2017
How to leverage browser caching with htaccess
2 years ago, sat, jun 10, 2017
CSF / LFD block force attacks on Exim Centos
2 years ago, mon, jun 26, 2017
Basic SSH Exim mail queue commands
2 years ago, sat, sep 2, 2017
1 year ago, tue, feb 27, 2018
1 year ago, wed, feb 28, 2018
Sponsor
Posted
paki

paki

Member since Sep 7, 2016
Total Code Snippets: 10
Total Comments: 0
Location: n/a
Following
User not following anyone yet.