SMTP integration works with default tenant, but not duplicated one
-
I successfully integrated SendGrid into my default tenant. I then duplicated the tenant and tested email and it fails. I created a new API key with SendGrid and it still fails.
Unable to send email via JavaMail Prime Messaging Exception
I am confused by the last part of the event log msg:
message successfully delivered to mail server
Here is the event log msg.
Email debug information 7/21/2023 10:32:29 PM Z DEBUG: getProvider() returning jakarta.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle] DEBUG SMTP: need username and password for authentication DEBUG SMTP: protocolConnect returning false, host=smtp.sendgrid.net, user=apikey, password=<null> DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: trying to connect to host "smtp.sendgrid.net", port 587, isSSL false 220 SG ESMTP service ready at geopod-ismtpd-1 DEBUG SMTP: connected to host "smtp.sendgrid.net", port: 587 EHLO hiddenlayer-1.instance.fusionauth.io 250-smtp.sendgrid.net 250-8BITMIME 250-PIPELINING 250-SIZE 31457280 250-STARTTLS 250-AUTH PLAIN LOGIN 250 AUTH=PLAIN LOGIN DEBUG SMTP: Found extension "8BITMIME", arg "" DEBUG SMTP: Found extension "PIPELINING", arg "" DEBUG SMTP: Found extension "SIZE", arg "31457280" DEBUG SMTP: Found extension "STARTTLS", arg "" DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN" DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN" STARTTLS 220 Begin TLS negotiation now EHLO hiddenlayer-1.instance.fusionauth.io 250-smtp.sendgrid.net 250-8BITMIME 250-PIPELINING 250-SIZE 31457280 250-STARTTLS 250-AUTH PLAIN LOGIN 250 AUTH=PLAIN LOGIN DEBUG SMTP: Found extension "8BITMIME", arg "" DEBUG SMTP: Found extension "PIPELINING", arg "" DEBUG SMTP: Found extension "SIZE", arg "31457280" DEBUG SMTP: Found extension "STARTTLS", arg "" DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN" DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN" DEBUG SMTP: protocolConnect login, host=smtp.sendgrid.net, user=apikey, password=<non-null> DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2 DEBUG SMTP: Using mechanism LOGIN DEBUG SMTP: AUTH LOGIN command trace suppressed DEBUG SMTP: AUTH LOGIN succeeded DEBUG SMTP: use8bit false MAIL FROM:<support@hiddenlayer.com> 250 Sender address accepted RCPT TO:<mculley@hiddenlayer.com> 250 Recipient address accepted DEBUG SMTP: Verified Addresses DEBUG SMTP: mculley@hiddenlayer.com DATA 354 Continue Date: Fri, 21 Jul 2023 22:32:28 +0000 (UTC) From: support@hiddenlayer.com Reply-To: support@hiddenlayer.com To: mculley@hiddenlayer.com Message-ID: <1132593178.71.1689978748428@hiddenlayer-1.instance.fusionauth.io> Subject: FusionAuth SMTP Test MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_70_1022356550.1689978748428" ------=_Part_70_1022356550.1689978748428 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Congratulations! You have successfully configured the SMTP server. Tenant Id: 6528d22f-2bc0-dd01-7cd5-bf80935474a3 Tenant name: stage Host: smtp.sendgrid.net Port: 587 Username: apikey Security: TLS - FusionAuth ------=_Part_70_1022356550.1689978748428 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit <p> Congratulations! You have successfully configured the SMTP server. </p> <table style="margin-bottom: 10px;"> <tr> <td><strong>Tenant Id:</strong></td> <td>6528d22f-2bc0-dd01-7cd5-bf80935474a3</td> </tr> <tr> <td><strong>Tenant name:</strong></td> <td>stage</td> </tr> </table> <table style="margin-bottom: 10px;"> <tr> <td><strong>Host:</strong></td> <td>smtp.sendgrid.net</td> </tr> <tr> <td><strong>Port:</strong></td> <td>587</td> </tr> <tr> <td><strong>Username:</strong></td> <td>apikey</td> </tr> <tr> <td><strong>Security:</strong></td> <td>TLS</td> </tr> </table> <p> - FusionAuth </p> ------=_Part_70_1022356550.1689978748428-- . 250 Ok: queued as EoKj0DJlSLOG1mgulDMzmg DEBUG SMTP: message successfully delivered to mail server QUIT 221 See you later
-
I tried reconfiguring this again and was successful. I do not know if It was user error the first three times and not the fourth or if I changed the configuration somehow that resulted in the desired behavior.
-
Did you check the SMTP settings in the duplicated tenant? The password does not copy when it is duplicated.
https://fusionauth.io/docs/v1/tech/core-concepts/tenants#overview
"When using the duplicate feature for Tenants, the SMTP password is not copied. You will have to enter this manually before sending emails.
-
yes. The SendGrid API key is the password
-
@mculley When you go edit the copied tenants settings and send a test email. Does that work for you?
The response should look something like this:
If that works, I would check the SendGrid activity for failure (it may take a while to show up in the activity) :
I'm thinking Sendgrid may be blocking it for some reason if FusionAuth thinks the send worked.
-
No, it does not. That is my original description of the problem.
- I created a
stage
tenant and configured SMTP for SendGrid. - Email test was successful.
- I created a tenant named
prod
. - The SMTP configuration was auto-added to the
prod
tenant prod
send test email failed.- I then went through each
prod
SMTP field one by one and made sure it was correct. I even generated a new API key. prod
send test email again failed.
- I created a
-
I am having other trouble that makes me wonder if there is some configuration in the tenant that I am not understanding or is not correct. Specifically, I am using Postman to send in a request to the
/api/entity/search
endpoint. Works for thestage
tenant but I cannot get the same request to work when I changeX-FusionAuth-TenantId
to the id ofprod
tenant.To summarize, for the
prod
tenant, neither of these two things work:- Send Test Email
/api/entity/search
-
PS: The
/api/entity/search
request fails with Http Code401
-
@mculley Thanks for the info. I took a look and it appears you have access to the Account Portal. If this is a time sensitive issue you can receive more timely support by opening a ticket since you have a support contract with FusionAuth.
In the mean-time, was not able to re-create your SMTP issue and appeared to work on my end. I will also spin your question about the entity serach onto another topic and take a look at if over the next couple of days. You can find the question here: Problem with entity search after copying Tenant.
-
I tried reconfiguring this again and was successful. I do not know if It was user error the first three times and not the fourth or if I changed the configuration somehow that resulted in the desired behavior.
-
@mculley , in any case, I am glad it is working for you. I think the important take away here is that if this happens again or something else comes up and you need timely support, you have access to the Account Portal.
Of course we are always glad to see you here in the forum as well.
-
-
right on. I will use that next time.