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

Posted on 2006-05-20
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

in the script

thank you.
Question by:mtnr
    LVL 54

    Assisted Solution


    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.

    LVL 8

    Accepted Solution

    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

    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!

    Author Comment

    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

    That is correct.

    Author Comment

    thanks for the information.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now