Results 1 to 1 of 1
Thread: Environment Variables
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Jun 2006
This has me a bit stumped and I thought someone here might know the answer.
I'm sending emails from a php script through qmail but the 'From:' header is being sent as 'anonymous'. I have searched and found this info:
qmail-inject (thus, qmail's sendmail wrapper as well) only looks at the environment to determine the mail sender. It checks the QMAILUSER, MAILUSER, USER and LOGNAME variables in that order until it finds a match. If qmail-inject finds no match, it puts "anonymous" as the sender. Your daemon program however will not have USER and LOGNAME set in the environment, because these are set by the login program -- that is not used by your daemon. qmail-inject does not look at getuid() and getpwuid(), which it should.
Any thoughts on this would be most welcome.