SMTP Authentication Error

AidenTheBotLol 21 Reputation points
2023-05-05T12:55:30.1166667+00:00

Hi Y'all,

I am trying to setup a Mastodon server and I have it working however the email part is not working. My Email is done through a 365 Tenate and I have an smtp account. When I try to authenticate to send SMTP messages I get the following error "Net::SMTPAuthenticationError: 504 5.7.4 Unrecognized authentication type [CH0PR07CA0007.namprd07.prod.outlook.com 2023-05-05T12:46:17.326Z 08DB4D0A93F694B2]".

Upon doing some basic research it would seem to be related to a TLS mismatch however I believe my SMTP configuration is not adequate enough to fix this. My system is running Ubuntu 20.04.06 Server.

Here is my current SMTP configuration:
SMTP_SERVER=smtp-legacy.office365.com

SMTP_PORT=587

SMTP_LOGIN=******@domain.net

SMTP_PASSWORD=

#SMTP_AUTH_METHOD=plain

#SMTP_OPENSSL_VERIFY_MODE=none

#SMTP_ENABLE_STARTTLS=auto

SMTP_FROM_ADDRESS=******@domain.net

Any help is appreciated.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Microsoft 365 and Office Install, redeem, activate For business Windows
{count} votes

2 answers

Sort by: Most helpful
  1. VasimTamboli 5,215 Reputation points
    2023-05-07T10:52:05.9266667+00:00

    It looks like the issue might be related to the authentication method used by your SMTP server. The error message indicates that the authentication type is unrecognized.

    To resolve this issue, you may want to try using a different authentication method, such as "login" or "plain". Uncomment the SMTP_AUTH_METHOD=plain line in your configuration file and see if that helps.

    Additionally, you may want to enable STARTTLS encryption to secure your email communication. Uncomment the SMTP_ENABLE_STARTTLS=auto line in your configuration file to enable STARTTLS.

    Here is what your updated configuration file might look like:

    makefileCopy code
    SMTP_SERVER=smtp-legacy.office365.com
    SMTP_PORT=587
    SMTP_LOGIN=******@domain.net
    SMTP_PASSWORD=
    SMTP_AUTH_METHOD=plain
    SMTP_OPENSSL_VERIFY_MODE=none
    SMTP_ENABLE_STARTTLS=auto
    SMTP_FROM_ADDRESS=******@domain.net
    

    Save the changes and restart your Mastodon server. Test your SMTP connection again and see if it works. If you still have issues, you may want to contact your email provider to check if there are any specific requirements or restrictions for SMTP authentication.

    0 comments No comments

  2. Aholic Liang-MSFT 13,886 Reputation points Microsoft External Staff
    2023-05-08T10:03:23.3066667+00:00

     

    Hi @ AidenTheBotLol,

    Just wanted to confirm if your local server has TLS1.2 enabled?

    SMTP clients will need to use TLS 1.2 to connect to Exchange and send email. It is recommended that you enable TLS 1.2 and disable 1.0 and 1.1.

    For more information ,please refer to this link:Exchange Online to Introduce Legacy SMTP Endpoint in 2022 - Office 365 for IT Pros (office365itpros.com)

    (Note:Microsoft provides third-party contact information to help you find additional information about this topic. This contact information may change without notice. Microsoft does not guarantee the accuracy of third-party contact information.)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

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.