Recent

Author Topic: Office365, Indy and SMTP  (Read 2278 times)

kinu

  • New Member
  • *
  • Posts: 17
Office365, Indy and SMTP
« on: May 15, 2024, 11:13:39 am »
The error when I do
Code: Pascal  [Select][+][-]
  1.  SMTP.Authenticate
is

Code: Pascal  [Select][+][-]
  1. Error connecting with SSL.
  2. EOF was observed that violates the protocol.

My settings in SMTP component:

Authtype - satDefault
Host - 'smtp.office365.com'
Port - 587
Username and Password set too.
UseTLS - utUseExplicitTLS

and in SSLHandler

SSLOptions.Method - sslvTLSv1
so in SSLVersion is the same.

What am I doing wrong?

rvk

  • Hero Member
  • *****
  • Posts: 6703
Re: Office365, Indy and SMTP
« Reply #1 on: May 15, 2024, 12:20:11 pm »
sslvTLSv1 ??????? for smtp.office365.com ?
That seems really old.

Quote
We have already disabled TLS 1.0 and 1.1 for most Microsoft 365 services in the world wide environment. For Microsoft 365 operated by 21 Vianet, TLS1.0 and TLS1.1 will be disabled on June 30, 2023.
https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/opt-in-exchange-online-endpoint-for-legacy-tls-using-smtp-auth

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1500
    • Lebeau Software
Re: Office365, Indy and SMTP
« Reply #2 on: May 15, 2024, 09:14:21 pm »
Code: Pascal  [Select][+][-]
  1. Error connecting with SSL.
  2. EOF was observed that violates the protocol.

That means the server is closing the TCP connection during the TLS handshake without sending a TLS alert first to explain why.

Quote
We have already disabled TLS 1.0 and 1.1 for most Microsoft 365 services in the world wide environment. For Microsoft 365 operated by 21 Vianet, TLS1.0 and TLS1.1 will be disabled on June 30, 2023.

IOW, change SSLOptions.Method to sslvTLSv1_2 instead.
« Last Edit: May 15, 2024, 09:16:42 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

kinu

  • New Member
  • *
  • Posts: 17
Re: Office365, Indy and SMTP
« Reply #3 on: May 16, 2024, 01:57:57 pm »
Thank you. Set it to TLS 1_2. Then I got an error about user permissions:
Code: Pascal  [Select][+][-]
  1.  
  2. ERROR: Authentication unsuccessful, user is locked by your organization's security defaults policy. Contact your administrator. [longstringwithmydomainandsomethingmore]

So I made and check the changes in Exchange console:

Code: Pascal  [Select][+][-]
  1. PS C:\Users\miguel> Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled
  2. SmtpClientAuthenticationDisabled : True
  3.  
  4. PS C:\Users\miguel> Set-TransportConfig -SmtpClientAuthenticationDisabled $false
  5.  
  6. PS C:\Users\miguel> Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled
  7. SmtpClientAuthenticationDisabled : False
  8.  
And then the user, that is ok:

Code: Pascal  [Select][+][-]
  1. GET-CASMailbox -Identity user@domain.com | Format-list SmtpClientAuthenticationDisabled
  2. SmtpClientAuthenticationDisabled : False

But I keep having same user locked error. I think this is an Office365 error now, not Indy nor Lazarus related, but could you help?


Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1500
    • Lebeau Software
Re: Office365, Indy and SMTP
« Reply #4 on: May 16, 2024, 08:31:54 pm »
But I keep having same user locked error. I think this is an Office365 error now, not Indy nor Lazarus related, but could you help?

Sorry, I don't know anything about how to address that issue.  You will probably have to ask Microsoft.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

rvk

  • Hero Member
  • *****
  • Posts: 6703
Re: Office365, Indy and SMTP
« Reply #5 on: May 16, 2024, 08:36:32 pm »

kinu

  • New Member
  • *
  • Posts: 17
Re: Office365, Indy and SMTP
« Reply #6 on: May 20, 2024, 12:52:32 pm »
Hello again. After a lot of struggle, seems that change things in O365 to allow external SMTP use makes it insecure. Yo have to allow SMTP for the "transport", for the user, and disable "default security options" for your organization. My solution: use a personal google account to send mails from my apps. It just works.

Thank you all for your help and comments.

 

TinyPortal © 2005-2018