[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

anonymous@domain-name change - how ??

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
U_S_A
Asked:
U_S_A
1 Solution
 
PapertripCommented:
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
 
U_S_AAuthor Commented:
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
 
PapertripCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Dave BaldwinFixer of ProblemsCommented:
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
 
PapertripCommented:
Hey Dave,

Receiving servers do no such look up :)  It's the sending servers responsibility to properly populate those headers.
0
 
Dave BaldwinFixer of ProblemsCommented:
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
 
PapertripCommented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
PapertripCommented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
PapertripCommented:
Completely agree.
0
 
Ray PaseurCommented:
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

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now