I am using spamassassin in a php script, but when I train spamassassin as my user the php script's exec command to call spamassassin get the untrained version because of the user specific nature of sa-learn. So I need to sudo to my user in the exec command and get the environment of my user along with the premissions
Asked
Active
Viewed 720 times
2 Answers
1
sudo -u <username> <command> ...
![](../../users/profiles/7536.webp)
eduffy
- 35,646
- 11
- 90
- 90
-
Tried that uses the prefence files of the users calling sudo not the user in sudo – kman99 Jul 15 '09 at 17:05
0
sudo -H -u <username> <command>
The -H flag sets the $HOME
environment variable. Without setting this flag, SpamAssassin is probably looking in the old user's homedir for settings.
![](../../users/profiles/72.webp)
pix0r
- 30,601
- 18
- 82
- 102