On Fri, 2009-05-15 at 11:57 +1200, Lists wrote:
> Karsten Bräckelmann wrote:
> > On Fri, 2009-05-15 at 11:09 +1200, Kate Kleinschafer wrote:
> >
> >>> I'm trying to run sudo -u postfix spamassassin -D -p
> >>> /etc/MailScanner/spam.assassin.prefs.conf -t < MESSAGE.MAI and I would
> >
> > That does not switch the environment. Try something like this...
> >
> > sudo -u postfix env | grep ^USER
> > sudo -u postfix env | grep ^HOME
>
> This gives USER=postfix and HOME=/root
I know. :) That was meant for your enlightenment...
> >> Do you know how I can tell which user is running?
> >> i.e. I have a line
> >> [8357] dbg: config: mkdir /root/.spamassassin failed: mkdir
> > ^^^^^
> > Sic. That's not the postfix user's HOME nor env.
>
> sorry for my ignorance but what does env mean?
Environment.
> also if its not ~/root/.spamassassin folder what folder is it?
Ahem. It should be your postfix user's HOME. Or whatever HOME is set for
the SA scanning process.
> >> /root/.spamassassin: Permission denied at
> >> /usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin.pm line 1577
> >>
> >> The permissions on the folder are drw-rw-rw- root:root
Not like that for /root, though. The postfix user does not have write
permissions in root's home. And rightly so...
--
char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}