Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] getmail and sa-learn in a virtual mail server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 686
Location: Barcelona, Spain

PostPosted: Mon May 24, 2010 10:41 pm    Post subject: [SOLVED] getmail and sa-learn in a virtual mail server Reply with quote

I am trying to use sa-learn with getmail in a virtual mail server. I have managed to get it working with the following configuration:

Code:
[retriever]
type = SimpleIMAPSSLRetriever
server = server
port = 52003
username = username
password = password
mailboxes = ("IN.Spam_Fallat",)

[filter-learn]
type = Filter_classifier
path = /usr/bin/sa-learn
user = root
group = root
arguments = ("--spam","-u","root")
allow_root_commands = true

[destination]
type = MDA_external
path = /usr/libexec/dovecot/deliver
user = mail
group = mail
arguments = ("-d","destination@mail.org","-m","IN.Spam")

[options]
verbose = 0
delete = true
message_log = ~/.getmail/log
read_all = true


I have used these references: getmail documentation, this post and this information from spamassassin.

I have the bayes database in the root of my virtual mail system: /var/spool/mail/.spamassassin/
Code:
# ls /var/spool/mail/.spamassassin/
auto-whitelist  auto-whitelist.mutex  bayes.mutex  bayes_seen  bayes_toks  user_prefs


and in the root user:
Code:
# ls /root/.spamassassin/
auto-whitelist  auto-whitelist.mutex  bayes.mutex  bayes_seen  bayes_toks  user_prefs


If I change the user root by the user mail in the filter section, I get this type of "permission denied" error:
Code:
bayes: locker: safe_lock: cannot create lockfile /root/.spamassassin/bayes.mutex: S’ha denegat el permís


I have found this thread that suggests changing the permissions of bayes.mutex file, but I have been unable to get rid of the error unless I change the user to root. Also, I believe sa-learn should use the .spamassasin folder in /var/spool/mail instead of the one in /root.

Any hints appreciated. Thanks for your attention.

Cheers!

---

Update: the --dbpath option solved the issue. Now I have:

[retriever]
type = SimpleIMAPSSLRetriever
server = server
port = 52003
username = username
password = password
mailboxes = ("IN.Spam_Fallat",)

[destination]
type = MDA_external
path = /usr/bin/sa-learn
user = mail
group = mail
arguments = ("--dbpath","/var/spool/mail/.spamassassin","--spam")

[options]
verbose = 0
delete = true
message_log = ~/.getmail/log
read_all = true

Just writing the message in the forums solves it! :lol:

Wonderful gentoo... :lol: :lol:

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum