diff -rup --exclude '*.git*' /home/eidzerda/Downloads/OpenDJ-2.6.2-src/resource/config/config.ldif ./resource/config/config.ldif --- /home/eidzerda/Downloads/OpenDJ-2.6.2-src/resource/config/config.ldif 2015-04-30 16:22:58.298600800 -0400 +++ ./resource/config/config.ldif 2015-04-30 16:00:46.837936100 -0400 @@ -130,6 +130,7 @@ ds-cfg-enabled: false ds-cfg-sender-address: opends-notifications@example.com ds-cfg-email-address-attribute-type: mail ds-cfg-send-message-without-end-user-address: false +ds-cfg-send-email-as-html: false ds-cfg-message-template-file: account-temporarily-locked:config/messages/account-temporarily-locked.template ds-cfg-message-template-file: account-permanently-locked:config/messages/account-permanently-locked.template ds-cfg-message-template-file: account-unlocked:config/messages/account-unlocked.template diff -rup --exclude '*.git*' /home/eidzerda/Downloads/OpenDJ-2.6.2-src/resource/schema/02-config.ldif ./resource/schema/02-config.ldif --- /home/eidzerda/Downloads/OpenDJ-2.6.2-src/resource/schema/02-config.ldif 2015-04-30 16:23:07.202491100 -0400 +++ ./resource/schema/02-config.ldif 2015-04-30 16:05:13.398940000 -0400 @@ -2367,6 +2367,12 @@ attributeTypes: ( 1.3.6.1.4.1.26027.1.1. SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'OpenDS Directory Server' ) +attributeTypes: ( 1.3.6.1.4.1.26027.1.1.472 + NAME 'ds-cfg-send-email-as-html' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 + SINGLE-VALUE + X-ORIGIN 'OpenDS Directory Server' ) attributeTypes: ( 1.3.6.1.4.1.26027.1.1.404 NAME 'ds-cfg-message-template-file' EQUALITY caseIgnoreMatch @@ -5021,7 +5027,8 @@ objectClasses: ( 1.3.6.1.4.1.26027.1.2.1 STRUCTURAL MUST ( ds-cfg-sender-address $ ds-cfg-send-message-without-end-user-address $ - ds-cfg-message-template-file ) + ds-cfg-message-template-file $ + ds-cfg-send-email-as-html ) MAY ( ds-cfg-email-address-attribute-type $ ds-cfg-recipient-address $ ds-cfg-message-subject ) diff -rup --exclude '*.git*' /home/eidzerda/Downloads/OpenDJ-2.6.2-src/src/admin/defn/org/opends/server/admin/std/SMTPAccountStatusNotificationHandlerConfiguration.xml ./src/admin/defn/org/opends/server/admin/std/SMTPAccountStatusNotificationHandlerConfiguration.xml --- /home/eidzerda/Downloads/OpenDJ-2.6.2-src/src/admin/defn/org/opends/server/admin/std/SMTPAccountStatusNotificationHandlerConfiguration.xml 2015-04-30 16:23:11.970566700 -0400 +++ ./src/admin/defn/org/opends/server/admin/std/SMTPAccountStatusNotificationHandlerConfiguration.xml 2015-04-30 12:43:07.356893900 -0400 @@ -145,6 +145,32 @@ + + + Indicates whether an email notification message should be + as HTML + + + If this value is true, email notification messages are marked as text/html. + Otherwise outgoing email messages are assumed to be plaintext and marked as text/plain. + + + + false + + + + + + + + + ds-cfg-send-email-as-html + + + + Specifies the email address from which the message is sent. Only in ./src/admin/generated: org Only in ./src/messages/generated: org diff -rup --exclude '*.git*' /home/eidzerda/Downloads/OpenDJ-2.6.2-src/src/server/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java ./src/server/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java --- /home/eidzerda/Downloads/OpenDJ-2.6.2-src/src/server/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java 2015-04-30 16:24:28.113761700 -0400 +++ ./src/server/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java 2015-04-30 16:06:02.519448800 -0400 @@ -106,6 +106,7 @@ public class SMTPAccountStatusNotificati */ private static final DebugTracer TRACER = getTracer(); + private Boolean sendEmailAsHtml; // A mapping between the notification types and the message template. @@ -144,6 +145,8 @@ public class SMTPAccountStatusNotificati subjectMap = parseSubjects(configuration); templateMap = parseTemplates(configuration); + sendEmailAsHtml = configuration.isSendEmailAsHtml(); + // Make sure that the Directory Server is configured with information about // one or more mail servers. List propList = DirectoryServer.getMailServerPropertySets(); @@ -662,6 +665,11 @@ public class SMTPAccountStatusNotificati EMailMessage message = new EMailMessage(config.getSenderAddress(), recipients, subject); message.setBody(messageBody); + + if (sendEmailAsHtml) + { + message.setBodyMIMEType("text/html"); + } if (debugEnabled()) { TRACER.debugInfo("Set message body of " + messageBody.toString()); @@ -777,6 +785,7 @@ public class SMTPAccountStatusNotificati currentConfig = configuration; subjectMap = subjects; templateMap = templates; + sendEmailAsHtml = configuration.isSendEmailAsHtml(); return new ConfigChangeResult(ResultCode.SUCCESS, false); } catch (ConfigException ce) Only in ./src/server/org/opends/server/util: DynamicConstants.java diff -rup --exclude '*.git*' /home/eidzerda/Downloads/OpenDJ-2.6.2-src/src/server/org/opends/server/util/EMailMessage.java ./src/server/org/opends/server/util/EMailMessage.java --- /home/eidzerda/Downloads/OpenDJ-2.6.2-src/src/server/org/opends/server/util/EMailMessage.java 2015-04-30 16:24:52.176563100 -0400 +++ ./src/server/org/opends/server/util/EMailMessage.java 2015-04-30 16:34:17.324787600 -0400 @@ -146,6 +146,22 @@ public final class EMailMessage } + /** + * Retrieves the MIME Type for the body of this message + * + * @return The MIME Type for this message + */ + public String getBodyMIMEType() { return bodyMIMEType; } + + + + /** + * Specifies the MIME Type for the body of this message + * + * @param bodyMIMEType The MIME Type for this message + */ + public void setBodyMIMEType(String bodyMIMEType) { this.bodyMIMEType = bodyMIMEType; } + /** * Retrieves the sender for this message. @@ -442,7 +458,7 @@ public final class EMailMessage // multipart. Otherwise, just set the text of the message. if (attachments.isEmpty()) { - message.setText(body.toString()); + message.setContent(body.toString(), bodyMIMEType); } else {