I have written a tool in PHP (on Linux) sendmail mails via mail() (unfortuenately PHPMailer is not an option due do missing support for some required stuff).
PHP ignores all SMTP settings on linux so that it uses the sendmail_path setting.
But when sending mail via mail() -> /usr/sbin/sendmail this leads to mail to be delivered locally (the sending server is also the delivering).
But I MUST have a regular "Received from..." header as it would occur when a mail comes in via regular SMTP (this is required by some filtering passing after it on which I have no access / options to change).
So my question is: Is there any chance to "force" /usr/sbin/sendmail to have the mail passed via SMTP to Postfix instead of putting it into the "deliver" process directly?
I already tried alternatives to /usr/sbin/sendmail like msmtp, but my OS does not allow both to co-exist, and I cannot remove Postfix for that.
Any help is highly appreciated :-D
sendmail_pathcan use/usr/bin/msmtpinstead of/usr/bin/sendmail. AFAIK msmtp is "semdmail command line compatible" regarding basic email sending options.