Skip to main content
501

Syntax Error in Parameters

5xxPermanent – do not retryRFC 5321 §4.2.1

SMTP 501 means the command was recognized but its arguments are syntactically invalid. The server understood what command you sent but rejected the parameters. Most commonly seen when MAIL FROM or RCPT TO contains a malformed email address, or EHLO is sent with an invalid domain name.

Wire exchange

SMTP session (S = server, C = client)
# Missing domain in MAIL FROM
C: MAIL FROM:<user@>
S: 501 5.1.7 Bad sender address syntax

# Missing angle brackets
C: MAIL FROM: [email protected]
S: 501 Syntax error in parameters or arguments

# Space in local part
C: RCPT TO:<john [email protected]>
S: 501 5.1.3 Bad destination mailbox address syntax

# EHLO with no argument
C: EHLO
S: 501 Syntax error in parameters: EHLO requires domain argument

# Invalid SIZE parameter
C: MAIL FROM:<[email protected]> SIZE=abc
S: 501 Syntax error in MAIL command parameters

Details

501 is the parameter-level syntax error. The command itself is valid SMTP, but the arguments fail the server's syntax validation.

Most common triggers: Malformed MAIL FROM address: MAIL FROM:<invalid@> → missing domain MAIL FROM:<no-angle-brackets> → missing angle brackets MAIL FROM:<user @example.com> → space in local part Malformed RCPT TO address: RCPT TO:<> → empty address (sometimes valid for bounce messages, but many servers reject it) RCPT TO:<user@ example.com> → space in domain Invalid EHLO domain: EHLO [invalid → unclosed bracket for IP literal EHLO (empty) → bare EHLO with no argument Invalid SIZE parameter: MAIL FROM:<[email protected]> SIZE=abc → non-numeric SIZE value

Anti-spam use: Some servers deliberately apply strict address validation and return 501 for addresses that technically parse but violate local policy (e.g., no MX record exists for the sender's domain).

Enhanced status codes

CodeMeaning
501 5.1.7Bad sender address syntax – MAIL FROM address is malformed
501 5.1.3Bad destination mailbox address syntax – RCPT TO address is malformed
501 5.5.4Invalid command arguments – parameter format is invalid

When you'll see this

  • Bulk email tool with a bug constructs MAIL FROM addresses without angle brackets
  • Database-driven mailer passes an address with leading/trailing whitespace not stripped
  • Anti-spam strict validation rejects sender domains with no MX record
  • Programmatic email sending with malformed unicode in the From address

Edge cases

  • !An empty RCPT TO:<> is technically valid in SMTP for bounce messages (DSN), but many servers reject it with 501
  • !Internationalized email addresses (UTF-8 local parts) require SMTPUTF8 extension – without it, 501 is returned
  • !After 501, the SMTP session remains open – send RSET to reset the transaction state and retry with corrected parameters
  • !Some servers return 501 for EHLO without a FQDN argument when they require a proper domain

Related codes

FAQ

My MAIL FROM address looks correct but I'm getting 501 – why?

Check for hidden whitespace, missing angle brackets, or special characters. SMTP requires 'MAIL FROM:<address>' with angle brackets and no spaces. Also verify the local part uses only allowed characters (letters, digits, dots, hyphens, underscores). Some servers also check if the sender domain has a valid MX record.

See Also