-
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#320: added byDefault S/MIME signing on the Mailer level. Also, the s…
…mime properties are not set on Email anymore but on Mailer. S/MIME signing can be overridden on a per/Email basis. Consolidated all such properties (email validation criteria, S/MIME default signing, DKIM in the future as well) in new mailer level config object called EmailGovernance.
- Loading branch information
Showing
20 changed files
with
422 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
modules/core-module/src/main/java/org/simplejavamail/api/mailer/config/EmailGovernance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.simplejavamail.api.mailer.config; | ||
|
||
import org.hazlewood.connor.bottema.emailaddress.EmailAddressCriteria; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.simplejavamail.api.email.EmailPopulatingBuilder; | ||
import org.simplejavamail.api.mailer.MailerGenericBuilder; | ||
|
||
import java.io.InputStream; | ||
import java.util.EnumSet; | ||
|
||
/** | ||
* Governance for all emails being sent through the current {@link org.simplejavamail.api.mailer.Mailer} instance. | ||
* <p> | ||
* In simpeler terms: this class represents actions taken or configuration used by default for each individual email sent through the current mailer. For example, you might want to S/MIME sign all | ||
* emails by default. You can do it manually on each email of course, but then the keystore used for this not reused. | ||
*/ | ||
public interface EmailGovernance { | ||
|
||
/** | ||
* @return The effective validation criteria used for email validation. Returns an empty set if no validation should be done. | ||
* @see MailerGenericBuilder#withEmailAddressCriteria(EnumSet) | ||
* @see EmailAddressCriteria | ||
*/ | ||
@NotNull | ||
EnumSet<EmailAddressCriteria> getEmailAddressCriteria(); | ||
|
||
/** | ||
* @see EmailPopulatingBuilder#signWithSmime(Pkcs12Config) | ||
* @see EmailPopulatingBuilder#signWithSmime(InputStream, String, String, String) | ||
* @see MailerGenericBuilder#signByDefaultWithSmime(Pkcs12Config) | ||
* @see MailerGenericBuilder#signByDefaultWithSmime(InputStream, String, String, String) | ||
*/ | ||
@Nullable | ||
Pkcs12Config getPkcs12ConfigForSmimeSigning(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.