SMTP server connection timeout fix

When connecting to SMTP server (or just clicking test connection from mail settings) I get:

Code:
Connection could not be established with host smtp.yandex.com [Connection timed out #110] Log data: ++ Starting Swift_SmtpTransport !! Connection could not be established with host smtp.yandex.com [Connection timed out #110] (code: 0) ++ Starting Swift_SmtpTransport !! Connection could not be established with host smtp.yandex.com [Connection timed out #110] (code: 0)

But If i click "Test Connection" again after the error, it will connect successfully.

Is the timeout time very low? Does increasing it will fix this problem? How can we increase it?

Thank you.

edit: this started to happen when i upgraded from 1.3.1 to 1.4.1.

When connecting to SMTP server (or just clicking test connection from mail settings) I get:

Connection could not be established with host smtp.yandex.com [Connection timed out #110] Log data: ++ Starting Swift_SmtpTransport !! Connection could not be established with host smtp.yandex.com [Connection timed out #110] (code: 0) ++ Starting Swift_SmtpTransport !! Connection could not be established with host smtp.yandex.com [Connection timed out #110] (code: 0)

But If i click “Test Connection” again after the error, it will connect successfully.

Is the timeout time very low? Does increasing it will fix this problem? How can we increase it?

Thank you.

edit: this started to happen when i upgraded from 1.3.1 to 1.4.1.

Fixed it by disabling IPv6. When mautic contacted the server, it would connect via ipv6 because it was activated in my server. And it would take a few seconds to connect but more than the timeout seconds. That’s why when i clicked test connection for the second time, it showed success.