Hello,

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.
A bit of googlage has informed me that the .cshrc file (located in the account home directory) is used to set environment variables. The .cshrc file is read when a user logs into a shell but I'm trying to set the vars that are read by the daemon that sends emails from a php page. I don't know which .cshrc file I need to edit to add a value for the QMAILUSER variable.

Any thoughts on this would be most welcome.

Thanks

Alex =]