Replacing header information

Replacing header information

Posted by: dhost
Posted on: 2009-07-29 21:27:00

We are using an automated emailing system to send messages our newsletters / announcements on the forums. Our MX settings are configured on Google Apps. Hence the SMTP points to Gmail server.
Now, if we do not configure this and instead opt for the PHP Mail Function, or Sendmail, the emails received get the "mailed-by willie.dreamhost.com" displayed. Is there any possibility to replace this name? What do I need to do to change the header information?

Re: Replacing header information

Posted by: Atropos7
Posted on: 2009-07-29 22:55:00

In reply to:

Now, if we do not configure this and instead opt for the PHP Mail Function, or Sendmail, the emails received get the "mailed-by willie.dreamhost.com" displayed. Is there any possibility to replace this name? What do I need to do to change the header information?


First, determine or setup a special email address you want mail delivery failures/bounce messages to be sent back to. For example perhaps postmaster@example.com - make sure it is an address on your account.

Then pass "-fpostmaster@example.com" as the $additional_parameters argument to the mail() function. This will then have Postfix use that address for the envelope sender.

Also make sure you understand the sending restrictions: http://wiki.dreamhost.com/SMTP_quota

Customer since 2000 cool openvein.org

Re: Replacing header information

Posted by: dhost
Posted on: 2009-07-30 06:17:00

I am using Joomla and not really sure where do I need to edit that. Please help.

Re: Replacing header information

Posted by: Atropos7
Posted on: 2009-07-30 07:09:00

Try sepcifying the Sendmail Path as "/usr/sbin/sendmail -fpostmaster@example.com" then.

Customer since 2000 cool openvein.org

Re: Replacing header information

Posted by: dhost
Posted on: 2009-09-01 05:02:00

This really resolved for Joomla.

Now, I have some emails to be sent through the PHP List and that displays as follows:-

mailed-by yourdomain.dreamhost.com

What do I need to do in the PHP List? Any help?

Re: Replacing header information

Posted by: dhost
Posted on: 2009-09-05 16:32:00

Any help here possible?
Those who would have configured PHP List?

Re: Replacing header information

Posted by: Atropos7
Posted on: 2009-09-05 20:46:00

In reply to:

Any help here possible?
Those who would have configured PHP List?Mirror this site:


Update the config.php file

   61 # Message envelope. This is the email that system messages come from
62 # it is useful to make this one where you can process the bounces on
63 # you will probably get a X-Authentication-Warning in your message
64 # when using this with sendmail
65 # NOTE: this is *very* different from the From: line in a message
66 # to use this feature, uncomment the following line, and change the email address
67 # to some existing account on your system
68 # requires PHP version > "4.0.5" and "4.3.1+" without safe_mode
69 # $message_envelope = 'listbounces@yourdomain';

Because later on in the sendMail() function:

  292     if ($this->message_envelope) {
293 $header = rtrim($header);
294 if ($header)
295 $header .= "\n";
296 $header .= "Errors-To: ".$this->message_envelope;
297 if (!$parameters || !ereg("-f".$this->message_envelope)) {
298 $parameters = '-f'.$this->message_envelope;
299 }
300 }

So if $message_envelope is set to 'postmaster@example.com' then $parameters is set to '-fpostmaster@example.com' and gets passed to mail() ... sound familiar?


Customer since 2000 cool openvein.org

Re: Replacing header information

Posted by: dhost
Posted on: 2009-09-14 04:25:00

Updated the following in config.php
69 # $message_envelope = 'emailid@domainname.com';

But did not get really where the sendMail() function is in which file.

And does that mean I need to update the:

297 if (!$parameters || !ereg("-f".$this->message_envelope)) {
298 $parameters = '-f'.$this->message_envelope;



Re: Replacing header information

Posted by: dhost
Posted on: 2009-09-16 21:57:00

Please let me know if any further clarification is required on this.

Re: Replacing header information

Posted by: Atropos7
Posted on: 2009-09-17 06:27:00

In reply to:

Updated the following in config.php
69 # $message_envelope = 'emailid@domainname.com';


Did you uncomment that line? You have to remove the leading # to uncomment a line.

I showed the other code to demonstrate that $message_envelope is passed to the sendmail program as the -f parameter, because the comments in the config file don't point that out. Which means you don't have to modify anything else to set the envelope sender.









Customer since 2000 cool openvein.org

Tags: mail functionmx settingsphp mailgoogledreamhostapps