Reputation: 1856
How can I pipe emails for a specific user to a script AND that script to be ran with a specific user's login.
I have this in my /etc/postfix/master.cf file:
my_transport unix - n n - 50 pipe
flags=R user=deploy argv=/srv/www/myscript
My script prints $PATH
and whoami
to a file and this is what I get
PATH=/usr/bin:/bin
whoami = deploy
If I run sudo su - deploy
and run echo "PATH=$PATH"
and echo "whoami = $(whoami)"
I get
PATH=/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
whoami = deploy
How do I make postfix run myscript as deploy user but with it's real path, not the short one.
Thank you!
Upvotes: 1
Views: 373