Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 27th December 2006, 16:24
eldaria eldaria is offline
Junior Member
 
Join Date: Apr 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Question ISPConfig, IMAP and sa-learn (spamassasin)?

Hi.

I'm using ISPConfig with the Ubuntu setup, and would like to know how I can train the Spamassasin filter since it catches hardly anything at the moment.
I get 400+ Spam mails per day and it is really getting on my nervs.

I use mainly IMAP with Kontakt/Kmail on client side.
This to be able to have server based mail folders to also enable webmail.
On the client side I have sorted spam mail into a sub folder, and would like to train spamassasin with those mails.
So I logged on to the server and go to the Maildir folder, and can only find mail in the 'cur' folder.
But they are not sorted into sub folder but are all in one folder with very odd and sometimes very long names.
Here is a couple of examples:
Hostname part replaced with: host.domain.net
Code:
1151668789.M677224P22358V0000000000000901I004956EF_24686.host.domain.net,S=4051:2,S
1151668790.M461277P22358V0000000000000901I004956F0_24687.host.domain.net,S=171583:2,S
1151668791.M27379P22358V0000000000000901I004956F1_24688.host.domain.net,S=2647:2,S
1151668791.M624679P22358V0000000000000901I004956F2_24689.host.domain.net,S=58465:2,S
1151721688.10140_0.host.domain.net:2,S
1151726046.11192_0.host.domain.net:2,S
1151806634.32189_0.host.domain.net:2,S
1151919905.27647_0.host.domain.net:2,S
1152049909.5819_0.host.domain.net:2,S
How can I use sa-learn on this, when I don't knoa what mail is in what folder on IMAP?

A feature that would be nice that I had on Exchange server, if Spamassasin identifies that a mail is Spam, to move it to a certain folder.
This is not that important but more a convenience.

And is there a way to teach Spamassasin on the server from client side?
So when I click the Spam or Ham button in Kmail it will signal Spamassasin on server side?
Well I guess with some advanced scripting but perhaps there is an easy way.
This is not that important either as long as first question is working.

Regards,
Brian
Reply With Quote
Sponsored Links
  #2  
Old 28th December 2006, 20:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by eldaria
On the client side I have sorted spam mail into a sub folder, and would like to train spamassasin with those mails.
You could upload the mails to the server (e.g. with FTP) and then use sa-learn to train SpamAssassin.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 29th December 2006, 02:23
eldaria eldaria is offline
Junior Member
 
Join Date: Apr 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I guess that would work If I sorted mails to local folders.

Was more thinking if there was a way of the IMAP server detecting if a mail was moved to a certain sub folder, (On the IMAP server).

Well will sort locally for now. :-)
Reply With Quote
  #4  
Old 29th December 2006, 17:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by eldaria
Was more thinking if there was a way of the IMAP server detecting if a mail was moved to a certain sub folder, (On the IMAP server).
You could create a spam folder with your IMAP client and move all spam mails into that folder. And then you use sa-learn to learn from that folder.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 29th December 2006, 17:57
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Will it help to set up a spamtraining mailadress and forward all spam mail to this box and try sa-learn with this?
Reply With Quote
  #6  
Old 30th December 2006, 00:18
eldaria eldaria is offline
Junior Member
 
Join Date: Apr 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
You could create a spam folder with your IMAP client and move all spam mails into that folder. And then you use sa-learn to learn from that folder.
I looked, but when I create folders with the IMAP client, they are not created as a folder on the filesystem on the server.
On the server all mails are still in one folder( ~/Maildir/cur/), but when I log in with a mail client like the Roundcube webmail client, it will see the folders I created and the mails I moved into there.

Quote:
Will it help to set up a spamtraining mailadress and forward all spam mail to this box and try sa-learn with this?
I was thinking about that solution after reading some of the posts here on the forum, the problem with that solution is to mark messages that are not spam but was detected as such.

I folowed falko's first suggestion and created now 2 local folders, since creating a local folder will actually create a folder on the file system. Then when I mark as spam manually, they get sorted to this folder, while mail already detected as being spam are automatically sorted to a different folder. Then if any of those mails are wrongly detected as spam, I have a button where it will move it back to In-box, and create a copy in a 'Ham' Folder.
Now I can copy these files to the server and run sa-learn on them.

I'm also looking into the fact that spamassasin can store info in a SQL database, so was thinking about making client and server use the same database, so a change made on client will be used by Spamassasin on server.
But not sure how to get Spamassasin to use an SQL server yet. ;-)
Reply With Quote
  #7  
Old 30th December 2006, 21:36
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by Ben
Will it help to set up a spamtraining mailadress and forward all spam mail to this box and try sa-learn with this?
The problem with this is that as soon as you forward the mails, their headers get modified, so sa-learn wouldn't learn from the original mails...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 6th January 2007, 03:45
eldaria eldaria is offline
Junior Member
 
Join Date: Apr 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do I need to run sa-learn with a specific user or is the database global?

Like: sa-learn -u web1_user1 --spam <message>

The reason I'm asking is that so far I have been running it without specifying a user, and noticed in the help it says it will then use the default user from runtime environment.

But kind of realized that my mails are arriving on a different user that was set up by isp_config.

/Brian.

Last edited by eldaria; 6th January 2007 at 03:47.
Reply With Quote
  #9  
Old 7th January 2007, 18:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

The database is global, so I'd run sa-learn as root.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 27th March 2007, 18:41
RicochetPeter RicochetPeter is offline
Member
 
Join Date: Apr 2006
Posts: 41
Thanks: 3
Thanked 1 Time in 1 Post
 
Default

Hallo Falko,

das habe ich soeben mal getan, hier meine Kommandozeile:

Code:
root@s2:/var/www/www.[].de/Maildir/.Spam/cur# /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/sa-learn --spam *
Das Verzeichnis, in dem ich gestartet habe, ist ein per IMAP-Client angelegter Folder, in dem eben ganz viele Spam-nachrichten liegen. Was sa-learn getan hat, war, die Dateien
/root/.spamassassin/bayes_seen und
/root/.spamassassin/bayes_toks
zu aktualisieren (bzw zu erstellen, es gab sie vorher noch nicht).

Wird der Spamassassin, der bei Ankunft einer Mail gestartet wird, diese Dateien auswerten?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:33.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.