SMTP

SMTP Error 523

SMTP 523 means enhanced code 5.2.3 "message length exceeds administrative limit" — your email is too big for the recipient's mailbox. Here's how to fix it.

Updated Jul 1, 2026

The short answer

"SMTP Error 523" is shorthand for enhanced status code 5.2.3, "Message length exceeds administrative limit" (RFC 3463) — the recipient's server rejected your email because it is larger than the per-mailbox size limit it will accept. It is a permanent failure delivered with basic reply code 552. Fix it by reducing total message size: compress or link to large attachments, trim inline images, and stay under the receiving server's cap.

"SMTP Error 523" is the way many mail clients and logs render the enhanced status code 5.2.3, defined by RFC 3463 §3.3 as "Message length exceeds administrative limit." The receiving server accepted the connection and recognized the recipient, but rejected the message itself because it is larger than the size limit configured for that mailbox. It is a permanent failure — retrying the same message unchanged will not help.

Accuracy note: 523 is not a real three-digit SMTP reply code. RFC 5321 §4.2.3 defines no 52x reply code — over-size rejections are returned with basic code 552 ("Requested mail action aborted: exceeded storage allocation"). The "523" you see is almost always the dotted enhanced code 5.2.3 with its dots stripped. A full server response typically looks like 552 5.2.3 Message length exceeds administrative limit.

What causes SMTP error 523 (5.2.3)?

The total wire size of your message — headers + body + all attachments, after MIME/base64 encoding — exceeds the per-mailbox limit on the recipient's server. Two things people miss:

  • Base64 inflates attachments by ~33%. A 15 MB file on disk becomes roughly 20 MB on the wire, so a "20 MB" attachment can blow a 25 MB cap.
  • The binding limit is the recipient's, not yours. A message that your sending platform happily accepts can still be bounced by the destination mailbox, which may enforce a smaller administrative limit.

A closely related code is 5.3.4 "Message too big for system" (RFC 3463 §3.4), which is a per-system limit rather than a per-mailbox one. Both surface as 552 and are fixed the same way.

How do I fix SMTP error 523?

  1. Measure the encoded size, not the file size. Multiply raw attachment bytes by ~1.33 (4/3) to estimate the on-the-wire size, then compare against the recipient's cap.
  2. Move large attachments out of the message. Upload to cloud storage (S3, Drive, etc.) and send a download link. This is the most reliable fix and sidesteps every downstream size limit.
  3. Compress or downscale. Zip documents; re-export images at screen resolution instead of embedding multi-megabyte originals.
  4. Split the content across multiple smaller emails if it genuinely must be attached.
  5. Check your provider's cap. Common limits: Amazon SES 40 MB (MIME-encoded, via the SES v2 API or SMTP; see SES quotas), SendGrid's v3 Mail Send API caps total message size at 30 MB (SendGrid docs), and many corporate Exchange/Microsoft 365 servers default to 25–35 MB.

With Courier

If you send transactional email through Courier, keep templates lightweight: prefer linking to assets over embedding large inline images or attachments, since the failure here is enforced by the recipient's server regardless of which downstream provider Courier routes through. If a specific provider returns 552/5.2.3, reduce the rendered message size or host the attachment externally and send a link.

FAQ

Common questions

No. RFC 5321 defines no 52x reply code. "523" is a flattened form of the enhanced status code 5.2.3 ("Message length exceeds administrative limit"), which is actually returned with basic reply code 552.

One API, every provider

Stop debugging raw provider errors

Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.

Reply-code definitions per RFC 3463 §3.3 (X.2.3); RFC 5321 §4.2.3 (552). Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.