Index: [Article Count Order] [Thread]

Date:  Wed, 21 May 2008 19:11:21 +0200
From:  "thomas" <tfj-online (at mark) mail.tele.dk>
Subject:  [coba-e:13013] Sendmail and PHP
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <46d001c8bb65$b0c15390$967da8c0@thomasferrari>
References:  <200802061632520859.01400266 (at mark) mail.loosle.com> <200805192022570309.5EED388F (at mark) mail.loosle.com> <420a01c8bb2b$89a774e0$967da8c0 (at mark) thomasferrari> <200805211749.26467.bq (at mark) solarspeed.net>
X-Mail-Count: 13013

Hi All again,

We have made the following observation.

PHP uses the mail() function to send emails from the server via
/usr/sbin/sendmail -t -i -f admin

or just
/usr/sbin/sendmail -t -i


when you use PHP's built in mail() function it just sends emails out with 
the emailadress of the serveradmin as Return-Path. = (gets trashed)

When sender email and Return-Path are different most mailprograms send mail 
to the trash.

This means that sending an email with mail() from test (at mark) domain.com actualy 
has a Return-Path og admin (at mark) bq.someserver.com

But if you enter this line in the vhost include file for the site;
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f test (at mark) domain.com"
mails are actualy sendt with a Return-Path of test (at mark) domain.com = (thats ok)

Furturemore, if you enter this line in the vhost include file for the site:
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i "

and use the mail() with the additional_parameters  like
mail('nobody (at mark) example.com', 'the subject', 'the message', 'From: 
test (at mark) domain.com,
   '-f test (at mark) domain.com');

it sends with a return path of test (at mark) domain.com = (again ok)

Many customers/programmers/scripts do not use the additional_parameters , so 
thats bad as a lot of email gets trashed...

Is there a way for PHP to make sendemail to use the from address as the 
Return-Path by default.


Thomas
---------------------------------------