2014-06-12

Nowadays it is big challenge for the server system administrator and end client user to protect and prevent the spam. Current spam protection tool like Spamassassin,Razor,Pyzor,Dcc,clamvscan etc, are not enough to protect and prevent the spam, virus etc as well as it does consume more server resources while processing large amount of email request. Current anti-spam and anti email virus tools does work after the MTA so if we will strict the spam protection rules ro reduce the amout of spam receive then it does start to reject the legitimate and valid email.

We came across different spam protection tools and anti spam proxy and found best open source, Perl based , platform-independent transparent SMTP proxy server ie. Anti-Spam SMTP proxy(ASSP). It has leverages numerous methodologies, technologies, plugins to both rigidly and adaptively identify e-mail spam, email virus.

The ASSP is platform-independent so it does works on the Linux as well as Windows platform. It does only require the perl and required depend perl modules. ASSP does work as Proxy to your current emailing software like Exim, Qmail, Smarter mail etc and stop the spam at SMTP level before it comes to the system that help to reduce the system overhead and processing power. The ASSP does works on the 25 port and forwarded filtered, scanned legitimate mail traffic to backend mail server like exim,qmail which does run on other alternative port say like 2525 so every incoming email does scan though ASSP checklist then forward to the backend mail server.

ASSP's features are:

Multiple Weighted DNSBLs

Multiple Weighted URIBLs

Greylisting

Weighted Regular Expression Filtering

Bayesian

Penalty Box

SenderBase

SSL/TLS

SPF/SRS

Attachment Blocking

ClamAV and FileScan

Blocking Reporting

LDAP support

Backscatter Detection

V2 - recipient replacement / GUI user access rights management

V2 - MIME charset conversion / DKIM check and signing

V2 - DB support for all hashes / level based open plugin support

V2 - transparent proxy support / BATV check and signing

V2 - Plugins: archive, full attachment check and replacement, OCR

V2 - damping (steal spammers time)

V2 - AUTH to relay host / POP3 collector

V2 - configuration value and file synchronization

V2 - Block Reports design could be customized

V2 - Razor2 and DCC support via Plugin

V2 - SNMP support (monitoring, configuring, controll-API)

V2 - user group import (file or LDAP or command based)

V2 - automatic crash analyzer Hidden Markov Model

V2 - IPv6 socket support

V2 - word stemming (several languages) for Bayesian analyzer

V2 - Perl module autoupdate via PPM or CPAN

V2 - Hidden Markov Model spam detection engine

V2 - full unicode support

V2 - DMARC support

V2 - privat Whitelist (legacy, domain based, user based)

V2 - privat IP and Domain lists (legacy, domain based, user based)

V2 - CPU affinity settings

V2 - web file commander

V2 - graphical statistic output (SVG)

V2 - native SSL support for target hosts

V2 - client SSL-certificate validation

This how-to document guides you though Anti-Spam SMTP proxy installation on the Linux cPanel server in the simplest way and with minimum resources. It does defiantly help you to protect the email spam, email virus, email attack that would consume more server resources.

ASSP can install on the separate virtual machine server but on cPanel hosting server we can install it on the same server.

A) Software Requirement

Perl Version 5.10.0 or higher is needed.

List of the perl modules to be installed :

Quote:

Text::Glob

Number::Compare

Compress::Zlib/2.008

Convert::TNEF/0.17

Digest::MD5/2.36

Digest::SHA1/2.11

Email::MIME::Modifier/1.442

Email::Send/2.192

Email::Valid/0.176

File::ReadBackwards/1.04

File::Scan::ClamAV/1.8

LWP::Simple/1.41

MIME::Types/1.23

Mail::DKIM::Verifier/0.30_1

Mail::SPF/2.005

Mail::SPF::Query/1.999001

Mail::SRS/0.31

Net::CIDR::Lite/0.20

Net::DNS/0.61

Net::IP::Match::Regexp/1.00

Net::LDAP/0.33

Net::SMTP/2.31

Net::SenderBase/1.01

Net::Syslog/0.03

PerlIO::scalar/0.05

threads/1.74

threads::shared/1.32

Thread::Queue/2.11

Thread::State/0.09

Tie::DBI/1.02

Time::HiRes/1.9707

Schedule::Cron/0.97

Sys::MemInfo/0.91

IO::Socket::SSL/1.22

BerkeleyDB/0.31

Crypt::CBC/2.30

Crypt::OpenSSL::AES/0.02

If any of the following DB's should be used, install the DBD driver module

Quote:

DBD::mysql::informationschema

DBD::mysqlPP/0.04

DBD::mysql/4.005

If you want any of the plugins, install the following modules:

Quote:

YAML

File::Find::Rule/0.30

File::Slurp

File::Which/0.05

LEOCHARRE::DEBUG

File::chmod

Linux::usermod

LEOCHARRE::CLI

Crypt::RC4/2.02

Text::PDF/0.29

Smart::Comments

CAM::PDF/1.21

PDF::API2/0.69

Image::Magick/6.4.1

PDF::Burst/1.10

PDF::GetImages/1.10

Image::OCR::Tesseract/1.10

PDF::OCR/1.09

PDF::OCR2/1.20

LEOCHARRE::DEBUG/1.14

B) Installation

Install the perl module using cpan or cpanel perl module installation script

Quote:

#perl -e “PDF::OCR2/1.20”

Or

Quote:

#/script/perlinstaller PDF::OCR2/1.20

Download the ASSP source from Anti-Spam SMTP Proxy Server | Free Communications software downloads at SourceForge.net URL

Exact the source file

Copy the ASSP_2.4.1_14153_install\assp folder into /usr/local/assp folder

Run the assp.pl master script with following command

Quote:

perl assp.pl

Once it successfully started without any error you can browse assp web-based GUI to to

Quote:

http://<SERVERIP>:55555/ URL

user: root

Password: nospam4me

Then go to

Section: Server Setup

Change the options and click "Apply Changes" (and restart)

Setup the ASSP init script

edit file /etc/init.d/assp

then paste following content

Quote:

#!/bin/sh -e

# Start or stop ASSP

PATH=/bin:/usr/bin:/sbin:/usr/sbin

case "$1" in

start)

echo -n "Starting the Anti-Spam SMTP Proxy"

cd /usr/local/assp

/usr/local/aspperl/bin/perl assp.pl 2>&1 > /dev/null &

;;

stop)

echo -n "Stopping the Anti-Spam SMTP Proxy"

kill -9 `ps ax | grep "perl assp.pl" | grep -v grep | awk '{ print $1 }'`

;;

restart)

$0 stop || true

$0 start

;;

*)

echo "Usage: /etc/init.d/assp {start|stop|restart}"

exit 1

;;

esac

exit 0

EOF

C) Basic Conf iguration

Change the ASSP SMTP port to 25 and proxy backend port to new exim daemon port 225

Quote:

Login into ASSP web-based GUI then go to Network Setup

Set the SMTP Listen Port (listenPort) port to 25 and

SMTP Destination (smtpDestination) port to 225



[QUOTE]

2. Change the exim daemon port from 25 to 225

Quote:

Login into whm>> Service configuration >> Exim configuration editor >> Advanced editor

Search the daemon_smtp_ports and change

Port 25 to 225



3. Configure the Clamv socket path

Quote:

Open /etc/clamd.conf clamv configuration file then search LocalSocket and find the clamv socket path after that Login in ASSP GUI go to ClamAV and FileScan section then Port or file socket for ClamAV and set "/var/clamd" path there.



4. Make cpanel domain files symblink link to assp authorized domain file

Quote:

#ln –s /usr/local/assp/files/localdomains.txt /etc/localdomains

5. Edit Mailmain configuration file and

Quote:

Change the "SMTPPORT = 0" to "SMTPPORT = 125" in mailman configuration file /usr/local/cpanel/3rdparty/mailman/Mailman/Defaults.py

6. Restart the Exim service

Quote:

/etc/initd.d/exim restart

7. Restart the Exim service

Quote:

/etc/initd.d/assp restart

NOTE: I'll post the advanced configuration setting in the other post.
D) Logs and Troubleshooting

ASSP Log file : /usr/loca/assp/log/maillog.txt

Exim Log File : /var/log/exim_maillog

E) Common Error

530 Relaying not allowed

Reason : This error is indicate that mail server is not allowed to send an email without SMTP authentication

Solution :
1. Outlook 2000

Quote:

Go to Tools > Services (or Tools > Accounts, if Services is not listed).

Select your Internet E-Mail Account and press “Properties.”

Go to the “Servers” tab, and check “My server requires authentication”

under Outgoing Mail Server. Press “Settings,” select “Use same settings as my incoming mail server,”

then press “OK” three times to save the changes & return to Outlook.

2. Outlook 2002 & 2003

Quote:

Go to Tools > E-Mail Accounts. Select “View or change existing e-mail accounts” and

press “Next.” Select your Intermedia.NET POP/SMTP account and press “Change.”

Press “More Settings.” Go to the “Outgoing Server” tab, and

check “My outgoing server (SMTP) requires authentication.”

Select “Use same settings as my incoming mail server” and press “OK.”

Press “Next,” then press “Finish” to confirm your changes and return to Outlook.

3. Outlook Express

Quote:

Go to Tools > Accounts. Select the “Mail” tab. Select your Intermedia.NET account and press “Properties.”

Go to the “Servers” tab, and check “My server requires authentication” under Outgoing Mail Server.

Press “Settings,” select “Use same settings as my incoming mail server,”

then press “OK” twice times to save the changes, then press “Close” to return to Outlook Express.

If you would like to install it on your cpanel dedicated, vm server please send an email to our support department we will install that for you.

Show more