@@ -73,6 +73,8 @@ import org.apache.tools.mail.MailMessage;
* mail body for a successful build, default is to send the logfile</li>
* mail body for a successful build, default is to send the logfile</li>
* <li> MailLogger.mimeType [default: text/plain] - MIME-Type of email</li>
* <li> MailLogger.mimeType [default: text/plain] - MIME-Type of email</li>
* <li> MailLogger.charset [no default] - character set of email</li>
* <li> MailLogger.charset [no default] - character set of email</li>
* <li> Maillogger.starttls.enable [default: false] - on or true if
* STARTTLS should be supported (requires JavaMail)</li>
* <li> MailLogger.properties.file [no default] - Filename of
* <li> MailLogger.properties.file [no default] - Filename of
* properties file that will override other values.</li>
* properties file that will override other values.</li>
* </ul>
* </ul>
@@ -142,6 +144,8 @@ public class MailLogger extends DefaultLogger {
.password(getValue(properties, "password", ""))
.password(getValue(properties, "password", ""))
.ssl(Project.toBoolean(getValue(properties,
.ssl(Project.toBoolean(getValue(properties,
"ssl", "off")))
"ssl", "off")))
.starttls(Project.toBoolean(getValue(properties,
"starttls.enable", "off")))
.from(getValue(properties, "from", null))
.from(getValue(properties, "from", null))
.replytoList(getValue(properties, "replyto", ""))
.replytoList(getValue(properties, "replyto", ""))
.toList(getValue(properties, prefix + ".to", null))
.toList(getValue(properties, prefix + ".to", null))
@@ -153,7 +157,7 @@ public class MailLogger extends DefaultLogger {
(success) ? "Build Success" : "Build Failure"));
(success) ? "Build Success" : "Build Failure"));
if (values.user().equals("")
if (values.user().equals("")
&& values.password().equals("")
&& values.password().equals("")
&& !values.ssl()) {
&& !values.ssl() && !values.starttls() ) {
sendMail(values, buffer.substring(0));
sendMail(values, buffer.substring(0));
} else {
} else {
sendMimeMail(
sendMimeMail(
@@ -262,6 +266,14 @@ public class MailLogger extends DefaultLogger {
this.body = body;
this.body = body;
return this;
return this;
}
}
private boolean starttls;
public boolean starttls() {
return starttls;
}
public Values starttls(boolean starttls) {
this.starttls = starttls;
return this;
}
}
}
/**
/**
@@ -365,6 +377,7 @@ public class MailLogger extends DefaultLogger {
mailer.setUser(values.user());
mailer.setUser(values.user());
mailer.setPassword(values.password());
mailer.setPassword(values.password());
mailer.setSSL(values.ssl());
mailer.setSSL(values.ssl());
mailer.setEnableStartTLS(values.ssl());
Message mymessage =
Message mymessage =
new Message(values.body().length() > 0 ? values.body() : message);
new Message(values.body().length() > 0 ? values.body() : message);
mymessage.setProject(project);
mymessage.setProject(project);