Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Mail Server
  • Search

SpamAssassin

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
Post Reply
  • Print view
Advanced search
12 posts
  • 1
  • 2
  • Next
nightstryke
Posts: 83
Joined: Tue Jan 14, 2014 6:43 am

SpamAssassin
  • Quote

Post by nightstryke » Thu Apr 03, 2014 5:10 pm

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!
Top

nightstryke
Posts: 83
Joined: Tue Jan 14, 2014 6:43 am

Re: SpamAssassin
  • Quote

Post by nightstryke » Fri Apr 04, 2014 7:19 pm

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

Code: Select all

#!/bin/bash
/usr/bin/sa-update
/etc/init.d/spamassassin restart
Needed to set the permissions

Code: Select all

chmod 755 spamd.cron
Added the Cron Entry

Code: Select all

crontab -e
* 6,18 * * * /etc/spamassassin/spamd.cron >/dev/null 2>&1
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.
Top

MyKEcz
Posts: 18
Joined: Fri Apr 04, 2014 8:30 am

Re: SpamAssassin
  • Quote

Post by MyKEcz » Sat Apr 05, 2014 9:52 am

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.
Top

nightstryke
Posts: 83
Joined: Tue Jan 14, 2014 6:43 am

Re: SpamAssassin
  • Quote

Post by nightstryke » Sat Apr 05, 2014 4:37 pm

MyKEcz 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.
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. :D
Top

ferow2k
Posts: 1
Joined: Mon Aug 04, 2014 4:08 pm

Re: SpamAssassin
  • Quote

Post by ferow2k » Mon Aug 04, 2014 4:10 pm

Hi, I've solved the problem with sa-learn by running:

Code: Select all

sa-learn --sync
Top

colevr
Posts: 8
Joined: Sat Aug 16, 2014 11:48 am

Re: SpamAssassin
  • Quote

Post by colevr » Wed Aug 20, 2014 9:55 pm

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:

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
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
Top

MyKEcz
Posts: 18
Joined: Fri Apr 04, 2014 8:30 am

Re: SpamAssassin
  • Quote

Post by MyKEcz » Thu Aug 21, 2014 6:02 am

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
ad1) Run your cron script via root cron table or sudo privileges (sudo crontab -e).
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
Top

colevr
Posts: 8
Joined: Sat Aug 16, 2014 11:48 am

Re: SpamAssassin
  • Quote

Post by colevr » Thu Aug 21, 2014 7:33 am

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.
Top

MyKEcz
Posts: 18
Joined: Fri Apr 04, 2014 8:30 am

Re: SpamAssassin
  • Quote

Post by MyKEcz » Thu Aug 21, 2014 8:02 am

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

Code: Select all

use_bayes          1
bayes_auto_learn   1
bayes_auto_expire  1
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
Top

colevr
Posts: 8
Joined: Sat Aug 16, 2014 11:48 am

Re: SpamAssassin
  • Quote

Post by colevr » Thu Aug 21, 2014 1:41 pm

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
Top


Post Reply
  • Print view

12 posts
  • 1
  • 2
  • Next

Return to “Mail Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password