Solved

anonymous@domain-name change - how ??

Posted on 2011-09-24
12
448 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 500 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 83

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 83

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 83

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 83

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 110

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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unbreakable Oracle Linux 6.8 installation problem 9 64
only one sender can reach email inbox 4 40
Php variable to be sent back 3 34
Private Email Server 5 38
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

738 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