FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    SMTP Failing

    Scheduled Pinned Locked Moved Solved
    Q&A
    2
    4
    5.6k
    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.
    • T
      tschlegel
      last edited by

      We have FusionAuth deployed to AWS (ECS), and everything is set up and working except for email. We're using https://resend.com for SMTP (per recommendations). We're running into an issue where we have all the SMTP settings in place for a tenant, we can verify these settings work when run in our development environment, but when we try and send a test email from the FusionAuth admin UI we get an error:

      Unable to send email via JavaMail
      
      Prime Messaging Exception
      501 Error: Syntax: HELO hostname
      

      As far as I can tell we should only get that error when the SMTP hostname hasn't been set correctly, but it has been set (we can see it in the UI, and I can find it in the database as well). We've also verified that we can send email through resend using this exact SMTP configuration using swaks (recommended here).

      swaks --from '<FROM_EMAIL>' --to '<TO_EMAIL>' --server smtp.resend.com --port 587 --auth plain --tls --auth-user 'resend' --auth-password '<RESEND_API_KEY>'
      

      ^ this works perfectly.

      I have FusionAuth SMTP debugging enabled, and this is all we see when sending a test email:

      DEBUG: Jakarta Mail version 2.1.2
      DEBUG: URL jar:file:/usr/local/fusionauth/fusionauth-app/lib/smtp-2.0.2.jar!/META-INF/javamail.providers
      DEBUG: successfully loaded resource: jar:file:/usr/local/fusionauth/fusionauth-app/lib/smtp-2.0.2.jar!/META-INF/javamail.providers
      DEBUG: Tables of loaded providers
      DEBUG: Providers Listed By Class Name: {org.eclipse.angus.mail.smtp.SMTPTransport=jakarta.mail.Provider[TRANSPORT,smtp,org.eclipse.angus.mail.smtp.SMTPTransport,Oracle], org.eclipse.angus.mail.smtp.SMTPSSLTransport=jakarta.mail.Provider[TRANSPORT,smtps,org.eclipse.angus.mail.smtp.SMTPSSLTransport,Oracle]}
      DEBUG: Providers Listed By Protocol: {smtp=jakarta.mail.Provider[TRANSPORT,smtp,org.eclipse.angus.mail.smtp.SMTPTransport,Oracle], smtps=jakarta.mail.Provider[TRANSPORT,smtps,org.eclipse.angus.mail.smtp.SMTPSSLTransport,Oracle]}
      DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
      DEBUG: URL jar:file:/usr/local/fusionauth/fusionauth-app/lib/smtp-2.0.2.jar!/META-INF/javamail.address.map
      DEBUG: successfully loaded resource: jar:file:/usr/local/fusionauth/fusionauth-app/lib/smtp-2.0.2.jar!/META-INF/javamail.address.map
      DEBUG: setDebug: Jakarta Mail version 2.1.2
      
      mark.robustelliM 1 Reply Last reply Reply Quote 0
      • T
        tschlegel
        last edited by

        @mark-robustelli Our initial thought was that this was a WAF issue on AWS, but that didn't pan out. The actual fix was to add an "additional property" to the SMTP settings for mail.smtp.localhost with the full host name:

        eabf16dd-e8f7-41b2-925d-6587063adb26-image.png

        Once we set this we were able to get things working with Resend. No idea if this applies to other SMTP integrations.

        mark.robustelliM 1 Reply Last reply Reply Quote 0
        • mark.robustelliM
          mark.robustelli @tschlegel
          last edited by

          @tschlegel Could it be a firewall issue not allowing the production server to see the SMTP server?

          1 Reply Last reply Reply Quote 0
          • T
            tschlegel
            last edited by

            @mark-robustelli Our initial thought was that this was a WAF issue on AWS, but that didn't pan out. The actual fix was to add an "additional property" to the SMTP settings for mail.smtp.localhost with the full host name:

            eabf16dd-e8f7-41b2-925d-6587063adb26-image.png

            Once we set this we were able to get things working with Resend. No idea if this applies to other SMTP integrations.

            mark.robustelliM 1 Reply Last reply Reply Quote 0
            • mark.robustelliM
              mark.robustelli @tschlegel
              last edited by

              @tschlegel Thanks for sharing the update!

              1 Reply Last reply Reply Quote 0
              • mark.robustelliM mark.robustelli has marked this topic as solved on
              • First post
                Last post