Interface MailConfigurationService
- All Known Implementing Classes:
MailConfigurationServiceImpl
public interface MailConfigurationService
Service to manage mail configuration
- Since:
- 5.10
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Delete the current mail server configuration@NotNull com.atlassian.mail.server.SMTPMailServer
Retrieve the current mail server configurationboolean
Returns true if mail server configuration exists@NotNull com.atlassian.mail.server.SMTPMailServer
updateMailServer
(@Nullable String name, @Nullable String fromAddress, @Nullable String subjectPrefix, @Nullable Boolean precedenceBulkHeaderExcluded, @Nullable MailConfigurationService.MailMode emailSetting, @Nullable String smtpServer, @Nullable String smtpPort, @Nullable String smtpUsername, @Nullable String smtpPassword, @Nullable Boolean tlsEnabled, @Nullable String jndiLocation) Update the current mail server configuration@NotNull com.atlassian.mail.server.SMTPMailServer
updateMailServer
(@Nullable String name, @Nullable String fromAddress, @Nullable String subjectPrefix, @Nullable Boolean precedenceBulkHeaderExcluded, @Nullable String emailSetting, @Nullable String smtpServer, @Nullable String smtpPort, @Nullable String smtpUsername, @Nullable String smtpPassword, @Nullable Boolean tlsEnabled, @Nullable String jndiLocation) Deprecated.validateJndiLocation
(@NotNull String jndiLocation) Validates JNDI location for mail server.
-
Method Details
-
isMailServerConfigured
Returns true if mail server configuration exists- Returns:
- boolean true if server configuration exists, false otherwise
- Throws:
UnauthorisedException
- if user does not have appropriate permissions (System Administrator)- Since:
- 6.0
-
getMailServer
@NotNull @NotNull com.atlassian.mail.server.SMTPMailServer getMailServer() throws UnauthorisedException, NotFoundExceptionRetrieve the current mail server configuration- Returns:
- current mail server configuration
- Throws:
UnauthorisedException
- if user does not have appropriate permissions (System Administrator)NotFoundException
- if no mail server configuration is set
-
updateMailServer
@NotNull @NotNull com.atlassian.mail.server.SMTPMailServer updateMailServer(@Nullable @Nullable String name, @Nullable @Nullable String fromAddress, @Nullable @Nullable String subjectPrefix, @Nullable @Nullable Boolean precedenceBulkHeaderExcluded, @Nullable @Nullable MailConfigurationService.MailMode emailSetting, @Nullable @Nullable String smtpServer, @Nullable @Nullable String smtpPort, @Nullable @Nullable String smtpUsername, @Nullable @Nullable String smtpPassword, @Nullable @Nullable Boolean tlsEnabled, @Nullable @Nullable String jndiLocation) throws WebValidationException, UnauthorisedException Update the current mail server configuration- Parameters:
name
- name of the email serverfromAddress
- an email address Bamboo-generated emails are sent from, must be a valid email addresssubjectPrefix
- prefix added to the email subjectprecedenceBulkHeaderExcluded
- whether to exclude "precedence:bulk" email headeremailSetting
- MailMode.JNDI or MailMode.SMTPsmtpServer
- address of SMTP server,null
for JDNIsmtpPort
- port of SMTP server,null
for JNDIsmtpUsername
- user name,null
for JNDIsmtpPassword
- password,null
for JNDItlsEnabled
- whether TLS is enabled,null
for JNDIjndiLocation
- JNDI address specyfing email server,null
for SMTP- Returns:
- SMTPMailServer - mail server configuration after the update
- Throws:
WebValidationException
- if the supplied parameters are invalidUnauthorisedException
- if user does not have appropriate permissions (System Administrator)- Since:
- 6.0
-
updateMailServer
@Deprecated @NotNull @NotNull com.atlassian.mail.server.SMTPMailServer updateMailServer(@Nullable @Nullable String name, @Nullable @Nullable String fromAddress, @Nullable @Nullable String subjectPrefix, @Nullable @Nullable Boolean precedenceBulkHeaderExcluded, @Nullable @Nullable String emailSetting, @Nullable @Nullable String smtpServer, @Nullable @Nullable String smtpPort, @Nullable @Nullable String smtpUsername, @Nullable @Nullable String smtpPassword, @Nullable @Nullable Boolean tlsEnabled, @Nullable @Nullable String jndiLocation) throws WebValidationException, UnauthorisedException Deprecated.Update the current mail server configuration- Parameters:
name
- name of the email serverfromAddress
- an email address Bamboo-generated emails are sent from, must be a valid email addresssubjectPrefix
- prefix added to the email subjectprecedenceBulkHeaderExcluded
- whether to exclude "precedence:bulk" email headeremailSetting
- must be either "JNDI" or "SMTP"smtpServer
- address of SMTP server,null
for "JDNI"smtpPort
- port of SMTP server,null
for "JNDI"smtpUsername
- user name,null
for "JNDI"smtpPassword
- password,null
for "JNDI"tlsEnabled
- whether TLS is enabled,null
for "JNDI"jndiLocation
- JNDI address specyfing email server,null
for "SMTP"- Returns:
- SMTPMailServer - mail server configuration after the update
- Throws:
WebValidationException
- if the supplied parameters are invalidUnauthorisedException
- if user does not have appropriate permissions (System Administrator)
-
deleteMailServer
void deleteMailServer() throws NotFoundException, com.atlassian.mail.MailException, UnauthorisedExceptionDelete the current mail server configuration- Throws:
NotFoundException
- if a mail server is not currently setcom.atlassian.mail.MailException
- if there is an error attempting to delete the current mail configurationUnauthorisedException
- if user does not have appropriate permissions (System Administrator)
-
validateJndiLocation
Validates JNDI location for mail server.This method will not check whether the server can be found under the given location. Only the validity of the location (e.g. that a supported scheme was used) is checked.
- Parameters:
jndiLocation
- JNDI address specifying email server- Returns:
- list of discovered errors, empty if the given JNDI location is valid
-
updateMailServer(String, String, String, Boolean, MailMode, String, String, String, String, Boolean, String)