Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


sendmail reveals webhost and servername (using mail() in php) -- anyway to fix?

Posted on 2006-05-20
Medium Priority
Last Modified: 2008-01-09
php 4.4.2 mail() working fine BUT
if you look at full headers in the email
you can see name of webhost AND the name of server the site is hosted on.
(in Return-path, Received: from, and Message-Id)

any way to fix?
(I am not a spammer. just dont want to reveal any more info than necessary.)

phpinfo says:
sendmail_from      no value      no value
sendmail_path      /usr/sbin/sendmail -t -i      /usr/sbin/sendmail -t -i

the following did NOT work:
in htaccess
php_value sendmail_from me@mine.com

in the script

thank you.
Question by:mtnr
LVL 54

Assisted Solution

b0lsc0tt earned 600 total points
ID: 16726872

There is nothing to fix.  That information is added to the email's header for the purpose of tracking the message, etc.  The servers that forward the message are also added to the header, including the server of the person receiving the message.  It is necessary and will help those receiving your messages and the programs they use realize your message is valid and not SPAM, etc.  Even if you found a way to remove or change the information I would recommend against it.  You would definitely not want to be confused for a spammer and blacklisted.

Let me know if you have any questions about the information above.


Accepted Solution

BOTA-X earned 1000 total points
ID: 16727926
Theres always other ways.  You could use PHPMailer to SMTP to a server that does not reveal the host (or even IP) information of the sending computer.  This would then only expose the information about the SMTP server.

Depending on your resources this may be practical.
LVL 29

Assisted Solution

fibo earned 400 total points
ID: 16728772
If you are not a spammer, you certainly do not want to be confused with one.
So listen to b0lsc0tt' advice, and dot event think about sending mails without these informations.

Now, if you want to hide your default smtp server's name... use another SMTP server!
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 16786950
when I get email from some companies, full headers doesn't mention their webhost company.
it says "received from" that same company.
I guess this means they have their own servers, and don't use a webhost?
LVL 54

Expert Comment

ID: 16787120
That is correct.

Author Comment

ID: 16788295
thanks for the information.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question