On 2015-01-19 00:53, wie...@porcupine.org wrote:
m...@ruggedinbox.com:
> By default, Postfix REMOVES Return-Path headers from email messages.
> The default setting is:
>
>     message_drop_headers = bcc, content-length, resent-bcc, return-path

That is the default setting.

We tried to use the 'message_drop_headers' parameter in both main.cf and
master.cf (under the 'cleanup' line) but always get the error:

There is no need to seet this. It is the default.

[....] Reloading Postfix configuration.../usr/sbin/postconf: warning:
/etc/postfix/master.cf: unused parameter:
message_drop_headers=bcc,content-length,resent-bcc,return-path

can we have a working example of how to use it ?

You don't need to set this. It is the default.

Finally we tried to comment the line in main.cf which calls our custom
script
and the return-path is correct:

Return-Path: <m...@ruggedinbox.com>

so it looks like the problem is around the script or its invocation.

OK, so you know the mistake is outside Postfix.

        Wietse

Yes that's the subject of the thread
and since the script gets invoked by postfix
and sends back the email to postfix, it is postfix related.
Otherwise were could we ask for help, on the PHP mailing list ? ;)

The script checks a number of things and then uses 'sendmail' for the delivery:

unset($argv[0]);
$sendmail = '/usr/sbin/sendmail -G -i ' . implode(' ', $argv);
$handle = popen($sendmail, 'w');
fwrite($handle, $content);
$sendmail_return_value = pclose($handle);

as you can see there is the -G flag, but the Return-Path header is still there and gets modified with, probably, the owner of the process (vmail).

You say that postfix removes the header as the default behavior
so we checked the 'message_drop_headers' parameter (which is missing in our config) and asked, with examples, if some other parameter would affect 'message_drop_headers'.

Perhaps we could pass ${sender} to our custom script
and then use sendmail's -f argument to change the Return-Path header ?

Reply via email to