0

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.

Mookman288
  • 111
  • 1
  • 1
  • 6
  • This appears to be related to the `append_dot_mydomain` flag, which must be set to yes. – Mookman288 Aug 13 '15 at 05:56
  • The following works from the command line, but **DOES NOT** work in the php.ini: `/usr/sbin/sendmail -i -t -f postmaster@example.org` – Mookman288 Aug 13 '15 at 06:00
  • `mail.force_extra_parameters` doesn't seem to work either, ala: http://php.net/manual/en/mail.configuration.php#113849 – Mookman288 Aug 13 '15 at 06:09

1 Answers1

2

Okay, so maybe I was a little hasty in posting this question. It turns out, this works great:

/usr/sbin/sendmail -i -t -f postmaster@example.org

So, the real solution is then to use the

mail.force_extra_parameters flag, and set it to -fpostmaster@example.org

Just make sure you don't test using the cli php.ini, expecting the apache php.ini to work. Sheesh.

Mookman288
  • 111
  • 1
  • 1
  • 6