When researching causes of e-mail errors, first read the topic Setting Up for Sending E-Mail and make sure that your system conforms to the recommendations there.

The handling of e-mail outcome codes becomes ever more critical as recipient mail servers devise new methods to combat spam. In particular, the way that CopiaFacts handles multiple MX records can have a significant effect on delivery outcomes.

Often, strategies to improve delivery outcomes can conflict: for example one anti-spam technique involves creating non-functioning or delaying mail servers so that senders who only attempt sending using the first MX record will fail; but against this, attempting to use all MX records when rejected by the first can increase the chances of the sender being blacklisted.

Each MX look-up uses all the available DNS servers shown in the Windows network settings for the network in use by the CopiaFacts node. The configuration command $email_settings specifies the number of retries of MX lookups; but note that if the domain has no A records, the retry of MX look-ups is suppressed.  When no MX records have been found, the default is to add the domain name to the list of possible mailservers and attempt an SMTP login to the domain.  This action can be suppressed by using an EMAIL_FAIL_NO_MX variable with a non-empty value.

CopiaFacts therefore permits fine control of whether or not you wish to continue attempting transmission to other available mail servers for the target domain after an initial failure. Each single CopiaFacts transmission 'attempt' can include trying to send via all of the mailservers listed in the MX records for the domain. You can specify in the variables MX_CONTINUE and MX_BREAK a blank-separated list of CopiaFacts e-mail outcome codes which will override the default settings for the code and control whether CopiaFacts continues through the list of MX records or breaks out and returns the outcome code.

The default settings are shown in the table below. Actions in bold type cannot be overridden by entering the code in the override variables.

Code

Default MX Action

Description

140..145, 153, 156, 158, 166, 167

(n/a)

(e-mail setup errors)

146

Continue

SMTP send timed out  (Socket Error #10060) (see also email option notimeout)

147

Break

Other SMTP send error

154

Continue

Remote Host not found (Socket Error #11001 or #10110 or #10102)

155

Continue

Connection refused (Socket Error #10061)

157

Continue

No DNS data or no address (Socket Error #11004)

159

Continue

E-Mail transmission aborted (Socket Error #10053)

160

Break

TLS connection could not be established

161

Break

Remote Host unreachable (Socket Error #10064 or #100065)

162

Break

E-Mail security DLL failed to encrypt/sign this e-mail

163

Continue

Unexpected disconnect (controlled by email option MX163 in CopiaFacts version 7)

164

Break

SMTP disconnect signalled before connection

420

Continue

Resources temporarily unavailable

421

Continue

Service not available (RFC 2821)

450

Continue

Requested mail action not taken: mailbox unavailable (RFC 2821)

451

Continue

Requested action aborted: local error in processing (RFC 2821)

452

Continue

Requested action not taken: insufficient system storage (RFC 2821)

500

Break

SMTP command unrecognized (syntax error) (RFC 2821)

501

Break

SMTP syntax error in command arguments (RFC 2821)

502

Break

SMTP command not implemented (RFC 2821)

503

Break

SMTP commands in bad sequence (RFC 2821)

504

Break

SMTP command parameter not implemented (RFC 2821)

521

Break

Domain does not accept mail (RFC1846)

530

Break

Access denied, authentication required (RFC 2554)

550

Break

Mailbox unavailable (blocked or not found) (RFC 2821)

551

Break

User not local (try <forward address>) (RFC 2821)

552

Break

Mailbox has exceeded storage allocation (RFC 2821)

553

Break

Mailbox name invalid (RFC 2821)

554

Break

SMTP transaction failed (RFC 2821)

555

Break

Syntax error

If you enter a code in both the MX_CONTINUE list and the MX_BREAK list, both entries will be ignored and the default will be used. Any of the codes listed in bold type above will be silently ignored.

Other References

If you are interested in investigating the causes of specific errors in more detail, see the following links:

Microsoft Socket Errors

RFC 2821