How can I find out as what user a command executes? (I'm running Ubuntu, but I suspect the answer applies to Unix in general).
What I'm trying to do is get msmtp running and logging to /var/log/msmtp. I've set the owner and group of that file to mail, then added my user to the mail group via sudo adduser dandv mail:
$ ls -al /var/log/msmtp.log
-rw-rw---- 1 mail mail 0 Jul 24 18:45 /var/log/msmtp.log
$ groups dandv
dandv : dandv mail sudo
Yet when when I run
cat testmail | msmtp [email protected] -v
I get a permission denied:
msmtp: cannot log to /var/log/msmtp.log: cannot open: Permission denied
What is msmtp's problem?