We are using Office 365 and our ERP uses SMTP to send email through Office 365. This morning, we got an error says the following: "Syntax error, command unrecognized. The server response was: 4.2.0STOREDRV.ClientSubmission.Exception.AgentGrayExcepto.CryptogrpahicExceptio; Failed to process message due to a transient exception with message Non-agent gray exception caught in component "Transport," function 'DoLocalSubmissionAsync' CryptographyicException...What does this message mean?
This message most likely means Microsoft 365/Exchange Online temporarily failed internally while accepting the email, rather than your ERP sending an invalid SMTP command.
The important parts are:
4.2.0STOREDRV.ClientSubmission.Exception.AgentGrayExceptionCryptographicExceptionFailed to process message due to a transient exceptionA
4.x.xSMTP status is a temporary/transient failure. Microsoft has documented similarSTOREDRV ... Failed to process message due to a transient exceptionerrors as server-side Exchange processing problems where retrying later is appropriate. (Microsoft Learn)The
CryptographicExceptionis especially interesting. It suggests that while Exchange Online was processing the submitted message, one of its internal transport components encountered a cryptographic operation failure—possibly involving encryption, signing, certificates, message protection, or another transport agent. Because it is wrapped inAgentGrayException, Exchange classified it as something that may succeed on retry rather than a permanent rejection.So I would interpret your error approximately as:
“Office 365 received the SMTP submission, but Exchange encountered a temporary internal cryptographic/transport processing failure. Please retry.”
The phrase your ERP reports as “Syntax error, command unrecognized” is probably misleading. Some older SMTP libraries map unexpected
4.2.0responses to generic exceptions. The actual Exchange response following it is much more informative.What I would do
First, simply retry the same email. If subsequent emails are going through normally, I would treat this morning's occurrence as a temporary Microsoft 365 issue.
Second, make sure your ERP has retry logic for SMTP
4xxresponses. For example, retry after perhaps 10 seconds, then 30 seconds, then 1–2 minutes. Microsoft specifically recommends retry behavior for temporary SMTP submission failures. (Microsoft Learn)Third, if you see it repeatedly, check Exchange Admin Center → Mail flow → Message trace for that sender and time period. Message Trace can show whether Microsoft received, deferred, rejected, or delivered each message and often provides a more complete diagnostic string. (Microsoft Learn)
Also check whether your ERP suddenly sent a burst of messages. Microsoft currently limits SMTP authenticated submission to 3 concurrent connections and 30 messages per minute per mailbox. However, exceeding the concurrent connection limit normally produces
432 4.3.2 Concurrent connections limit exceeded, so your specific CryptographicException does not look like the normal throttling error. (Microsoft Learn)One thing I would not do yet is start changing your TLS/certificate configuration. A client-side TLS problem normally produces errors such as STARTTLS/TLS negotiation failures, not a
STOREDRV...CryptographicExceptionafter Exchange has begun processing the submitted message. (Microsoft Learn)If you can paste the entire SMTP response exactly as logged, especially everything after
CryptographicException, I can decode it more precisely. There may be another exception name or hexadecimal error buried later in the response that identifies exactly which Exchange component failed.