You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2008/10/15 21:34:49 UTC
svn commit: r705003 - in /logging/log4j/trunk/src: changes/changes.xml
main/java/org/apache/log4j/net/SMTPAppender.java
Author: carnold
Date: Wed Oct 15 12:34:49 2008
New Revision: 705003
URL: http://svn.apache.org/viewvc?rev=705003&view=rev
Log:
Bug 45990: SMTPAppender to support ReplyTo
Modified:
logging/log4j/trunk/src/changes/changes.xml
logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java
Modified: logging/log4j/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=705003&r1=705002&r2=705003&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Wed Oct 15 12:34:49 2008
@@ -60,12 +60,13 @@
<action action="fix" issue="45635">Support -Dm2_repo option on Maven build for non-default Maven repository location.</action>
<action action="fix" issue="45636">2 tests for DateLayout are failing because of ill initialized DateFormat.</action>
<action action="fix" issue="45659">Incorrect user mailing list URL.</action>
- <action action="fix" issue="44386">NTEventLogAppender.dll for 64-bit editions for Microsoft Windows.</action>
- <action action="fix" issue="45721">Add configuration of ThrowableRenderers and add org.apache.log4j.EnhancedThrowableRenderer.</action>
+ <action action="add" issue="44386">NTEventLogAppender.dll for 64-bit editions for Microsoft Windows.</action>
+ <action action="add" issue="45721">Add configuration of ThrowableRenderers and add org.apache.log4j.EnhancedThrowableRenderer.</action>
<action action="fix" issue="45969">SMTPAppender does not force evaluation of message at request time</action>
- <action action="fix" issue="25355">Support SSL transport in SMTPAppender</action>
- <action action="fix" issue="45980">SMTPAppender should have a sendOnClose option</action>
+ <action action="add" issue="25355">Support SSL transport in SMTPAppender</action>
+ <action action="add" issue="45980">SMTPAppender should have a sendOnClose option</action>
<action action="fix" issue="45982">Support %X layout specification to output all MDC key-value pairs</action>
+ <action action="add" issue="45990">Add replyTo attribute to SMTPAppender</action>
</release>
Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java?rev=705003&r1=705002&r2=705003&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java Wed Oct 15 12:34:49 2008
@@ -83,6 +83,10 @@
*/
private String bcc;
private String from;
+ /**
+ * Comma separated list of replyTo addresses.
+ */
+ private String replyTo;
private String subject;
private String smtpHost;
private String smtpUsername;
@@ -155,6 +159,11 @@
msg.setFrom();
}
+ //Add ReplyTo addresses if defined.
+ if (replyTo != null && replyTo.length() > 0) {
+ msg.setReplyTo(parseAddress(replyTo));
+ }
+
if (to != null && to.length() > 0) {
msg.setRecipients(Message.RecipientType.TO, parseAddress(to));
}
@@ -380,6 +389,16 @@
}
/**
+ Get the reply addresses.
+ @return reply addresses as comma separated string, may be null.
+ @since 1.2.16
+ */
+ public
+ String getReplyTo() {
+ return replyTo;
+ }
+
+ /**
Returns value of the <b>Subject</b> option.
*/
public
@@ -397,6 +416,17 @@
}
/**
+ Set the e-mail addresses to which replies should be directed.
+ @param addresses reply addresses as comma separated string, may be null.
+ @since 1.2.16
+ */
+ public
+ void setReplyTo(final String addresses) {
+ this.replyTo = addresses;
+ }
+
+
+ /**
The <b>Subject</b> option takes a string value which should be a
the subject of the e-mail message.
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org