Help - Search - Members - Calendar
Full Version: HOW-TO: Easy Mailscanner + Clam Antivirus + SpamAssassin
The Planet Forums > System Administration > DNS Hosting
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
gpan
We have put together the following package which will install Mailscanner, Clam Antivirus and SpamAssassin on your Ensim 3.1, or Ensim Pro 3.5 server.

This package installs:
Mailscanner 4.22
Clam Antivirus 0.60
SpamAssassin 2.55


We have tested it on upgrades from 4.11 + Mailscanner versions without issues. If you have an older Mailscanner install, we would recommend uninstalling it first and deleting the /etc/MailScanner folder before running this package.

This package does not use f-prot as you need a commercial license for use in a business environment.

Installation:

1) Make sure you are su root (or -)

2) Download the appropriate installer to a folder on your server, then install it

Ensim Pro 3.5.x

wget http://download.cheetaweb.com/mailscanner-...it-3.5.0.tar.gz
tar -zxvf mailscanner-kit-3.5.0.tar.gz
cd mailscanner-kit-3.5.0
./mailscanner-clamav-spamassassin-3.5.0.sh

Ensim 3.1.x
wget http://download.cheetaweb.com/mailscanner-...t-0.2.72.tar.gz
tar -zxvf mailscanner-kit-0.2.72.tar.gz
cd mailscanner-kit-0.2
./mailscanner-ensim-0.2.sh

3) You will need to configure MailScanner as described

service sendmail stop
chkconfig --del sendmail
chkconfig --level 2345 MailScanner on
service MailScanner start

*NOTE 1* For Ensim 3.1 installs, this package requires that you be running a perl 5.6.0 environment.

*NOTE 2 * If your /home partition is mounted separately from /, you will need to change the the Incoming Queue to the following after installation, or Mailscanner will not run:

Incoming Queue Dir = /var/spool/mqueue.in

You will also need to edit /etc/cron.d/mqueuecron to run more frequently, i.e.

*/10 * * * * root /usr/lib/opcenter/virtualhosting/MailQueueCleaner

*NOTE 3* SpamAssassin is configured to only tag emails by default. You will need to reconfigure the delivery preferences in MailScanner.conf if you wish it to delete, bounce or otherwise remove the messages that have been tagged as spam.
foggy
Easy as pie and seems to be working fantastic. Thanks for the howto icon_smile.gif
bradyb
is there a frontend to spamassasin? Does it grab filters from the another site like clam does daily? I like to fight spam I just dont want something overly complicated.
gpan
http://www.spamassassin.org
h4u
receive the following error, but the module *is* installed.... or so we thought :S

Updating mailscanner
error: failed dependencies:
perl-Convert-TNEF is needed by mailscanner-4.14-7.ct
gpan
cd tnef-1.1.2 then

rpm -Uvh perl-Convert-TNEF-0.17-1.noarch.rpm

That will install it.

Also you will need to cd into the mailscanner-4.14 folder and rpm -Uvh

Are you on older mailscanner?..or how did you have tnef installed?
h4u
many thanks!

yes, have been using MailScanner for ages, but with f-prot (oops!)
Legin
Grrrr....

I'm still getting emails not sending....

I think I've treid all the fixes for it now too.

Damn ensim
gpan
Describe what you mean by emails not sending?

Have you tried restarting mailscanner
/etc/init.d/MailScanner restart

Do you see any errors when you tail /var/log/messages
Legin
Ahh don't worry Gpan

I jumped the gun again.. It just took 10 minutes to send them.

Thanks... excellent job yet again.....
Legin
Is there a way to speed it up a little? So that it sends every minute or somthing?
Legin
Maybe its not working properly afterall ...

After more tests since earierl I've got about 3 emails streching back about 45 minutes that still have not been sent.

Incomming emails arrive almost instantly

Just get a tail and get the following for the last 3 lines

Mar 28 22:21:54 srv01 last message repeated 2 times
Mar 28 22:24:22 srv01 kernel: VFS: Inserting already present quota entry (block 14).
Mar 28 22:24:22 srv01 kernel: VFS: Error -5 occured while creating quota.
gpan
You may need to edit the /etc/cron.d/mqueuecron file to look like the following:

MAILTO=
SHELL=/bin/sh
*/5 * * * * root /usr/lib/opcenter/virtualhosting/MailQueueCleaner


For the quota error, its unrelated. You need to

quotaoff -aug
quotacheck -augmn
quotaon -aug
Gucci
anyone can tell me how to uninstall or remove f-prot ? coz now i want to install this pack with clamAV icon_smile.gif
Merci icon_smile.gif
gpan
rpm -e fp-linux-sb

(for recent f-prot)
Legin
gpan

Your a genius.... Thanks

Am I correct in thinking that if I changed

*/5 * * * * root /usr/lib/opcenter/virtualhosting/MailQueueCleaner
to
*/1 * * * * root /usr/lib/opcenter/virtualhosting/MailQueueCleaner

it would send it every minute?
sushil2000
Easy install and seems to be working fine !!
EgoH
yes
Gucci
Thanks Gpan ! icon_smile.gif
It works good and very easy to install. thats good for newbie like me. But i have 2 question to ask you :

The fist one : do i need to redo the mailcopy.pl that i did when i installed mailscanner +f-prot ?

The second one : i got this error message when i tried to send some emails :

objet 'test', Account_: 'mail.mydomain.com', Server_: 'mail.mydomain.com', Protocole : SMTP, Réponse du serveur : '550 5.7.1 ... Relaying denied', Port : 25, Sécurisé (SSL) : Non, Erreur de serveur : 550, Numéro d'erreur : 0x800CCC79

How can i correct this error plz ?
Gucci
Heh, i was stupid icon_smile.gif for avoiding this error, simply enabled "my server requires an authentification" in the account configuration of Outlook icon_smile.gif
Thanks for all above all this Great How to icon_smile.gif
critical
Updating mailscanner
error: failed dependencies:
perl-Convert-TNEF is needed by mailscanner-4.14-7.ct
piper
if the email contain virus (incoming) was detected, would it still be deliver to mailbox? or it will be block?

I juz use http://www.declude.com/tools/mailsend.html to send myself a fake virus and it got through icon_razz.gif

is there a way to block virus contained email and not deliver it to mailbox?

thx
critical
after installing it i don't seems to be able to get any email in but i can send email out

i was using mailscanner + fprot.. what should i do now?
gpan
1) Are you on perl 5.6.0 (this is a presumption, since 5.6.1 is not supported in ensim 3.1.x)

2) Check /var/log/maillog. Anything peculiar in there?

3) Try restarting spamassassin - /etc/init.d/spamassassin restart

4) Try restarting mailscanner, /etc/init.d/MailScanner restart

5) You need to check your MailScanner.conf file to make sure that the right virus scanner is being referenced. Try turning off spamasassin also in there, restart and see if mail delivers.
critical
i changed mailscanner = clamav from f-prot .. still don;t seems to get mail coming into my server.. any idea why? could it be because i am using older version of mailscanner? how to check which version i am using ..where to disable spamassasin?
critical
or probably u could teach me how to uninstall this thing that i just installed and the old mailscanner ..and so i can install this thing fresh
gpan
In mailscanner.conf you have a line:

Use SpamAssassin = yes

You can change this to 'no' and restart mailscanner, I ran into this on one box with perl 5.6.1 (yes we all know people shouldn't update their perl installs) and non-delivering mail.

To uninstall older mailscanner/fprot you will need to

rpm -e mailscanner
rpm -e fp-linux-sb

Some of you are on very old versions of f-prot and the package name is different. Use rpm -qa and locate your f-prot package if that is the case.

The package will reinstall all other pieces as needed.
daveman692
gpan, what are the exact steps you would use on a server already running MailScanner + f-prot + SpamAssassin? What should be removed before upgrading to your package?
gpan
For the most part I'd remove the old mailscanner install if it is not recent (4.11, 4.12 are fine) due to the config file change. You might also want to remove the /etc/MailScanner folder if you have issues.

For older installs (Mailscanner 4.0 and 3.x) I'd uninstall it and remove the /etc/MailScanner directory also.

You can uninstall fp-linux-sb if you feel that you're using it commercially and don't have a license icon_wink.gif. The package only uses clam, but you can switch out to any other virus scanner you wish to use.
critical
[root@box1 root]# rpm -e Mailscanner
error: package Mailscanner is not installed
any idea how to uninstall mailscanner?
gpan
rpm -e mailscanner

(The SNG folk seem to love to confuse people with mixed cases)
critical
ok i rpm -e mailscanner and rpm -e fprot already

and i bash the file that you posted here again

the email is still not coming in..but i can send out email
gpan
Disable spamassassin in Mailscanner; also does spamassassin restart (as noted in prior post)

(restart Mailscanner of course)
critical
done it.. but still the same.. not getting the mails.. but i can send mails out
daveman692
As always this was painless and works great!
critical
all the email i send to my server seems to be stuck somewhere.. i cannot get it.. and when i am sending it i get no error
gdmg
Is it safe to get rid of mailcopy in cron.d? or did your install put it back in?
jeffro
Gpan,

You're like the best friend to an Ensim admin there ever was! Works friggn perfect! Superior.

Question: What would be the best way to start and stop Mailscanner while maintaining mail flow? Is this possible?

I'm using Webmin with the MailScanner module. VERY NICE for config work on MailScanner. Once the configs are modified one would need to 'reload' Mailscanner. I'm assuming that a ' /sbin/service/MailScanner restart ' would do the trick, but I've not read through your startup script fully.
gpan
service MailScanner restart will work

Critical: what happens when you /etc/init.d/spamassassin restart . Also I sent you an email.
critical
[root@box1 root]# /etc/init.d/spamassassin restart
Shutting down spamd: [ OK ]
Starting spamd: [ OK ]

[root@box1 root]# service MailScanner restart
Shutting down MailScanner daemons:
MailScanner: [ OK ]
incoming sendmail: [ OK ]
outgoing sendmail: [ OK ]
Starting MailScanner daemons:
incoming sendmail: [ OK ]
outgoing sendmail: [ OK ]
MailScanner: [ OK ]

still not receiving mail
gpan
I really have to look at the install to tell you what is wrong..
critical
Thanks a lot gpan!! problem fixed!! read the new howto
madsere
Isn't Clam Antivirus the only real change from MailScanner 4.13-3 / F-Prot / Spamassassin 2.52 on Ensim 3.1.x?

How do Clam compare to F-prot? dis/advantages?
gpan
Its GPL.. f-prot isn't. .. That is the big difference.

f-prot being commercial, gets more updates; but clam scans all files that are uploaded; so you get a bit more coverage.
aussie
QUOTE
Originally posted by gpan
[B]If you have upgraded your perl install, spamassassin will not work correctly.


Thats strange, Spamassassin works flawlessly with Perl 5.6.1!
gpan
Yes it works fine; but RPM's are bound to a perl-version (which is why 5.6.1 breaks mod_perl also on ensim 3.1 when you upgrade it)
madsere
I've noticed on all servers where I have installed MS/SA/FP the system CPU/loadavg goes sky high for about a week, then falls back to near-normal values. Anyone else notice this? Anyone ready to wager a guess as to why?
gpan
It probably has to do with catching up with misplaced emails in queue perhaps.
Legin
I've noticed that since I installed this last night that my processor usage has gone from almost nothing to an average of about 30% and memory usage has doubled.

Although I am running it every minute so I imagine its that
joseph
oh god. i think my server is perl5.6.1 . How to i go about solve this problem, gpan ?

i got :

[root@root mailscanner-kit-0.1]# /etc/init.d/spamassassin restart
Shutting down spamd: [FAILED]
Starting spamd: Can't locate Mail/SpamAssassin.pm in @INC (@INC contains: ../lib /var/tmp/root-spamassassin-2.52/usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at /usr/bin/spamd line 24.
BEGIN failed--compilation aborted at /usr/bin/spamd line 24.
[FAILED]
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.