6 Server workarounds

Some SMTP servers have special requirements. The following variables implement support for common requirements.


An SMTP server may return an error code saying that there’s a transient error (a ‘4xx’ code). In that case, smtpmail will try to resend the message automatically, and the number of times it tries before giving up is determined by this variable, which defaults to 10.


The variable smtpmail-local-domain controls the hostname sent in the first EHLO or HELO command sent to the server. It should be set only if the system-name function returns a name that isn’t accepted by the server. Do not set this variable unless your server complains.


The variable smtpmail-sendto-domain makes the SMTP library add ‘@’ and the specified value to recipients specified in the message when they are sent using the RCPT TO command. Some configurations of sendmail requires this behavior. Don’t bother to set this unless you have get an error like:

        Sending failed; SMTP protocol error

when sending mail, and the debug buffer (see Debugging)) contains an error such as:

        RCPT TO: someone
        501 someone: recipient address must contain a domain