Package org.keycloak.utils
Class SMTPUtil
java.lang.Object
org.keycloak.utils.SMTPUtil
SMTP utility methods.
- Author:
- rmartinc
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkSMTPConfiguration
(KeycloakSession session, Map<String, String> config) Validates the configuration using the email sender provider.static String
convertIDNEmailAddress
(String email) Converts an email address to its ASCII representation using punycode (IDN.toASCII) for the domain part.
-
Method Details
-
checkSMTPConfiguration
public static void checkSMTPConfiguration(KeycloakSession session, Map<String, String> config) throws EmailExceptionValidates the configuration using the email sender provider.- Parameters:
session
- The keycloak session to useconfig
- The configuration to validate- Throws:
EmailException
- If some error is found in the configuration
-
convertIDNEmailAddress
Converts an email address to its ASCII representation using punycode (IDN.toASCII) for the domain part. The local part is not modified.- Parameters:
email
- The email to convert- Returns:
- The converted email or null (if IDN.toASCII throws an exception)
-