Class GreenMailConfiguration
- java.lang.Object
-
- com.icegreen.greenmail.configuration.GreenMailConfiguration
-
public class GreenMailConfiguration extends Object
Properties that can be defined to configure a GreenMail instance or GreenMailRule.
-
-
Constructor Summary
Constructors Constructor Description GreenMailConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GreenMailConfigurationaConfig()StringgetPreloadDir()Gets preload directory value or null if not set.List<UserBean>getUsersToCreate()booleanhasPreloadDir()Checks if preload directory value exists.booleanisAuthenticationDisabled()booleanisSieveIgnoreDetailEnabled()GreenMailConfigurationwithDisabledAuthentication()Disables authentication.GreenMailConfigurationwithPreloadDir(String preloadDir)Configures directory path for preloading emails from filesystem.GreenMailConfigurationwithSieveIgnoreDetail()Enables Sieve detail handling, also known as RFC 5233 sub-address extension.GreenMailConfigurationwithUser(String login, String password)The givenGreenMailUserwill be created when servers will start.GreenMailConfigurationwithUser(String email, String login, String password)The givenGreenMailUserwill be created when servers will start.
-
-
-
Method Detail
-
withUser
public GreenMailConfiguration withUser(String login, String password)
The givenGreenMailUserwill be created when servers will start.- Parameters:
login- User id and email addresspassword- Password of user that belongs to login name- Returns:
- Modified configuration
-
withUser
public GreenMailConfiguration withUser(String email, String login, String password)
The givenGreenMailUserwill be created when servers will start.- Parameters:
email- Email addresslogin- Login name of userpassword- Password of user that belongs to login name- Returns:
- Modified configuration
-
aConfig
public static GreenMailConfiguration aConfig()
- Returns:
- New GreenMail configuration
-
getUsersToCreate
public List<UserBean> getUsersToCreate()
- Returns:
- Users that should be created on server startup
-
withDisabledAuthentication
public GreenMailConfiguration withDisabledAuthentication()
Disables authentication.Useful if you want to avoid setting up users up front.
- Returns:
- Modified configuration.
-
isAuthenticationDisabled
public boolean isAuthenticationDisabled()
- Returns:
- true, if authentication is disabled.
- See Also:
withDisabledAuthentication()
-
withSieveIgnoreDetail
public GreenMailConfiguration withSieveIgnoreDetail()
Enables Sieve detail handling, also known as RFC 5233 sub-address extension.- Returns:
- Modified configuration.
-
isSieveIgnoreDetailEnabled
public boolean isSieveIgnoreDetailEnabled()
- Returns:
- true, if Sieve detail handling is enabled.
- See Also:
()
-
withPreloadDir
public GreenMailConfiguration withPreloadDir(String preloadDir)
Configures directory path for preloading emails from filesystem.- Parameters:
preloadDir- directory containing emails- Returns:
- Modified configuration.
- See Also:
GreenMailOperations.loadEmails(Path)
-
getPreloadDir
public String getPreloadDir()
Gets preload directory value or null if not set.- Returns:
- the directory
-
hasPreloadDir
public boolean hasPreloadDir()
Checks if preload directory value exists.- Returns:
- true if available
-
-