// how to fix
Postfix "553 5.7.1 Sender address rejected: not owned by user": fix
Postfix refuses your From address with 553 5.7.1 not owned by user or not logged in? Fix smtpd_sender_login_maps or send with the right login.
What it means
Your Postfix server checks that the person who logged in is allowed to send with the sender address they use. When they are not, it refuses the message:
553 5.7.1 <info@yourdomain.com>: Sender address rejected: not owned by user john@yourdomain.com
A related message appears when someone uses one of your addresses without logging in at all:
553 5.7.1 <info@yourdomain.com>: Sender address rejected: not logged in
This is a protection, not a bug: it stops one user (or a stolen password) from sending as another person. The fix is to tell Postfix who may use which address, or to send with the right account.
Why it happens
The check comes from the restriction reject_sender_login_mismatch (or its variants reject_authenticated_sender_login_mismatch and reject_known_sender_login_mismatch). It compares two things:
- the envelope sender (the
MAIL FROMaddress given by the mail program, not always the visible From header), and - the login name used for SMTP authentication.
Postfix looks up the sender in the table set by smtpd_sender_login_maps. If the login is not listed as an owner, it rejects. Typical situations:
- A user sends from a shared or alias address (
info@,sales@) that is not mapped to their login. - A website, printer or script logs in as one account but sends as another address.
- The login name is
johnbut the table listsjohn@yourdomain.com(or the reverse). - The table was edited but
postmapwas not run, so Postfix still reads the old version. - An app sets a different envelope sender (bounce address) than the From address.
How to check
- Read the mail log for the exact sender and login:
grep "not owned by user" /var/log/mail.log | tail
- See the active settings:
postconf smtpd_sender_login_maps smtpd_sender_restrictions postconf -M submission/inet
The second command shows the-ooverrides of the submission service (port 587) inmaster.cf, where this restriction is often set. - Ask the table directly:
postmap -q info@yourdomain.com hash:/etc/postfix/sender_login
It prints the logins allowed for that address, or nothing. - Reproduce with swaks:
swaks --server mail.yourdomain.com:587 --tls \ --auth LOGIN --auth-user john@yourdomain.com \ --from info@yourdomain.com --to you@example.com
How to fix it
Allow the login to use the address
Edit the sender login table, one sender per line, followed by the allowed logins separated by commas:
# /etc/postfix/sender_login john@yourdomain.com john@yourdomain.com info@yourdomain.com john@yourdomain.com, mary@yourdomain.com @yourdomain.com admin@yourdomain.com
The last line lets admin@yourdomain.com send as any address of the domain; use it carefully. Then rebuild the table and reload:
postmap /etc/postfix/sender_login systemctl reload postfix
Make sure main.cf points to it:
smtpd_sender_login_maps = hash:/etc/postfix/sender_login
If your users are in a database (MySQL, PostgreSQL, LDAP), the map is a query; add the alias permission there instead. Control panels and mail server bundles usually expose this as a "send as" or alias permission for each mailbox.
Or log in with the right account
For a website or device, the simplest fix is often to log in with the account that owns the address, or to create a mailbox for the address it sends from.
Fix the envelope sender of apps
If the visible From is right but the log shows another sender, the app sets a different envelope sender. Set it to an address the login owns (for PHPMailer, $mail->Sender; for nodemailer, the envelope option). See Return-Path, envelope sender and From.
Do not just remove the restriction
Removing reject_sender_login_mismatch makes the error disappear but lets any user send as anyone. Also do not use visitors' addresses as sender on contact forms (see contact form emails sent "From" the visitor). If the error is "Relay access denied" instead, see 554 5.7.1 Relay access denied.
Check that it is fixed
Run the same swaks command: it should end with 250 2.0.0 Ok: queued. Then send from the real app or mail client to the unique address on the Delivmail home page and check in the report that SPF, DKIM and DMARC pass for the sender address. Finally resend the message that was rejected.
Check that it is fixed
DNS changes can take from a few minutes to a few hours. Then send a new test email or scan your domain again.
Related guides
- Gmail bounce "550 5.7.26": unauthenticated emailGmail refused your email because it could not confirm it comes from your domain. SPF, DKIM or DMARC is missing or failing. Here is how to fix it.
- Bounce "550 5.7.1": message rejected or blocked by policyA 5.7.1 bounce means the receiving server refused your email on purpose. Learn to read bounce messages, find the real reason and fix it.
- High bounce rate: clean your mailing listSending to addresses that no longer exist damages your reputation fast. Learn the difference between hard and soft bounces and remove bad addresses after every send.
- Emails delayed: greylisting and 4xx temporary errorsSome servers answer "try again later" on purpose. A normal mail server retries and the email arrives a few minutes late. Here is how to tell normal delays from real problems.
- Running your own mail server: the deliverability checklistA self-hosted Postfix server can deliver well, but only if every basic is right: reverse DNS, SPF, DKIM, DMARC, TLS and no open relay.