Class PropertiesBasedGreenMailConfigurationBuilder
java.lang.Object
com.icegreen.greenmail.configuration.PropertiesBasedGreenMailConfigurationBuilder
Creates GreenMailConfiguration from properties.
Example usage: GreenMailConfiguration config = new PropertyBasedGreenMailConfigurationBuilder().build(System.getProperties());
- greenmail.users : List of comma separated users of format login:pwd[@domain][,login:pwd[@domain]]
Example: user1:pwd1@localhost,user2:pwd2@0.0.0.0
Note: domain part must be DNS resolvable!
-
greenmail.users.login : Overrides the login for authentication
By default use the local-part of an email. Can be changed to full email.
- greenmail.preload.dir : Preloads emails from filesystem
(see
GreenMailOperations.loadEmails(Path)for expected structure)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDiscard attachments on delivery instead of storing them.static final StringDisables authentication check.static final Stringstatic final Stringstatic final StringProperty for list of users.static final StringOverrides the login for authentication for configured users (@seeGREENMAIL_USERS). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(Properties properties) Builds a configuration object based on given properties.protected StringbuildEmailLogin(String localPart, String domain) protected StringbuildLocalPartLogin(String localPart, String domain) protected voidextractAndAddUser(GreenMailConfiguration configuration, BinaryOperator<String> buildLogin, String user)
-
Field Details
-
GREENMAIL_USERS
-
GREENMAIL_USERS_LOGIN
Overrides the login for authentication for configured users (@seeGREENMAIL_USERS).By default, use the local-part of an email and can be changed to full email (@see UsersLoginConfigurationType.EMAIL).
- See Also:
-
GREENMAIL_AUTH_DISABLED
-
GREENMAIL_SIEVE_IGNORE_DETAIL
- See Also:
-
GREENMAIL_PRELOAD_DIR
- See Also:
-
GREENMAIL_ATTACHMENTS_DISCARD
Discard attachments on delivery instead of storing them.- See Also:
-
-
Constructor Details
-
PropertiesBasedGreenMailConfigurationBuilder
public PropertiesBasedGreenMailConfigurationBuilder()
-
-
Method Details
-
build
Builds a configuration object based on given properties.- Parameters:
properties- the properties.- Returns:
- a configuration and never null.
-
buildEmailLogin
-
buildLocalPartLogin
-
extractAndAddUser
protected void extractAndAddUser(GreenMailConfiguration configuration, BinaryOperator<String> buildLogin, String user)
-