// how to fix
Microsoft 365 "530 5.7.57 Client not authenticated to send mail": fix
Your app, printer or server sent mail to smtp.office365.com without logging in. Fix 530 5.7.57 with SMTP AUTH, direct send or a relay connector.
What it means
Your application, printer or mail server connected to smtp.office365.com and tried to send an email without logging in first. That endpoint only accepts mail from authenticated users who have an Exchange Online mailbox, so it refused the message at the MAIL FROM step. The error usually looks like this:
530 5.7.57 Client not authenticated to send mail. 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM
This is different from 535 5.7.139: with 5.7.139 the app tried to log in and was refused; with 5.7.57 it did not log in at all (or the login never happened).
Why it happens
- Authentication is not enabled in the app: the "SMTP authentication" box is unticked, the username is empty, or the plugin is set to "no authentication".
- TLS could not be negotiated. Microsoft requires TLS before it accepts a login. If the device cannot do STARTTLS (old firmware, TLS 1.0 only), it skips the login and then gets 5.7.57.
- Wrong port or mode: port 25 without authentication, or "SSL" on port 587 instead of STARTTLS.
- Postfix or another server relaying through Microsoft 365 without SASL authentication configured.
- You wanted relay without a login but pointed the device at
smtp.office365.com. Unauthenticated sending uses a different host (your MX endpoint), see below.
How to check
- Look at the app's SMTP log. If you see
MAIL FROMright afterEHLOorSTARTTLSwith noAUTHline, the app never logged in. - Check that TLS works from the same machine:
openssl s_client -starttls smtp -connect smtp.office365.com:587 -crlf
After the certificate, typeEHLO test. You should see a line starting with250-AUTH. If the TLS handshake fails, the device's TLS support is the problem. - Test the whole chain with
swaksand a real login (--tls --auth LOGIN). If swaks works but the device does not, the device configuration is at fault. - Find your MX endpoint with
dig +short MX yourdomain.comor on the domain scanner. It looks likeyourdomain-com.mail.protection.outlook.com.
How to fix it
Microsoft offers three ways for applications and devices to send. Pick one and configure it completely.
Option 1: SMTP AUTH (client submission)
Best when the app can log in and must send to anyone, internal or external.
- Server
smtp.office365.com, port587, encryption STARTTLS. - Username and password (or OAuth) of a licensed mailbox; the From address must be that mailbox or one it is allowed to send as.
- SMTP AUTH must be allowed for that mailbox; if login then fails, see the 5.7.139 guide linked above (it also covers the Basic authentication retirement timeline).
For Postfix relaying through Microsoft 365, the usual main.cf lines are:
relayhost = [smtp.office365.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_security_level = encrypt
with /etc/postfix/sasl_passwd containing [smtp.office365.com]:587 app@yourdomain.com:password, then postmap /etc/postfix/sasl_passwd and systemctl reload postfix. Postfix rewrites nothing by itself: the sender address must match the mailbox, or you get SendAsDenied.
Option 2: direct send (no login, internal recipients only)
The device sends to your MX endpoint (yourdomain-com.mail.protection.outlook.com) on port 25 without logging in. This only delivers to mailboxes in your own organization, and your SPF record should include the device's public IP. At the time of writing, Microsoft also lets admins reject direct send entirely (Set-OrganizationConfig -RejectDirectSendEnabled $true), so check that this is not enabled if you rely on it.
Option 3: SMTP relay with a connector (no login, any recipient)
Create an inbound connector in the Exchange admin center (Mail flow > Connectors, from "Your organization's email server" to Microsoft 365) that recognizes your fixed public IP or a TLS certificate. The device then sends to your MX endpoint on port 25 and can reach external recipients. The From address must use one of your accepted domains, otherwise you risk 5.7.750 unregistered domain blocks.
Check that it is fixed
- Send a test from the device to the unique address on the Delivmail home page (with options 1 and 3; option 2 cannot reach external addresses). The report shows SPF, DKIM and DMARC results for the path you chose.
- With direct send, test with an internal mailbox instead and look at its headers.
- Resend the message that failed and confirm the device log shows
235 Authentication successful(option 1) or a250answer afterDATA.
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
- Your emails land in Outlook or Hotmail junkOutlook.com, Hotmail and Live send many new senders to Junk. Check your setup, then use Microsoft's free sender tools: SNDS, JMRP and the delist portal.
- Set up SPF, DKIM and DMARC for Microsoft 365A complete checklist to authenticate a domain that sends with Outlook in Microsoft 365: the SPF include, the two DKIM CNAME records, and a first DMARC record.
- Microsoft 365 "550 5.1.8 Access denied, bad outbound sender"Microsoft 365 has blocked a user from sending because the account sent spam, usually after being hacked. Secure the account, then unblock it.
- DKIM with CNAME records: delegated selectors (Microsoft 365, SendGrid…)Many providers ask for DKIM as CNAME records instead of a TXT key. Here is how they work and the mistakes that break them.
- Microsoft 365 "550 5.7.606 Access denied, banned sending IP": how to delist your IPMicrosoft 365 rejects your email because your IP is on its banned list (5.7.606 to 5.7.649). Learn how to use the delist portal sender.office.com.