Skip to content
Snippets Groups Projects
  • Olivier Dony's avatar
    86ae4b90
    [IMP] mail: make connection test attempt to send an email · 86ae4b90
    Olivier Dony authored
    The "connection test" was only attempting to establish a socket to the
    SMTP server and then trying to login, if credentials were setup.
    
    This would catch basic config errors but would fail to detect setups
    were the SMTP server would forbid relaying, because of missing
    credentials, missing STARTSSL mode, and other more complex cases.
    
    By actually beginning a real SMTP session and sending the MAIL FROM,
    RCPT TO and DATA command, we make sure that the server appeas willing to
    relay emails from the current user address to an arbitrary recipient
    address. Then we close the session before actually sending the message.
    
    In order to have a valid destination domain with a valid MX server, we
    use an odoo.com recipient address for the test, which should prove that
    the destination server will relay to arbitrary addresses (unless the
    destination server is an Odoo.com MX server ;-))
    86ae4b90
    History
    [IMP] mail: make connection test attempt to send an email
    Olivier Dony authored
    The "connection test" was only attempting to establish a socket to the
    SMTP server and then trying to login, if credentials were setup.
    
    This would catch basic config errors but would fail to detect setups
    were the SMTP server would forbid relaying, because of missing
    credentials, missing STARTSSL mode, and other more complex cases.
    
    By actually beginning a real SMTP session and sending the MAIL FROM,
    RCPT TO and DATA command, we make sure that the server appeas willing to
    relay emails from the current user address to an arbitrary recipient
    address. Then we close the session before actually sending the message.
    
    In order to have a valid destination domain with a valid MX server, we
    use an odoo.com recipient address for the test, which should prove that
    the destination server will relay to arbitrary addresses (unless the
    destination server is an Odoo.com MX server ;-))