553 5.1.7: the sender address is not a valid RFC 5321 address
Gmail rejected the message because the sender address your server gave in the SMTP envelope isn't a valid RFC 5321 email address.
553 5.1.7 The sender address <address> is not a valid RFC 5321 address.
Google's text for 553 5.1.7, with <address> in place of the address the source shows as a placeholder.
What 553 5.1.7 means
Google lists 553 5.1.7 with the text "The sender address address is not a valid RFC 5321 address", where the middle "address" is the address your server sent. RFC 3463 defines X.1.7 as "Bad sender's mailbox address syntax": the sender's address was syntactically invalid. RFC 5321 defines 553 as "Requested action not taken: mailbox name not allowed (e.g., mailbox syntax incorrect)".
The address in question is the envelope sender given in the MAIL FROM command, which can differ from the From header people see. RFC 5321 section 4.1.2 sets its syntax: a local part, an @ and a domain, inside angle brackets. Problems usually come from software that builds the envelope itself: a missing domain (just "www-data" or "root"), a display name sent where only an address belongs, spaces, unbalanced quotes, or a trailing dot.
Web servers, scripts, printers and scanners are the usual sources, because they often fall back to a local user name. Set an explicit, complete sender address in the application or in the mail server's configuration, then send a test.
Likely causes
- An app or script sends with a bare local user name (no @domain) as the envelope sender.
- The envelope sender includes a display name, spaces or unbalanced quotes.
- A typo such as a double @, a trailing dot or a missing domain part.
- A device such as a printer or scanner with an incomplete sender setting.
How to fix it
If you sent the message
- Set a complete sender address (name@yourdomain) in the application, form plugin or device.
- On servers, configure the default envelope sender or return-path explicitly.
- Check the MAIL FROM value in your mail logs to see exactly what was sent.
If you're the recipient or their admin
- No action needed at Gmail: the sending system has to use a valid address.
Frequently asked questions
Which sender address does Gmail check for 553 5.1.7?
The envelope sender your server gives in the SMTP MAIL FROM command, not necessarily the From header shown to readers. Check your mail server logs or the app's settings to see the exact value it sends.
Why does my website or script get 553 5.1.7 from Gmail?
Scripts often send with a local system user such as www-data as the sender, with no domain. Set a full sender address in the script, plugin or server configuration.
Sources
- Gmail SMTP errors and codes (Google Workspace Admin Help)
- RFC 3463: Enhanced Mail System Status Codes
- RFC 5321, section 4.1.2: Command argument syntax
Provider messages are quoted as the provider publishes them. Servers can change their wording, so the bounce you received may differ slightly.
Related codes
- 553 SMTP 553: requested action not taken, mailbox name not allowed
- 501 SMTP 501: syntax error in parameters or arguments
- 550 5.1.20 550 5.1.20: multiple From addresses are not allowed without Sender address
- 553 5.1.2 553 5.1.2: we weren't able to find the recipient domain
- 452 4.2.2 452 4.2.2: the recipient's inbox is out of storage space
- 550 5.2.1 550 5.2.1: the email account that you tried to reach is inactive
- 554 5.6.0 554 5.6.0: email message is malformed, not accepted
Related guides
Why are my website form emails going to spam?
Why WordPress and contact form emails land in spam or vanish: PHP mail(), the From address, SPF and DKIM for the sender, and switching to authenticated SMTP.
9 min read Setup guidesHow do you set up scan to email and app SMTP with Microsoft 365?
Set up a printer, scanner or app to send through Microsoft 365: SMTP AUTH on port 587, a relay connector, Direct Send or HVE, and the Basic auth retirement.
11 min read Email security basicsWhat is SMTP and how does it deliver email?
How SMTP moves email between servers: the EHLO, MAIL FROM, RCPT TO and DATA dialogue, envelope vs header From, relays, retries and what reply codes mean.
9 min read