[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [msmtp-users] 2 domains with msmtp from one PHP?
Am 16.02.2012 09:44, schrieb Martin Lambers:
...
Thus:
sendmail_path = "/usr/bin/msmtp -t -i -d --read-envelope-from -C
/etc/msmtprc-www-data-multidomain"
works not in php.ini, but:
sendmail_path = "/usr/bin/msmtp -t -i -d -C
/etc/msmtprc-www-data-multidomain"
does, but I need the --read-envelope-from option.
Can I put this option in the config file (read-envelope-from on)?
Any other clues how to solve that?
The reason is probably that -d accepts an optional argument, and
therefore --read-envelope-from is misinterpreted as the argument to -d.
You should not use -d in your php.ini anyway; it is strictly for
debugging and may cause problems. While you're at it, you can remove -i
too; it has no effect with msmtp.
There is no short form of --read-envelope-from because msmtp must
remain command line compatible with sendmail. There is no config file
command equivalent because the main purpose of the option is to make
msmtp choose an account based on the From header.
Nope, that doesn't solve the problem, but this seems to work in php.ini:
sendmail_path = "/usr/bin/msmtp -t -C /etc/msmtprc-www-data-multidomain"
;sendmail_path = "/usr/bin/msmtp -t -i"
; Force the addition of the specified parameters to be passed as extra
parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
mail.force_extra_parameters = "--read-envelope-from"
I don't exactly remember what is was about the 5th parameter to mail(),
but if it works I won't complain ;-)
I now have to test if switching from addresses in php scripts really
results in mails coming from the proper senders (that
--read-envelope-from works as expected in php, from the commandline it
works for me).
But one problem remains:
As I wrote, I moved the systemwide configfile /etc/msmtprc as it
conflicted with the default section in the one for php - but I need this
systemwide file, for example for cron mails.
In which order are the default accounts used? Is the systemwide being
overwritten if I put one in a user config (like I have for www-data)? Or
how should I put it that php uses it's config, but cron/root can use
another?
Cheers
Frisco