Doniyor Mamatkulov2022-04-21 23:33:59
Doniyor Mamatkulov, 2022-04-21 23:33:59

How to set up Postfix for third party clients?

I welcome everyone.
I set up a mailer on the VPS server according to these instructions . I did everything as described, including setting up DNS and the postfix config itself. Letters leave the native web interface instantly and do not end up in spam.
But, as soon as I try to send an email through a PHP script (SwiftMailer from Yii2), then either emails are sent in ~20 seconds, or most often they are not sent at all - Yii2 swears "Expected response code 250 but got an empty response".
The task is to ensure that all letters are sent quickly from my php script, regardless of the IP address where the script itself is located.
Here is the postfix main.cf config:
Here is an example of an error from the log:
And this is how I send emails:

\Yii::$app->mailer->htmlLayout = "@app/mail/layouts/html";
        $message = \Yii::$app->mailer->compose (['html' => '@app/mail/views/create-user']);
        $message->setFrom (['[email protected]' => 'Администратор '.Yii::$app->params['appName']]);
        $message->setTo ("[email protected]");
        $message->setSubject ('Учётная запись обновлена');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
AlexVWill, 2022-04-22

Run server diagnostics and show the answer here in the text under the cut

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question