oeltayeb.com · Exchange Online Toolkit

Reference

Printers and apps can't send via Microsoft 365: SMTP AUTH, relay connectors and 5.7.57

Based on the article: Printers and apps can't send via Microsoft 365: SMTP AUTH, relay connectors and 5.7.57 · 6 min read

Scan-to-email stops working, a line-of-business app can't send its reports, and the log says "5.7.57 Client not authenticated to send mail". The error is blunt but honest: the device connected to Microsoft 365's authenticated submission endpoint and never proved who it was. In this post I'll explain the three supported ways devices and applications can send through Microsoft 365, why 5.7.57 appears, how to fix each cause, and what the gradual retirement of Basic authentication for SMTP AUTH means for your printers.

Symptoms

The device or application fails to send and logs one of these responses from smtp.office365.com:

530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM
550 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled

Why it happens

Microsoft documents three ways for a device or application to send mail when your mailboxes are in Microsoft 365, plus High Volume Email for internal bulk mail. Each has different requirements and limits:

MethodServer and portAuthenticationRecipients and limits
SMTP AUTH client submissionsmtp.office365.com, port 587 (recommended) or 25, STARTTLS with TLS 1.2 or 1.3Credentials or OAuth token of a licensed mailboxInternal and external; 10,000 recipients per day and 30 messages per minute per mailbox; copies land in Sent Items
SMTP relayYour MX endpoint, for example contoso-com.mail.protection.outlook.com, port 25Inbound connector matched by TLS certificate (recommended) or static public IPInternal and external; no mailbox or licence needed; higher, "reasonable" limits; not for third-party hosted apps
Direct SendYour MX endpoint, port 25None (anonymous)Internal recipients only; treated like any internet mail, so SPF, DKIM and DMARC must be right

5.7.57 belongs to the first row. The client reached the submission endpoint and issued MAIL FROM without a successful AUTH. The common reasons:

Note: Basic authentication for SMTP AUTH is being retired, but at the time of writing it still works. Microsoft's January 2026 Message Center update set out the current milestones: no behaviour change until the end of December 2026; then SMTP AUTH Basic authentication disabled by default for existing tenants (admins can re-enable it); unavailable by default for tenants created after December 2026; and a final removal date to be announced in the second half of 2027. Check Message Center for your tenant's notices.

How to fix it

  1. Identify the method the device is actually using. smtp.office365.com on 587 is client submission; an address ending in mail.protection.outlook.com on 25 is relay or Direct Send. Match the fix to the method.
  2. For client submission, enable SMTP AUTH on that mailbox only. Keep the tenant switch off and open the door per device mailbox.
    # Tenant-wide: True means disabled for everyone unless a mailbox overrides it
    Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled
    
    # Per mailbox: True = disabled, False = enabled, blank = inherits the tenant setting
    Get-CASMailbox -Identity scanner@contoso.com | Format-List SmtpClientAuthenticationDisabled
    
    Set-TransportConfig -SmtpClientAuthenticationDisabled $true
    Set-CASMailbox -Identity scanner@contoso.com -SmtpClientAuthenticationDisabled $false
    Then confirm security defaults aren't enabled, that no Conditional Access policy blocks legacy authentication for that account, and that the device uses port 587 with STARTTLS and TLS 1.2. If the device sends from a different address, grant the sign-in account Send As on that mailbox.
  3. Prefer OAuth where the device or app supports it. For interactive apps, request the delegated scope https://outlook.office.com/SMTP.Send. For unattended services, use the client credentials flow with the application permission SMTP.SendAsApp on the Office 365 Exchange Online API, grant admin consent, register the app in Exchange and give it access to the sending mailbox. The token is presented with SASL XOAUTH2.
    $appId = "11111111-2222-3333-4444-555555555555"      # Application (client) ID
    $spObjectId = "66666666-7777-8888-9999-000000000000" # Object ID of the enterprise application
    New-ServicePrincipal -AppId $appId -ObjectId $spObjectId -DisplayName "Scan-to-email app"
    Add-MailboxPermission -Identity scanner@contoso.com -User (Get-ServicePrincipal -Identity "Scan-to-email app").Identity -AccessRights FullAccess
  4. For devices that can't authenticate, set up an SMTP relay connector. In the Exchange admin center go to Mail flow › Connectors › Add a connector, choose Connection from: Your organization's email server and Connection to: Office 365, name it, and on the authentication page either enter the accepted domain that appears in the subject or SAN of the device's certificate (recommended) or the device's static public IP address. Point the device at your MX endpoint on port 25, use any address in an accepted domain, and add the IP to your SPF record so recipients don't junk the mail. Dynamic and shared IPs aren't supported.
  5. Use Direct Send only as a last resort, and only for internal recipients. Microsoft says most customers don't need it and is working on disabling it by default; you can already reject it yourself with Set-OrganizationConfig -RejectDirectSend $true, which is worth doing once no device depends on it.
  6. Test from PowerShell, with a caveat. Send-MailMessage is marked obsolete because it doesn't guarantee a secure SMTP connection, and it only speaks Basic authentication, so treat it strictly as a quick probe. Microsoft's note points to Send-MgUserMail from the Microsoft Graph PowerShell SDK for real automation.
    $cred = Get-Credential scanner@contoso.com
    Send-MailMessage -SmtpServer smtp.office365.com -Port 587 -UseSsl -Credential $cred `
        -From scanner@contoso.com -To helpdesk@contoso.com -Subject "SMTP AUTH test" -Body "Sent through client submission"

Verify the fix

powershell
Get-MessageTraceV2 -SenderAddress scanner@contoso.com -StartDate (Get-Date).AddHours(-1) -EndDate (Get-Date) |
    Format-Table Received, RecipientAddress, Subject, Status

The Microsoft 365 admin center also offers a "Send email using Microsoft 365" diagnostic, and the SMTP AUTH clients report under Reports › Mail flow in the Exchange admin center shows which accounts still submit mail and whether they use Basic authentication or OAuth.

Key takeaways

References