Package com.atlassian.crowd.manager.mail
Class MailManagerImpl
java.lang.Object
com.atlassian.crowd.manager.mail.MailManagerImpl
- All Implemented Interfaces:
MailConfigurationService,MailManager
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMailManagerImpl(InternalPropertyManager propertyManager, com.atlassian.sal.api.ApplicationProperties applicationProperties, ClusterService clusterService, Clock clock, I18nHelper i18nHelper, MailSendManager sendManager, AuthenticatedUserProvider authenticatedUserProvider, EmailAddressValidator emailValidator, com.atlassian.event.api.EventPublisher eventPublisher, ClientConfigStorageServiceSupplier clientConfigStorageServiceSupplier) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected StringremovePasswordFromLogs(String logs) voidsaveConfiguration(MailConfiguration mailConfiguration) Saves mail configurationvoidsendEmail(EmailMessage messageToSend) Sends a single email using the configured mail serverSet<? extends EmailMessage> sendEmails(Collection<? extends EmailMessage> messagesToSend) Sends multiple emails using the configured mail server.sendTestMail(SMTPServer smtpServer, jakarta.mail.internet.InternetAddress emailAddress) Send a test email using the supplied mail server (remote host / JNDI)validateConfiguration(MailConfiguration mailServerEntity) Verifies whether the specified MailConfiguration is valid
-
Field Details
-
SANITISED_PASSWORD
- See Also:
-
LINE_BEFORE_PASSWORD_IN_LOGS
- See Also:
-
-
Constructor Details
-
MailManagerImpl
public MailManagerImpl(InternalPropertyManager propertyManager, com.atlassian.sal.api.ApplicationProperties applicationProperties, ClusterService clusterService, Clock clock, I18nHelper i18nHelper, MailSendManager sendManager, AuthenticatedUserProvider authenticatedUserProvider, EmailAddressValidator emailValidator, com.atlassian.event.api.EventPublisher eventPublisher, ClientConfigStorageServiceSupplier clientConfigStorageServiceSupplier)
-
-
Method Details
-
sendTestMail
public SendTestMailResult sendTestMail(SMTPServer smtpServer, jakarta.mail.internet.InternetAddress emailAddress) throws MailSendException Description copied from interface:MailManagerSend a test email using the supplied mail server (remote host / JNDI)- Specified by:
sendTestMailin interfaceMailManager- Parameters:
smtpServer- supplied SMTP Server, which will be used to send message.emailAddress- address of recipient.- Returns:
- result of test, which contains logs and status.
- Throws:
MailSendException- an error occurred sending the email.
-
sendEmails
public Set<? extends EmailMessage> sendEmails(Collection<? extends EmailMessage> messagesToSend) throws MailSendException Description copied from interface:MailManagerSends multiple emails using the configured mail server.- Specified by:
sendEmailsin interfaceMailManager- Returns:
- a collection of messages that failed to be sent
- Throws:
MailSendException- an error occurred that prevented sending any email (connection error, configuration error, etc.).
-
sendEmail
Description copied from interface:MailManagerSends a single email using the configured mail server- Specified by:
sendEmailin interfaceMailManager- Parameters:
messageToSend- single email using the configured mail server- Throws:
MailSendException- an error occurred sending the email.
-
validateConfiguration
Description copied from interface:MailManagerVerifies whether the specified MailConfiguration is valid- Specified by:
validateConfigurationin interfaceMailManager- Parameters:
mailServerEntity- entity with attributes to be validated- Returns:
- a list with errors found in the configuration
-
saveConfiguration
Description copied from interface:MailConfigurationServiceSaves mail configuration- Specified by:
saveConfigurationin interfaceMailConfigurationService- Parameters:
mailConfiguration- entity with mail configuration.
-
getMailConfiguration
- Specified by:
getMailConfigurationin interfaceMailConfigurationService- Returns:
- Mail configuration
-
removePasswordFromLogs
-
isConfigured
public boolean isConfigured()- Specified by:
isConfiguredin interfaceMailConfigurationService- Returns:
- true if the mail server is fully configured, regardless of the configuration's validity
-