I recently posted an issue setting up a mail server with postfix and virtual aliases. I solved the problem here:
Postfix/Dovecot - Multiple Domains and Multiple Linux Accounts
To sum it up, I set myorigin
to localhost, among some other settings. Sending and receiving mail via SMTP works great! However, when sending mail from /usr/sbin/sendmail
, that is, PHP's mail()
command, it's ignoring the From:
header somehow, and instead grabbing the myorigin
value.
Here's the headers of importance:
From: Me <user@example.org>
Return-path: <root@localhost>
Received: from example.org (example.org [104.xxx.xxx.xxx]) by mx.google.com with ESMTPS...
Received-SPF: neutral (google.com: 104.xxx.xxx.xxx is neither permitted nor denied by best guess record for domain of root@localhost) client-ip=104.xxx.xxx.xxx;
When I change myorigin
to example.org
everything sends well with PHP, but completely decimates my ability to receive and send mail any other way. So that's not really a solution.
So what I'd like to do is tell /usr/sbin/sendmail
to not use myorigin
, but instead /etc/mailname
JUST FOR PHP. I want to retain postfix's email everywhere else.
Is this possible?
Thank you.