LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sendmail masquerade for apache (https://www.linuxquestions.org/questions/linux-newbie-8/sendmail-masquerade-for-apache-838895/)

anon091 10-18-2010 03:46 PM

sendmail masquerade for apache
 
I have a website running in apache that has a php file that send an email out. The emails are getting rejected because of supposed invalid senders. I had a problem similar to this on another server, and it the user who was sending the mail's home directory, i had to make a file named .muttrc that contained the following two lines to get its emails to be accepted.

set envelope_from=yes
set from="me@correctdomain.com"

but for apache its home directory is /var/www. so do i just make the same file in there, i'm assuming the apache user is the account since that runs apache.

sorry, but i'm not real good with apache or sendmail, so this post may be lacking.

rweaver 10-18-2010 04:21 PM

The mail system and most unix programs don't care where somethings home directory is so long as they know what it is (as far as dot files go). If that doesn't solve it for you, what specific error are you getting and can you supply headers for the message you're having issues with?

bathory 10-18-2010 04:57 PM

Hi,

You can modify the php script to use the -f option (from address) in the sendmail command it uses to send the email. It should start like this:
Code:

sendmail -f sender@somedomain.com ...
Make a backup of the script before changing it.

Regards

anon091 10-19-2010 05:08 AM

Thanks, after putting that file there it now works with using a sender like that.


All times are GMT -5. The time now is 10:57 AM.