Keycloak email verification not working and receiving any email through keycloak - keycloak

I am Using keycloak 4.5.0 v and created a realm. I have set up the login to enable forget username and verify email. In the email tab I entered
host - smtp.gmail.com
smtp port:465
username - ***#gmail.com
SSL/TLS - enabled
Authentication - enabled with username and password
But I'm still unable to connect to gmail it always pop fail to send email notification error shown:
14:53:14,070 ERROR [org.keycloak.services.resources.admin.RealmAdminResource] (default task-1) Failed to send email
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout 10000;
nested exception is:
java.net.SocketTimeoutException: connect timed out
Any Help would be highly appreciated thank u

change smtp port to 587 i think this work and off SSl and TLS is on

Related

KeyCloak fails to send email using SMTP with status 500

I have Keycloak running in a Kubernetes cluster. Authentication works but I need to set up e-mail to be able to send e-mails for verification and password reset.
I have SendGrid set up as an SMTP Relay. These settings (host, port and api key) work when I send mail using the SendGrid java client. However, when pressing Test connection in KeyCloak I get:
[Error] Failed to load resource: the server responded with a status of 500 ()
[Debug] Remove message (services.js, line 14)
[Debug] Added message (services.js, line 15)
[Error] Can't find variable: error
https://<domain>/auth/resources/ong8v/admin/keycloak/js/controllers/realm.js:76 – "Possibly unhandled rejection: {}"
[Debug] Remove message (services.js, line 14)
There isn't much to go on here. I have an e-mail address set up for the currently logged in user. I've also tried resetting the password in case the Test connection functionality was broken but that didn't work either.
The Realm Settings settings user for email are as such:
host: smtp.sendgrid.net
port: 587
from: test#<domain>
Enable StartTLS: true
Username: "apikey"
Password: <api key>
Any idea what can be wrong? Or how to find out? For instance, maybe I can get a more meaningful error message somehow.
Edit:
I got the server logs.
Failed to send email: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.sendgrid.net, 587; timeout 10000;
nested exception is: java.net.SocketTimeoutException: connect timed out
Edit 2:
I've tried sending mail using Telnet using the exact same settings and that works. So apparently it's something with Keycloak or its underlying Java libraries that's causing issues sending e-mail.
Turns out that Keycloak works and that emails were blocked by the hosting provider.

not able to send the email -POP3/SMTP in blue prism

In my "Configure" action inputs (Business Object: Email - POP3/SMTP):-
Username: xxx#gmail.com
password: xxxx
POP3 Server: pop.gmail.com
SMTP Server: smtp.gmail.com
POP3 Port: 995
SMTP Port: 587
POP3 UseSSL: True
SMTP UseSSL: True
Error:- "Internal: Could not execute code stage because the exception is thrown by code stage: The SMTP server requires a secure connection or the client was not authenticated"
Tried SMTP Port: 465 and still facing an error:
"Internal: Could not execute code stage because an exception is thrown by code stage. Failure sending mail. - Unable to read data from the transport connection: net_io_connectionclosed"
You need to update you security in google
Login your google account and go to security tab there you find somewhere first Turn On Access for less secure apps in the gmail account.
Hope this will work!

Jhipster - Configuring Email with Zoho - Error 553 Relaying disallowed

I am new to Jhipster and trying to configure zoho and I am getting errors.
My setting in /myjhipsterapplicationname/src/main/resources/config/application-dev.yml
mail:
host: smtp.zoho.com
port: 587
username: ****#myCustomDomainOnZoho.com
password: ****** // My password for the above email
protocol: smtp
tls: true
properties.mail.smtp:
auth: true
starttls.enable: true
ssl.trust: smtp.zoho.com
Errors, I am receiving
2017-03-02 21:15:13.421 WARN 6192 --- [ints-Executor-2] com.nectotech.com.service.MailService : E-mail could not be sent to user 'asif#nectotech.com'
org.springframework.mail.MailSendException: Failed to close server connection after message failures; nested exception is javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Connection closed by remote host. Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 553 Relaying disallowed as breakpoints#localhost
I tried the following and it worked.
Go to /myjhipsterapplicationname/src/main/resources/config/application-dev.yml
Search for
mail: # specific JHipster mail property, for standard properties see MailProperties
from:
Replace the value of property from: with your SMTP outgoing email address

Pentaho DI Send Mail. Read timed out

I am trying to send an email from my Gmail account. Bellow are the SMTP details that I provided.
Server: smtp.gmail.com
Port : 465 (also tried 587) Use
Authentication: Yes
Authentication User: my full email id
Authentication password: my password
Use Secure Authentication: Yes
Secure Connection Type: SSL
This is the error that I am getting.
2016/03/16 17:35:45 - [ftp-poc].Mail - ERROR (version 5.2.0.0, build 1
from 2014-09-30_19-48-28 by buildguy) : Problem while sending message:
javax.mail.MessagingException: Could not connect to SMTP host:
gmail-smtp-msa.l.google.com, port: 465; nested exception is:
java.net.SocketTimeoutException: Read timed out
I tried these two things.
ping smtp.gmail.com - Successfull
telnet smtp.gmail.com 465 - I get a empty black screen with a cursor
blinking. No prompt or any text appears when I type. But the cursor
moves.
Gmail security - you need to authorize access by allowing "less secure" (something like that) access, from the gmail side.

How do you fix 550 must be authenticated sending Mail using Grails?

I'm using Grails Mail plugin and trying to send email and keep getting:
Error 500: Executing action [sendInvite] of controller
[RegisterController] caused exception: Failed messages:
javax.mail.SendFailedException: Invalid Addresses; nested exception
is: com.sun.mail.smtp.SMTPAddressFailedException: 550 must be
authenticated
I'm properly following the instructions at: http://www.grails.org/Mail+plugin
The mail server is returning an error when you try to send out the mail. 550 is a generic SMTP failure code; in this case it looks like you are missing a username and password. Some SMTP servers to not require authentication but most do, especially if they're publicly available on the internet. It's also possible that your SMTP server requires an SSL connection and you're connecting with an unsecured socket.
The example config for gmail shows how to set all the mail server authentication options in Config.groovy:
grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "youracount#gmail.com"
password = "yourpassword"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}
Add "mail.debug": "true" to props to turn on JavaMail debugging to get a better picture of what is happening before the failure.
In my case the 550 error was caused by me having accidentally selected and IMAP account as the default account but sending emails from my Outlook Connector Account (which has no authentication settings to make).
I changed the Outlook Connector Account to default. Resent the emails and no errors.
So check that the correct email account is set up as the default also