P
P
Pavel Bezrukov2014-01-23 10:48:51
Exim
Pavel Bezrukov, 2014-01-23 10:48:51

How to configure mail sending through local and external smtp server?

Good afternoon.
I'm trying to figure out how to set up sending mail through a local smtp server, such as exim4, and for 1 sender domain through authorization on an external smtp server.
I figured out that you can use the msmtp utility to send via an external smtp server, and you can configure several accounts in the settings.
For example 1 for sending via external smtp server, and the second one via localhost. Everything works if in the php mail function the 5th parameter is the name of the msmtp account through which you want to send (in php.ini, sending emails via msmtp is pre-configured, while exim4 remains the default for sendmail in the system).
Bitrix uses a wrapper over the mail function (which you can, but would not want to override), in the admin interface there is a field that configures the 5th parameter of the mail function, but it is for the entire site. The problem arises when from the 1st site and without the desire to write custom_mail ().
This raises the question, is it possible to somehow configure the msmtp + exim bundle so that they automatically, looking at the From header, send it to an external or local smtp server? Perhaps we need to do the opposite, first we go to exim4, and that for the 1st domain sends to msmtp?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question