Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/EmailModuleWithTemplates/[App Store] Email template.mpr
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public class SendEmail extends CustomJavaAction<java.lang.Boolean>
private java.lang.Boolean UseSSL;
private java.lang.Boolean UseTLS;
private java.lang.String FromDisplayName;
private java.lang.Boolean UseSSLCheckIdentity;

public SendEmail(IContext context, java.lang.String SMTPHost, java.lang.String SMTPUserName, java.lang.String SMTPPassword, java.lang.String CCAddresses, java.lang.String BCCAddresses, java.lang.String ToAddresses, java.lang.String FromAddress, java.lang.String ReplyToAddress, java.lang.String HtmlBody, java.lang.String PlainBody, java.lang.String Subject, java.lang.Long SMTPPort, java.util.List<IMendixObject> AttachmentList, java.util.List<IMendixObject> HeaderList, java.lang.Boolean UseSSL, java.lang.Boolean UseTLS, java.lang.String FromDisplayName)
public SendEmail(IContext context, java.lang.String SMTPHost, java.lang.String SMTPUserName, java.lang.String SMTPPassword, java.lang.String CCAddresses, java.lang.String BCCAddresses, java.lang.String ToAddresses, java.lang.String FromAddress, java.lang.String ReplyToAddress, java.lang.String HtmlBody, java.lang.String PlainBody, java.lang.String Subject, java.lang.Long SMTPPort, java.util.List<IMendixObject> AttachmentList, java.util.List<IMendixObject> HeaderList, java.lang.Boolean UseSSL, java.lang.Boolean UseTLS, java.lang.String FromDisplayName, java.lang.Boolean UseSSLCheckIdentity)
{
super(context);
this.SMTPHost = SMTPHost;
Expand All @@ -64,6 +65,7 @@ public SendEmail(IContext context, java.lang.String SMTPHost, java.lang.String S
this.UseSSL = UseSSL;
this.UseTLS = UseTLS;
this.FromDisplayName = FromDisplayName;
this.UseSSLCheckIdentity = UseSSLCheckIdentity;
}

@java.lang.Override
Expand Down Expand Up @@ -110,6 +112,7 @@ public java.lang.Boolean executeAction() throws Exception
config.setUserPass((this.SMTPPassword != null ? this.SMTPPassword : ""));
config.setUseSSLSMTP(this.UseSSL);
config.setUseTLSSMTP(this.UseTLS);
config.setUseSSLCheckServerIdentity(this.UseSSLCheckIdentity);

String separator = (String) emailtemplate.proxies.constants.Constants.getEmailAddressSeparator();
if (separator == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class SMTPConfiguration

private boolean useSSLSMTP;
private boolean useTLSSMTP;
private boolean useSSLCheckServerIdentity;

private String fromAddress;
private String fromDisplayName;
Expand All @@ -20,6 +21,7 @@ public SMTPConfiguration()
// Basic configuration
this.useSSLSMTP = false;
this.useTLSSMTP = false;
this.useSSLCheckServerIdentity = false;
this.SMTPPort = 25;
this.SMTPHost = "";
this.userName = "";
Expand All @@ -29,6 +31,16 @@ public SMTPConfiguration()
this.replyToAddress = "";
}

public boolean useSSLCheckServerIdentity()
{
return this.useSSLCheckServerIdentity;
}

public void setUseSSLCheckServerIdentity(boolean useSSLCheckServerIdentity)
{
this.useSSLCheckServerIdentity = useSSLCheckServerIdentity;
}

public boolean useSSLSMTP()
{
return this.useSSLSMTP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ private void setConnectionInfo(Email mail, SMTPConfiguration configuration)
mail.setStartTLSEnabled(true);
}

mail.setSSLCheckServerIdentity(configuration.useSSLCheckServerIdentity());

/* because the default session mechanisms uses System.getProperties() (which is not allowed
* in the cloud), we need to construct a session ourselves. The code to do this was lifted
* from Email.java in the commons-email package.
Expand Down