Bad destination mailbox address syntax — malformed email address
Production Risk
Low for single messages; indicates a systemic data quality problem if occurring in bulk.
The recipient email address is syntactically malformed and cannot be parsed by the receiving mail system. The address does not conform to RFC 5321 / RFC 5322 address syntax.
- 1The address is missing the @ symbol.
- 2The local part or domain contains illegal characters.
- 3The address was truncated or corrupted before delivery.
Client submits a RCPT TO command with a syntactically invalid address.
RCPT TO:<not-an-email-address> # Server returns: 501 5.1.3 Invalid address format
expected output
501 5.1.3 ...
Fix
Validate email address syntax at input
WHEN At the point of user input or list import
// RFC 5322 compliant validation (Node.js example)
const emailRegex = /^[^s@]+@[^s@]+.[^s@]+$/;
if (!emailRegex.test(address)) {
throw new Error('Invalid email address syntax');
}Why this works
Syntactic validation before sending prevents malformed addresses from reaching the MTA.
✕ Pass user-supplied addresses directly to RCPT TO without validation
Malformed addresses cause immediate 5xx rejections and can expose injection vulnerabilities.
RFC 3463 — Enhanced Mail System Status Codes
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev