Can't overwrite Return-path
I want to use mail() function but I can't overwrite Retun-Path info. Most
mail servers overwrite the 'Return-path' header sent by the PHP mail()
function by a default email address (httpd [at] hostingcompany.com or
apache [at] domain.org).
I tried :
$headers = 'From: MyName<'.$from.'>\r\n';
$headers .= 'Return-Path: MyName<'.$from.'>\r\n';
even:
$headers,"-f".$from
can't help.
Any idea? Thanks.
--
--------------------------------------
Adam Raszkiewicz
Brothers-in-arts.com
--------------------------------------
Re: Can't overwrite Return-path
| Most mail servers overwrite the 'Return-path' header
oh no they most assuredly don't! read the smtp rfc(s). yes, it can be done
however, i'm not going to share that with you as this is an endeavor most
often undertaken by would-be spammers.
Re: Can't overwrite Return-path
Hello,
n 04/05/2007 04:10 PM Adam R said the following:
> I want to use mail() function but I can't overwrite Retun-Path info. Most
> mail servers overwrite the 'Return-path' header sent by the PHP mail()
> function by a default email address (httpd [at] hostingcompany.com or
> apache [at] domain.org).
>
> I tried :
>
> $headers = 'From: MyName<'.$from.'>\r\n';
> $headers .= 'Return-Path: MyName<'.$from.'>\r\n';
>
> even:
>
> $headers,"-f".$from
>
> can't help.
>
> Any idea? Thanks.
This depends on the platform or the delivery method. Take a look at this
message composing and sending e-mail messages. It supports the
Return-Path header and makes sure it works with different platforms and
deleivery methods:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Re: Can't overwrite Return-path
"Manuel Lemos" <mlemos [at] acm.org> wrote in message
news:461597D5.2000308 [at] acm.org...
| Hello,
|
| n 04/05/2007 04:10 PM Adam R said the following:
| > I want to use mail() function but I can't overwrite Retun-Path info.
Most
| > mail servers overwrite the 'Return-path' header sent by the PHP mail()
| > function by a default email address (httpd [at] hostingcompany.com or
| > apache [at] domain.org).
| >
| > I tried :
| >
| > $headers = 'From: MyName<'.$from.'>\r\n';
| > $headers .= 'Return-Path: MyName<'.$from.'>\r\n';
| >
| > even:
| >
| > $headers,"-f".$from
| >
| > can't help.
| >
| > Any idea? Thanks.
|
| This depends on the platform or the delivery method. Take a look at this
| message composing and sending e-mail messages. It supports the
| Return-Path header and makes sure it works with different platforms and
| deleivery methods:
|
| http://www.phpclasses.org/mimemessage
bears fed.
Re: Can't overwrite Return-path
On Thu, 5 Apr 2007 18:54:07 -0500, Steve wrote:
>| Most mail servers overwrite the 'Return-path' header
>
> oh no they most assuredly don't! read the smtp rfc(s). yes, it can be done
> however, i'm not going to share that with you as this is an endeavor most
> often undertaken by would-be spammers.
When I use -f parametr I can't receive messages even when I use e-mail
address at $from. Can be Return-Path compared with Message-ID to avoid
spam?
I would simply like to create a script which will enable sending sms
notifications about new e-mails in my mailbox.
--
--------------------------------------
Adam Raszkiewicz
Brothers-in-arts.com
--------------------------------------
Re: Can't overwrite Return-path
| When I use -f parametr I can't receive messages even when I use e-mail
| address at $from. Can be Return-Path compared with Message-ID to avoid
| spam?
|
| I would simply like to create a script which will enable sending sms
| notifications about new e-mails in my mailbox.
are you saying you want to change the sms return-path to match the
return-path of the email that kicked off your sms script? i would assume
this so that you could easily respond to the original email from the sms.
why not include the address of the person who sent the email in the sms
body? don't you get mailto:someone [at] example.com functionality that way as
well?
Re: Can't overwrite Return-path
On Fri, 6 Apr 2007 23:53:46 -0500, Steve wrote:
>| When I use -f parametr I can't receive messages even when I use e-mail
>| address at $from. Can be Return-Path compared with Message-ID to avoid
>| spam?
>|
>| I would simply like to create a script which will enable sending sms
>| notifications about new e-mails in my mailbox.
>
> are you saying you want to change the sms return-path to match the
> return-path of the email that kicked off your sms script? i would assume
> this so that you could easily respond to the original email from the sms.
> why not include the address of the person who sent the email in the sms
> body? don't you get mailto:someone [at] example.com functionality that way as
> well?
Problem is with Return-Path overwriting. When I did with -f option I can't
receive SMS message. When I leave it not changed I will, but with junk at
the beginning of the message and this junk looks like default server
Return-Path (ex.: return-path-junk [at] apache.com / Subject / Message)
Little bit of code:
$eol='\r\';
$to = $my_pho_no.' [at] tmomail.net';
$subject = 'You have got e-mail!';
$message = 'From: '.$from_emailaddrs;
# Common Headers
$headers = 'From: <'.$from_emailaddrs.'>'.$eol;
$headers .= 'Reply-To: <'.$from_emailaddrs.'>'.$eol;
$headers .= 'Return-Path: <'.$from_emailaddrs.'>'.$eol;
$headers .= 'X-Mailer: PHP v'.phpversion().$eol;
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= 'Content-Type: text/plain; charset=us-ascii'.$eol;
// This is not working as SMS but I can send as normal e-mail:
// mail($to, $subject, $message, $headers,'-f'.$from_emailaddrs);
// This is working as SMS but with junk inside message
mail($to, $subject, $message, $headers);
--
--------------------------------------
Adam Raszkiewicz
Brothers-in-arts.com
--------------------------------------
Re: Can't overwrite Return-path
Adam R wrote:
> On Fri, 6 Apr 2007 23:53:46 -0500, Steve wrote:
>
>> | When I use -f parametr I can't receive messages even when I use e-mail
>> | address at $from. Can be Return-Path compared with Message-ID to avoid
>> | spam?
>> |
>> | I would simply like to create a script which will enable sending sms
>> | notifications about new e-mails in my mailbox.
>>
>> are you saying you want to change the sms return-path to match the
>> return-path of the email that kicked off your sms script? i would assume
>> this so that you could easily respond to the original email from the sms.
>> why not include the address of the person who sent the email in the sms
>> body? don't you get mailto:someone [at] example.com functionality that way as
>> well?
>
> Problem is with Return-Path overwriting. When I did with -f option I can't
> receive SMS message.
Apache may not be a trusted user and therefore the mail may not be sent at all.
--
//Aho