In an ideal world, we can detect the relay host from OVERRIDE_RECIPIENT if it is set using net.LookupMX. When connecting to the first fails, we can connect to the next. At the same time, we can try and keep a connection open for a while in case we receive multiple messages in one session.
This is tricky, though, as we have to carefully distinguish network errors from mail sending errors.
In an ideal world, we can detect the relay host from
OVERRIDE_RECIPIENTif it is set usingnet.LookupMX. When connecting to the first fails, we can connect to the next. At the same time, we can try and keep a connection open for a while in case we receive multiple messages in one session.This is tricky, though, as we have to carefully distinguish network errors from mail sending errors.