Note that the Return-path header is supposed to be added by the final mail server; even if you set it, it may be replaced.
The stock imap_mail_compose looks for "return_path" and adds it to the list of headers. However, the output of imap_mail_compose on X10 doesn't include the Return-path header. The code
PHP Code:
<?php
$envelope= array("from"=>"info@someplace.com",
'to' => 'nemo@nusquam.net',
'cc' => 'nobody@nyet.net',
'bcc' => 'mother@ispy.net',
"return_path" => "info@someplace.com",
'reply_to' => 'info@someplace.com',
'in_reply_to' => 'id#DEADBEEF',
'message_id' => 'id#CAFEBABE',
'date' => 'now',
'subject' => 'stuff'
);
$message='Message';
$body = array(
array('type' => TYPETEXT,
'subtype' => 'plain',
'description' => 'one',
'contents.data' => "$message"),
array('type' => TYPEAPPLICATION,
'subtype' => 'xml',
'description' => 'two: XML',
'contents.data' => "<?xml version='1.0'?>\n<msg><b>$message</b></msg>")
);
echo imap_mail_compose($envelope, $body);
generates the output:Looks like imap_mail_compose isn't having problems with other headers, just Return-path. You could try using a 'custom_headers' entry in $envelope to add Return-path, but it will be added towards the bottom of the headers and the final mail server will probably add one at the top. Which one takes precedence depends on the mail client.
It could be x10 has a feature limited imap_mail_compose, or there could be something in imap_mail_compose. I'll take a closer look at the source later in case of the latter (unless you do it first).