Authentication unsuccessful, user is locked by your organization's security defaults policy. Contact your administrator.

l2t trial 0 Reputation points
2024-07-04T14:05:14.8033333+00:00

Hi,

I have written an application to send emails via smtp.office365.com. I have a Business Basic license for the user and have enabled SMTP for the user in the admin portal. However i am getting the following error. I have tried both security defaults enabled and disabled.

Please help me resolve the issue.

Thanks,

2024-07-04 13:56:45] INFO [JeOAlJZGYM] Connection established to 52.96.88.50:587

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 220 MN2PR11CA0028.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 4 Jul 2024 13:56:44 +0000

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] C: EHLO [127.0.0.1]

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-MN2PR11CA0028.outlook.office365.com Hello [98.158.98.196]

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-SIZE 157286400

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-PIPELINING

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-DSN

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-ENHANCEDSTATUSCODES

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-STARTTLS

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-8BITMIME

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-BINARYMIME

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-CHUNKING

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250 SMTPUTF8

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] C: STARTTLS

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 220 2.0.0 SMTP server ready

[2024-07-04 13:56:45] INFO [JeOAlJZGYM] Connection upgraded with STARTTLS

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] C: EHLO [127.0.0.1]

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-MN2PR11CA0028.outlook.office365.com Hello [98.158.98.196]

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-SIZE 157286400

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-PIPELINING

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-DSN

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-ENHANCEDSTATUSCODES

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-AUTH LOGIN XOAUTH2

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-8BITMIME

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-BINARYMIME

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250-CHUNKING

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 250 SMTPUTF8

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] SMTP handshake finished

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] C: AUTH LOGIN

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 334 VXNlcm5hbWU6

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] C: cm9vdC5hZG1pbkBsaW5rMnRlYW1zdHJpYWwuY29t

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] S: 334 UGFzc3dvcmQ6

[2024-07-04 13:56:45] DEBUG [JeOAlJZGYM] C: Lyogc2VjcmV0ICov

[2024-07-04 13:56:53] DEBUG [JeOAlJZGYM] S: 535 5.7.139 Authentication unsuccessful, user is locked by your organization's security defaults policy. Contact your administrator. [MN2PR11CA0028.namprd11.prod.outlook.com 2024-07-04T13:56:53.285Z 08DC9BC05D452012]

Microsoft Entra
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dillon Silzer 57,446 Reputation points
    2024-07-04T17:49:59.7+00:00

    Hello,

    It seems that you are unable to send via this method. I recommend using an App Registration/Enterprise Application to send e-mails as SMTP is a legacy authentication method and is most likely restricted by Security Defaults.

    Security defaults in Microsoft Entra ID

    https://learn.microsoft.com/en-us/entra/fundamentals/security-defaults


    If this is helpful please accept as answer or upvote.

    Best regards,

    Dillon Silzer, Director | Cloudaen.com | Cloudaen Computing Solutions

    0 comments No comments

  2. Raja Pothuraju 8,100 Reputation points Microsoft Vendor
    2024-07-09T13:19:41.8066667+00:00

    Hello @l2t trial,

    Thank you for posting your query on Microsoft Q&A.

    Error Message: 535 5.7.139 Authentication unsuccessful, user is locked by your organization's security defaults policy. Contact your administrator.

    As you mentioned, I see you have enabled SMTP for the user from Admin portal and disabled the security defaults. But still facing the same error.

    Please refer to the document below and follow the steps outlined to address the problem:

    https://learn.microsoft.com/en-us/exchange/troubleshoot/email-delivery/fix-issues-with-printers-scanners-and-lob-applications-that-send-email-using-off#error-authentication-unsuccessful

    1. Verify that SMTP is enabled for the user by running the PowerShell commands mentioned in the article.
    2. Ensure that security defaults are indeed disabled.
    3. Check if there are any conditional access policies that might be affecting the user.
    4. Review the per-user MFA (Multi-Factor Authentication) settings for the affected user account. If it is enabled, disabled for the user.

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    Thanks,
    Raja Pothuraju.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.