mirror of
https://github.com/chatmail/core.git
synced 2026-10-17 10:23:01 +03:00
Classic email servers sometimes start rejecting all messages and ask the user to solve web CAPTCHA, but still allow to connect. In this case we want to switch to another SMTP server by moving the transport to the end of the list returned by smtp::sorted_transports. We disconnect after any message sending failure, so next message or resent same message will be sent over another other transport. Permanent SMTP error does not necessarily mean that switching to another server will help. For example if the user tries to send a large message, any server will reject it, and it is not a failure of the server. We do not try to distinguish between error messages, so it is expected that we may sometimes switch to another server when it is unnecessary.