Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Email Notification error when using microsoft exchange

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 4 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RaulChiarella
      last edited by

      Hello there!

      I have a running PFSense 2.5 and went to System > Advanced > Notifications and configured my email on it.
      I inserted everything correctly - smtp.office365.com, port 587, and the auth email with correct password but when i click TEST SMTP settings i get the message:

      Error: Failed to connect to ssl://smtp.office365.com:587 [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) (code: -1, response: )]

      Does anyone knows the procedure to fix this?

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @RaulChiarella
        last edited by

        @raulchiarella
        You have obviously enabled "Secure SMTP Connection", but that is not supported by the server.
        It provides STARTTLS instead, which is used automatically by pfSense.

        R 1 Reply Last reply Reply Quote 0
        • R
          RaulChiarella @viragomann
          last edited by

          @viragomann

          You mean secure SMTPS on the server side or the microsoft exchange side?

          I tested with the option Enable SMTP over SSL/TLS ENABLED and DISABLED but when i try the disabled method it returns "You need SSL/TLS connection for this to work", when i enable again it returns the error above

          I m not sure why thats not working. My Microsoft acc works well with other mails like thunderbird, outlook etc

          S 1 Reply Last reply Reply Quote 0
          • S
            SteveITS Galactic Empire @RaulChiarella
            last edited by

            I've had issues setting up M365 email also. My notes:

            via M365: smtp.office365.com:587, user/pass, SSL/TLS unchecked, auth mechanism LOGIN

            MS has a document on SMTP relay but the settings don't quite match up and/or seem inconsistent. On occasion I have given up and used some other relay to be honest. :)

            Two notes:

            1. save changes before testing
            2. enter the password every time you save changes (it may be auto-filling, and/or not remembering it)

            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
            Upvote ๐Ÿ‘ helpful posts!

            1 Reply Last reply Reply Quote 0
            • lohphatL
              lohphat
              last edited by lohphat

              Newer Office365 tenants have MFA (Multi-Factor Auth) enabled (i.e. login verification by MSFT Authenticator app or SMS) so that simple name+password+STARTTLS is going to fail.

              You first have to ENABLE SMTP Auth as an allowed auth method in the users Mail / Manage Mail Apps settings. SMTP Auth is now DISABLED by default so it has to be checked for it to work at all.

              There is a way to disable this I believe by creating an "application password" which is accepted for auth, bypassing MFA.

              1. You have to set the user account to "Enforce" MFA first.
              2. Then go to https://mysignins.microsoft.com/security-info as the user and then add a method "App password" to create the static password to allow login without MFA.

              More detail here:

              https://d365demystified.com/2021/10/17/allow-users-to-create-app-passwords-in-office-365-multi-factor-authentication/

              I'm working on this now as I just migrated to O365 and all my automated notifications are broken.

              SG-3100 24.11-RELEASE (arm) | Avahi (2.2_6) | ntopng (5.6.0_1) | openvpn-client-export (1.9.5) | pfBlockerNG-devel (3.2.1_20) | System_Patches (2.2.20_1)

              S R 2 Replies Last reply Reply Quote 3
              • S
                SteveITS Galactic Empire @lohphat
                last edited by

                @lohphat All true. What we have done in many cases is, if the office has a fixed IP, set up a connector (option 3 in the MS doc page) to allow relaying from that IP. No credentials necessary. That also covers other devices like scanners/MFPs. If desired pfSense firewall rules can block port 25 outbound from other devices.

                The "app password" idea works but to me it's just a second (third, fourth) valid password that bypasses MFA. I'd feel a bit better if MS made them like 3x longer.

                Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                Upvote ๐Ÿ‘ helpful posts!

                1 Reply Last reply Reply Quote 1
                • R
                  RaulChiarella @lohphat
                  last edited by

                  @lohphat said in Email Notification error when using microsoft exchange:

                  Newer Office365 tenants have MFA (Multi-Factor Auth) enabled (i.e. login verification by MSFT Authenticator app or SMS) so that simple name+password+STARTTLS is going to fail.

                  You first have to ENABLE SMTP Auth as an allowed auth method in the users Mail / Manage Mail Apps settings. SMTP Auth is now DISABLED by default so it has to be checked for it to work at all.

                  There is a way to disable this I believe by creating an "application password" which is accepted for auth, bypassing MFA.

                  1. You have to set the user account to "Enforce" MFA first.
                  2. Then go to https://mysignins.microsoft.com/security-info as the user and then add a method "App password" to create the static password to allow login without MFA.

                  More detail here:

                  https://d365demystified.com/2021/10/17/allow-users-to-create-app-passwords-in-office-365-multi-factor-authentication/

                  I'm working on this now as I just migrated to O365 and all my automated notifications are broken.

                  Thanks. This is what was causing the issue... I enabled SMTP Auth and now everything works fine.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.