SpamAssassin
-
- Posts: 83
- Joined: Tue Jan 14, 2014 6:43 am
SpamAssassin
Does VestaCP update SpamAssassin or do I need to manually run a script to run sa-update and service spamassassin restart?
It's a pain, but just in case VestaCP does not update SpamAssassin I have manually written a script and set it up in cron. Granted maybe this is overkill, but I am receiving a mass of Russian Spam and I can't even read Russian Cryllic!
It's a pain, but just in case VestaCP does not update SpamAssassin I have manually written a script and set it up in cron. Granted maybe this is overkill, but I am receiving a mass of Russian Spam and I can't even read Russian Cryllic!
-
- Posts: 83
- Joined: Tue Jan 14, 2014 6:43 am
Re: SpamAssassin
Ok so no answer, I'll assume that VestaCP does not update SpamAssassin rules so I guess i'll post my script.
I'm running this off of Debian 7.4 x86_64 (64-bit)
Created a script and placed it in the /etc/spamassassin folder, named the file spamd.cron
spamd.cron
Needed to set the permissions
Added the Cron Entry
I did this all as the root user.
So far I have had considerable less spam, now it's only 2-5 spam emails a day instead of the 15-20+ Russian Cryllic Spam each morning.
I'm running this off of Debian 7.4 x86_64 (64-bit)
Created a script and placed it in the /etc/spamassassin folder, named the file spamd.cron
spamd.cron
Code: Select all
#!/bin/bash
/usr/bin/sa-update
/etc/init.d/spamassassin restart
Code: Select all
chmod 755 spamd.cron
Code: Select all
crontab -e
* 6,18 * * * /etc/spamassassin/spamd.cron >/dev/null 2>&1
So far I have had considerable less spam, now it's only 2-5 spam emails a day instead of the 15-20+ Russian Cryllic Spam each morning.
Re: SpamAssassin
Have you tried SA Bayes? When I run sa-learn --dump magic error occurs. Do you know if SABayes work with Vesta? I don't have time yet to deeply explore how VestaCP works with antispam.
-
- Posts: 83
- Joined: Tue Jan 14, 2014 6:43 am
Re: SpamAssassin
i have tried using the sa-learn function but it also gave me errors so I'm sticking with sa-update. If one of the VestaCP devs would like to chime in I'd be more than willing to list to an alternative option. :DMyKEcz wrote:Have you tried SA Bayes? When I run sa-learn --dump magic error occurs. Do you know if SABayes work with Vesta? I don't have time yet to deeply explore how VestaCP works with antispam.
Re: SpamAssassin
Hi, I've solved the problem with sa-learn by running:
Code: Select all
sa-learn --sync
Re: SpamAssassin
Hi, I installed vestacp on a vps with 2gb of ram, so spam assassin was not installed.
I followed the installation instructions, and everything seems to work well. I followed also the suggestions found on this thread to run the cron.
The first night running the cron job, settled from the administrator cronjob panel, i got this strange email:
the command i run from the cronjob panel is:
sudo /usr/share/spamassassin/spamd.cron
I am facing another issue: even if i move, every day, certain emails to the spam folder, it seems that the same emails continue to come the day after and does not goes to spam, as expected.
Any light to investigate the problem?
Thanks,
Antonio
I followed the installation instructions, and everything seems to work well. I followed also the suggestions found on this thread to run the cron.
The first night running the cron job, settled from the administrator cronjob panel, i got this strange email:
Code: Select all
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
sudo: no tty present and no askpass program specified
sudo /usr/share/spamassassin/spamd.cron
I am facing another issue: even if i move, every day, certain emails to the spam folder, it seems that the same emails continue to come the day after and does not goes to spam, as expected.
Any light to investigate the problem?
Thanks,
Antonio
Re: SpamAssassin
ad1) Run your cron script via root cron table or sudo privileges (sudo crontab -e).colevr wrote:...
sudo: no tty present and no askpass program specified[/code]
the command i run from the cronjob panel is:
sudo /usr/share/spamassassin/spamd.cron
I am facing another issue: even if i move, every day, certain emails to the spam folder, it seems that the same emails continue to come the day after and does not goes to spam, as expected.
Any light to investigate the problem?
Thanks,
Antonio
ad 2) Firstly you must learn spam assasin what is spam and what is ham. This is done by sa-bayes. For example sa-learn --spam /path/to/spam/folder, more here: http://spamassassin.apache.org/full/3.0 ... learn.html
My personal recommendation: If you don't know how spamassasin works, exim/postfix, dovecot, ... it'll be hard for you to configure your server to learn properly mail what is spam and what is ham. Another big problem is vesta's security for production environment. I don't know why but vesta stores root password from mysql into plaintext format and whole security of server when you install vesta is really bad. So keep eye mainly to secure your server and don't use exim it's hell try postfix instead but it requires to reconfigure vesta also..
MyKE
Re: SpamAssassin
Hi MyKe,
and thanks for Your reply.
I believe VestaCP is not secure as many other commercial panels, but we decide to use it in our production environment because is Open Source, and we believe in open source. In any case thanks you for valuable opinion.
Regards spam assassin, i already googled around and found some more info regards sa-learn --spam /path/to/spam/folder, but i was wandering if there is a way to instruct spam assassin to look into any spam folder, because to manually inform spam assassin regards the path of any spam folder created for any account of the panel can be tricky.
I added the command with crontab -e and removed from admin cronjobs, thanks.
and thanks for Your reply.
I believe VestaCP is not secure as many other commercial panels, but we decide to use it in our production environment because is Open Source, and we believe in open source. In any case thanks you for valuable opinion.
Regards spam assassin, i already googled around and found some more info regards sa-learn --spam /path/to/spam/folder, but i was wandering if there is a way to instruct spam assassin to look into any spam folder, because to manually inform spam assassin regards the path of any spam folder created for any account of the panel can be tricky.
I added the command with crontab -e and removed from admin cronjobs, thanks.
Re: SpamAssassin
I can recommed you to check if you have enabled sa-bayes:
here: /etc/mail/spamassassin/local.cf - http://www.akadia.com/services/postfix_ ... assin.html title Configure SpamAssassin
also check bayes storage (you can enable to store bayes to sql instead if internal db but you need to download sql pre-prepaired tables for it.)
Then I recommend you to collect whole mails to one folder and run sa-learn --spam /path/to/spam/folder, it'll store and learn tokens which will be marked for future as spam, also do it with ham (normal messages) you need to learn for a first time both so It won't mark ham message as spam. You must have minimal 100 spam messages for sa-bayes and after some learned spam messages it'll learn automatically - but it'll be slow really slow you must teach it regulary minimal for 500 spam messages (you can check spam and ham status it via sa-learn --dump magic.)
- But it isn't everything. Big antispam fighter are blacklists, use spamhaus, spamcop, etc..
- Next very useful is to use graylisting - big helper for fighting with spam.
- And if you have lot of spam, maybe nolisting method will also help you http://nolisting.org/
- Fighting against spam is endless, so you'll always need to check spam filters, it won't be so easy to make few rules and it's done...
If you can have more servers, I recommend you MailCleaner http://www.mailcleaner.org/ - it's special distribution on debian which is pre-built so you only follow simple dialog and after installation you can jump to web admin and configure your servers...
I hope something help you. I post only simple steps, not whole configuration and step by step tutorials, it's useless because every sys admin must do it himself.
spamassassin --lint -D will test your configuration before commit.
MyKE
here: /etc/mail/spamassassin/local.cf - http://www.akadia.com/services/postfix_ ... assin.html title Configure SpamAssassin
Code: Select all
use_bayes 1
bayes_auto_learn 1
bayes_auto_expire 1
Then I recommend you to collect whole mails to one folder and run sa-learn --spam /path/to/spam/folder, it'll store and learn tokens which will be marked for future as spam, also do it with ham (normal messages) you need to learn for a first time both so It won't mark ham message as spam. You must have minimal 100 spam messages for sa-bayes and after some learned spam messages it'll learn automatically - but it'll be slow really slow you must teach it regulary minimal for 500 spam messages (you can check spam and ham status it via sa-learn --dump magic.)
- But it isn't everything. Big antispam fighter are blacklists, use spamhaus, spamcop, etc..
- Next very useful is to use graylisting - big helper for fighting with spam.
- And if you have lot of spam, maybe nolisting method will also help you http://nolisting.org/
- Fighting against spam is endless, so you'll always need to check spam filters, it won't be so easy to make few rules and it's done...
If you can have more servers, I recommend you MailCleaner http://www.mailcleaner.org/ - it's special distribution on debian which is pre-built so you only follow simple dialog and after installation you can jump to web admin and configure your servers...
I hope something help you. I post only simple steps, not whole configuration and step by step tutorials, it's useless because every sys admin must do it himself.
spamassassin --lint -D will test your configuration before commit.
MyKE
Re: SpamAssassin
Thank You, I will try to address your suggestions.
In any case, this is the VestaCP forum, i hope to receive some more specific hints, related to the panel environment.
Thanks, Antonio
In any case, this is the VestaCP forum, i hope to receive some more specific hints, related to the panel environment.
Thanks, Antonio