I’m trying to send e-mail via PHP’s built in mail() function (which uses sendmail), however, although I’m providing a valid return-path, postfix appears to be rewriting it to become www-d...@domain.tld <mailto:www-d...@domain.tld>, which is not what I want.
Is there a way to prevent this in postfix? Or even better, can I have postfix only rewrite the return path if it fails to match some kind of pattern (e.g- unknown or missing domain, domain doesn’t match from address or such)? The return paths I want to use are boun...@domain.tld <mailto:boun...@domain.tld> so I can create mailboxes specifically for holding those so a script can process them later. For the moment I’m working around the issue by providing a return path via a command line option, but this is far from ideal as it means either editing my php.ini (affects all PHP scripts for all domains) or I have to edit each mail-sending PHP script in order to have them use the same option but that means editing software that I’m currently using as-is, and remembering to keep the change up to date. Neither is a great option, especially when the scripts are all sending valid return paths already. The issue only seems to be affected sendmail; messages send via SMTP seem to be fine, but I’m not sure if that’s because I’m only accepting authenticated addresses when sending?