LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 06-09-2011, 07:47 AM   #1
DarkSlayer
Member
 
Registered: Apr 2008
Location: Tbilisi , Georgia
Distribution: Fedora, CentOS
Posts: 65

Rep: Reputation: 19
Question [help] Amavisd-new + Spamassassin


Hello
Please if someone can explain me something regarding isstallation of antispam gateway with amavisd-new and spamassassin.
what i have.
Centos 5.6
postfix 2.3.3-2.2
dovecot 1.2.17-0_115.el5
spamassassin 3.2.5-1.el5
postfixadmin 2.3.3
amavisd-new 2.6.4-4.el5.rf

Postfix + Dovecot are on mysql with TLS

I cant understand if amavisd tottaly replaces Spammassassins configuration with it's own and uses just spamassassin binary?

I want to configure both Spamassassin and Amavis with MySQl as well, if possible.
Can i use Spammassasin mysql schema and config separately and it won't interefere amavisds process. Or amavis mysql scheme is uniq for both spamassassin and amavisq configuration. One of the tools for further mysql usage of this tools would be Maia Mailguard.

Hope it is possible to make advanced configuration of each service foradditional security. like razor pyzor dcc in spamassassin.

Also if someone knows how to put spam emails after filters in users spam folder and to bounce or drop it , or just rewrite subject ?
 
Old 06-09-2011, 01:15 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
Amavisd is often times used a the master filter application that coordinates the anti-virus and anti-spam applications. You can deliver your messages to the port that Amavis listens on and it will perform the various functions, inserting headers as appropriate, and then re-inject mail back into the queue. It is also possible, and depending on your distribution possibly even easy, to incorporate additional tools like pyzor and razor. You can configure Postfix to either discard SPAM in which case it will hold it in a quarantine directory so you don't lose it in case it was HAM, or to pass it on for later filtering. If you pass it, you can have a program like Sieve move it to a SPAM folder automatically based upon header content or your email client can filter on the header tags. I wouldn't suggest bouncing it because that just adds to the problem and almost always misses the target. I am not sure about using SQL configuration for Spamassassin or Amavis, which I haven't done or had need to do. I do use MySQL for hosting the virtual user tables, though.
 
1 members found this post helpful.
Old 06-10-2011, 04:44 AM   #3
DarkSlayer
Member
 
Registered: Apr 2008
Location: Tbilisi , Georgia
Distribution: Fedora, CentOS
Posts: 65

Original Poster
Rep: Reputation: 19
Thanks for your response.
And also thanks to you for telling about Sieve. I'll definitely go with it's configruration.
I wanna use sql for antispam filter for flexible per-user/domain configuration.
Saying "use MySQL for hosting the virtual user tables" you mean using it for general Dovecot and Postfix setup with Postfixadmin ?


Quote:
Originally Posted by Noway2 View Post
Amavisd is often times used a the master filter application that coordinates the anti-virus and anti-spam applications. You can deliver your messages to the port that Amavis listens on and it will perform the various functions, inserting headers as appropriate, and then re-inject mail back into the queue. It is also possible, and depending on your distribution possibly even easy, to incorporate additional tools like pyzor and razor. You can configure Postfix to either discard SPAM in which case it will hold it in a quarantine directory so you don't lose it in case it was HAM, or to pass it on for later filtering. If you pass it, you can have a program like Sieve move it to a SPAM folder automatically based upon header content or your email client can filter on the header tags. I wouldn't suggest bouncing it because that just adds to the problem and almost always misses the target. I am not sure about using SQL configuration for Spamassassin or Amavis, which I haven't done or had need to do. I do use MySQL for hosting the virtual user tables, though.
 
Old 06-10-2011, 05:50 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
Quote:
Saying "use MySQL for hosting the virtual user tables" you mean using it for general Dovecot and Postfix setup with Postfixadmin ?
Exactly. BTW, Postfixadmin is a great tool. Be sure you keep it protected behind a secure interface and require encryption on the page though. If someone were to access it, they could cause a lot of havoc.

If I recall correctly, the sieve program is referred to as CMUSieve. If you Google for that term, you will get lots of hits. It also looks like there is a newer, updated version called Dovecot Sieve. which works with Dovecot 1.2 or later. Here is a link. It looks like it has a lot more features.

Quote:
I wanna use sql for antispam filter for flexible per-user/domain configuration
I understand. If you have multiple users this would be the way to go. Unfortunately, I don't have much advice on how to set this part up, but from I do know of Amavis and Spamassassin, I don't see why it wouldn't work. The Amavis part just acts as the master content filter, sitting in the mail queue. I have it on both incoming and outgoing which will prevent viruses from being transmitted as well as prohibited file types. Once the mail is passed to it, though, it should be able to use the MySQL schema for profiles. Here see this link for an example. Note, you may also need to change the command line that calls Spamassassin.

I just did a little checking in my own Amavisd configuration (Debian Layout) and it has a configuration file for user configuration that calls the following line:
Code:
@lookup_sql_dsn = (
    ['DBI:mysql:database=mymaildb;host=127.0.0.1;port=3306',
     'mymaildb',
     'mymaildb']);

$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';
So apparently it does look in the SQL database, though I didn't know it was doing this. I suspect that if you are using the PostfixAdmin and the virtual users, you could point this to that user/mail database and add a the appropriate table(s).
 
Old 06-10-2011, 08:06 AM   #5
DarkSlayer
Member
 
Registered: Apr 2008
Location: Tbilisi , Georgia
Distribution: Fedora, CentOS
Posts: 65

Original Poster
Rep: Reputation: 19
Unhappy

i have 3 problems for now:
1. postfixadmin mailbox postdeletion script not working. cant get it work.

2. cant compile Sieve for dovecot 1.2
Code:
./configure --with-dovecot=/usr/lib/dovecot/
        
        #OMITED OUTPUT#

dovecot-config not found from /usr/lib/dovecot, use --with-dovecot=PATH
to give path to compiled Dovecot sources or to a directory with the
installed dovecot-config file.
configure: error: dovecot-config not found
--with-dovecot=/etc/ - isn't working as well (dovecont.conf resides there)

3 amavisd-new + spamassassin + MySQL + MAIA Mailguard
i have fu*** headache already with this part. read hundred tutorials....amavisd-needs some patch , maia needs some configuration, all tuttorials showing different things......i'm really frustrated and depressed for now.
http://www.akadia.com/services/postfix_amavisd.html
http://www.maiamailguard.com/maia/wi...rtamavisd-maia
http://www200.pair.com/mecham/spam/rhel5-maia.html
And many many many other links. my brain just rejects whole info ...

TODO: SPF, DCC, RAZOR, PYZOR, Roundcube, SSL protected web pages ...
DONE: postfix + dovecot + TLS for pop3 and imap, postfixadmin, amavisd + ClamD, IMAP folders autocreation for each new user. And sieve should rdirect spam there (...
All packages versions in my very first post.

I dont wanna look at solutions like iRedMail and/or Zimbra. I wanna get all things done by myself without choosing easiest way.
 
  


Reply

Tags
amavisnew, dovecot, mysql, postfix, spamassasin


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
amavisd-new / spamassassin whitelist issue scheidel21 Linux - Server 5 10-19-2009 09:15 AM
does any one know how to add to spam using mail ID in Amavisd-new, SpamAssassin Isangika Linux - Server 1 09-17-2007 03:38 PM
amavisd / clamav, spamassassin problem 70mas Linux - Server 5 07-19-2007 09:42 PM
Do anyone use amavisd with spamassassin? combilli Linux - Software 1 11-13-2006 10:48 PM
Mystery (amavisd-new+spamassassin) stomach Linux - Software 1 02-22-2006 10:03 AM


All times are GMT -5. The time now is 01:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration