Solved

anonymous@domain-name change - how ??

Posted on 2011-09-24
12
444 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
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
 
LVL 82

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 82

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 82

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 82

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 108

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
These days socially coordinated efforts have turned into a critical requirement for enterprises.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

757 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

14 Experts available now in Live!

Get 1:1 Help Now