5.1.7 bounce: bad sender address syntax

5.1.7Bad sender’s mailbox address syntaxPermanent: retrying will not help

Example
501 5.1.7 Bad sender address syntax

What it means

X.1.7 is "Bad sender’s mailbox address syntax" in RFC 3463. It is the sender-side twin of 5.1.3: the address in your MAIL FROM command (the envelope sender, also called the return path) is not valid syntax. Postfix replies with the exact text shown in the example when it cannot parse MAIL FROM.

Some servers also apply 5.1.7 to the From header after the message body arrives, or when the sender address is syntactically fine but refused, for example a blank or obviously invalid sender. Microsoft Exchange Online uses 5.1.7 when the sender address is missing or malformed. The usual basic codes are 501 or 553 during MAIL FROM, or 550 or 554 after DATA.

Since a broken address will not repair itself, you will nearly always see the permanent 5.1.7. A 4.1.7 exists for checks that could not complete, but it is rare.

Likely causes

  • An application, printer, or scanner sends MAIL FROM with a display name, spaces, or no domain, such as `MAIL FROM:<scanner>`.
  • A script builds the sender from a database field that is empty or contains a newline.
  • Non-ASCII characters in the sender address sent to a server without SMTPUTF8 support.
  • A misconfigured relay rewrites the envelope sender into an invalid form.

How to fix it

  1. Find the exact MAIL FROM your system sent. Your MTA log or the application’s SMTP debug output shows it.
  2. Set the sender to a full, plain address on a domain you control, such as `MAIL FROM:<alerts@example.com>`.
  3. For devices like printers and scanners, fill in both the sender address and the domain fields in their SMTP settings.
  4. If you rewrite senders on a relay, test the rewrite rule with a few addresses and confirm the output is a valid address.
  5. Send a test to an outside mailbox and check the Return-Path header of the delivered copy.

Checks that apply

  • Email Header Analyzer Shows the Return-Path and From headers of a delivered copy, so you can see what your system really uses as the sender.
  • MailFlow Monitor Sends monitored test mail end to end after you fix the sender setting, confirming the address is now accepted.

The classification runs without network lookups and we never store your paste.

FAQ

Why did my mail client send a bad sender address?
Usually it is not the client but a device or script with incomplete SMTP settings. Ordinary mail clients rarely produce a 5.1.7.
Is 5.1.7 related to SPF or DMARC?
No. It is a syntax or validity check on the address itself, before any authentication checks run.

All 191 bounce codes