Bounced Emails

NeilHerbert

YummyHost
Hey I was wondering if anyone knew about this. I've just received a bounced email which a customer's php script tried to send, it would probably be alot better if the customer actually received it rather than me. I assume it's something to do with the exim config? Is there anyway to return the bounced emails to the email address that sent the mail rather than getting it @ the nobody email address?

Thanks
Neil
 
Neil,

How customer's php script is sending emails? If using mail() function, then make sure that 5th argument is set to "-fREAL-EMAIL", for example:

mail($to, $subject, $message, $headers, "-f$from");

This way Return-Path: of the generated emails will be set to what is defined in the $from variable.

Regards,
Paul
 
Yes thanks Paul, is there anyway to force the -f argument to be using in the php configuration or anything like that? My old server (I was only a reseller on) had bounced emails returning to the sender without having to use any extra agruments.

-- Edit --
i've googled all this and found that adding the following the the virtualhost bit in the httpd.conf will force the return path
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -femail@domain.com"

problem is theres alot to go through to edit. I've found the http template file that cpanel uses to generate the virtualhost bit for httpd.conf and added php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f%serveradmin%" in the correct place, so is there a way to make cpanel redo its httpd file based on the template?
 
I was going to suggest putting it in php.ini, but then it dawned on me you wanted a different address for each account. How about throwing it in each .htaccess, or better yet, don't use a catchall that receives this junk in the first place? Once someone starts spamming people with your domain name you'll be wishing you hadn't.
 
Neil,

How customer's php script is sending emails? If using mail() function, then make sure that 5th argument is set to "-fREAL-EMAIL", for example:

mail($to, $subject, $message, $headers, "-f$from");

This way Return-Path: of the generated emails will be set to what is defined in the $from variable.

Regards,
Paul

this requires safe mode off doesn't it? if so, then doesn't this also leave you more vulnerable to (mail) exploits?
 
Top