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-10-27 15:12:22.274013700 -0400 @@ -23,6 +23,7 @@ # Copyright 2006-2010 Sun Microsystems, Inc. # Portions Copyright 2010-2014 ForgeRock AS. # Portions Copyright 2012-2013 Manuel Gaupp +# Portions Copyright 2015 Edan Idzerda # # # This file contains the primary Directory Server configuration. It must not @@ -130,6 +131,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-10-27 15:13:47.778563300 -0400 @@ -25,7 +25,7 @@ # Portions Copyright 2010-2014 ForgeRock AS. # Portions Copyright 2011 profiq, s.r.o. # Portions Copyright 2012 Manuel Gaupp -# +# Portions Copyright 2015 Edan Idzerda # # This file contains the attribute type and objectclass definitions for use # with the Directory Server configuration. @@ -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-10-27 15:15:48.246608900 -0400 @@ -25,6 +25,7 @@ ! ! Copyright 2007-2008 Sun Microsystems, Inc. ! Portions Copyright 2011 ForgeRock AS + ! Portions Copyright 2015 Edan Idzerda ! --> + + + 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-10-27 15:35:02.606033300 -0400 @@ -23,6 +23,7 @@ * * * Copyright 2008 Sun Microsystems, Inc. + * Copyright 2015 Edan Idzerda */ package org.opends.server.extensions; @@ -106,6 +107,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 +146,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 +666,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 +786,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-10-27 15:14:14.394224600 -0400 @@ -24,6 +24,7 @@ * * * Copyright 2006-2008 Sun Microsystems, Inc. + * Portions copyright 2015 Edan Idzerda */ package org.opends.server.util; @@ -146,6 +147,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 +459,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 {