Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

anonymous@domain-name change - how ??

Posted on 2011-09-24
12
Medium Priority
?
450 Views
Last Modified: 2012-06-27
how do I change my linux server return-path email address?

centos is our OS
emails are generated by our php script - example: welcome message goes out when a user join our site

the bounce messages show that the return path is anonymous@domain-name

the from field shows no-reply@domain-name
that is how we set it up,, but we are wondering where the anonymous@domain-name is coming from so that we can adjust it

whatever help will be appreciated.

thank you.
0
Comment
Question by:U_S_A
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 21

Expert Comment

by:Papertrip
ID: 36593145
The Return-Path header is added by the server that is the final hop before delivery to the mailbox.  That header is populated from the address given in the MAIL FROM envelope header.

Change your MAIL FROM header to whatever you want Return-Path to be.

BTW which MTA are you using?
0
 

Author Comment

by:U_S_A
ID: 36593164
MAIL FROM - would that be in the PHP script or somewhere else?

MTA ?    I don't know what that is ...

we have qmail - is that related to MTA ?
0
 
LVL 21

Accepted Solution

by:
Papertrip earned 2000 total points
ID: 36593258
I'm no PHP pro, but I am an email pro, so I did some quick research for ya.  And yes qmail is an MTA.

From http://php.net/manual/en/function.mail.php

additional_parameters (optional)

    The additional_parameters parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.

    The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.
Example #3 Sending mail with an additional command line parameter.

The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path.
<?php
mail('nobody@example.com', 'the subject', 'the message', null,
   '-fwebmaster@example.com');
?>
How the mail function routes to the MTA as set in php.ini:
sendmail_path string

    Where the sendmail program can be found, usually /usr/sbin/sendmail or /usr/lib/sendmail. configure does an honest attempt of locating this one for you and set a default, but if it fails, you can set it here.

    Systems not using sendmail should set this directive to the sendmail wrapper/replacement their mail system offers, if any. For example, » Qmail users can normally set it to /var/qmail/bin/sendmail or /var/qmail/bin/qmail-inject.
From qmail-inject man page:
 -fsender
          Pass sender  to  qmail-queue  as  the  envelope  sender
          address.   This  overrides Return-Path and all environ-
          ment variables.



0
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.

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36593305
The 'From:' and '-f' email addresses may need to be valid email addresses that can be looked up by the receiving server to prevent them from bouncing.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36593508
Hey Dave,

Receiving servers do no such look up :)  It's the sending servers responsibility to properly populate those headers.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36593627
Yes, you have to fill them when sending.  But we have had a lot of questions here about mail servers checking for valid email addresses in received emails.  Email servers do a lot of filtering on received email to minimize spam.  And some SMTP servers on web hosting will not send an email that doesn't have an email address that is valid for that domain.

More info: http://en.wikipedia.org/wiki/Anti-spam_techniques#PTR.2Freverse_DNS_checks
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36593641
I am well-versed in anti-spam techniques and have helped write some RFC's on the matter as well :)

The link you posted only pertains to the domain and IP of the sending server, and has nothing to do with the email address itself being a valid user/mailbox.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36593693
You may have done all those things and I may have overstated my suggestion.  But I stand by it as a generally good idea and it's simpler than trying to explain all the things about email.  Feel free to make a better suggestion.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36593697
My only suggestion is to make sure to fill in the headers properly while constructing the mail :)

Didn't mean to invoke any animosity if that is the case, I only commented on your reply so that the Asker and yourself have all the correct info.  Since I joined EE I have learned a ton from reading other experts answers to questions I had thought I knew the complete answer to.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36593730
In that case, OK, and I have to say that I too learned things here I thought I already knew.  Which is mostly why I'm here.  Answering questions is the best way to learn and 'relearn'.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36593743
Completely agree.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 36593898
Here from left field is a different view on the issue.  

Don't even bother to send your own emails.  

Instead, use a professional service like ConstantContact.com which is in the for-profit business of sending emails on your behalf.  Embarrassingly inexpensive and highly efficient.  If your time is worth anything, you will quickly find that debugging email is a non-value-added activity.  Constant Contact has full-time employees who handle the hard part of email.  This recommendation comes from someone who has sent thousands of emails a week for many years and who has "seen the light" about the difficulty of getting automated email to work and the ease-of-use of Constant Contact.  They will help you comply with the law, avoid spam filters, track who opens and forwards the message, all kinds of things like that.  In my experience it is the right way to go.  There are competitors like MailChimp and others but I have been happy with Constant Contact and so have my clients, who range from tall-steeple churches to multi-billion dollar investment management firms.

HTH, ~Ray
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

670 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