You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by LuKreme <kr...@kreme.com> on 2009/03/09 23:40:16 UTC

Possibly OT sudo sa-learn question

I've been trying to get sa-learn to run as the user from a shell  
script, because when I try to run sa-learn -u <user> I get a core  
dump, and I haven't been able to fix that.  I thought I could do this  
a sudo, but got only this far:


  # sudo -u vpopmail -c -  sa-learn --spam /usr/local/virtual/ 
backup/.SPAM/{cur,new}
config: path "/home/myadmin/.spamassassin/user_prefs" is inaccessible:  
Permission denied
bayes: expire_old_tokens: locker: safe_lock: cannot create lockfile / 
home/myadmin/.spamassassin/bayes.mutex: Permission denied

archive-iterator: unable to open /usr/local/virtual/backup/.SPAM/new/ 
1236064280.96349_0.mail.covisp.net: Permission denied
archive-iterator: unable to open /usr/local/virtual/backup/.SPAM/new/ 
1236064626.96537_0.mail.covisp.net: Permission denied
archive-iterator: unable to open /usr/local/virtual/backup/.SPAM/new/ 
1236065142.96797_0.mail.covisp.net: Permission denied
Learned tokens from 0 message(s) (1 message(s) examined)
bayes: locker: safe_lock: cannot create lockfile /home/ 
myadmin/.spamassassin/bayes.mutex: Permission denied

and

  # sudo -u vpopmail -s sa-learn --spam /usr/local/virtual/ 
backup/.SPAM/{cur,new}
usr/local/bin/sa-learn: line 19: use: command not found
/usr/local/bin/sa-learn: line 20: use: command not found
/usr/local/bin/sa-learn: line 22: use: command not found
/usr/local/bin/sa-learn: line 23: use: command not found
/usr/local/bin/sa-learn: line 24: use: command not found
/usr/local/bin/sa-learn: sa-learn: line 26: syntax error near  
unexpected token `('
/usr/local/bin/sa-learn: sa-learn: line 26: `use vars qw('

But, if I su manually and run the exact same command....

  # su vpopmail
[vpopmail@mail ~]$ sa-learn --spam /usr/local/virtual/backup/.SPAM/ 
{cur,new}
Learned tokens from 19 message(s) (21 message(s) examined)
[vpopmail@mail ~]$

-- 
Oh and I could be a genius if I just put my mind to it And I, I
	could do anything if only I could get 'round to it.