Danny, message.getSubject() can be null, so I just added a small patch to catch that case.
Serge Knystautas Loki Technologies - Unstoppable Websites http://www.lokitech.com/ ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 30, 2001 6:23 AM Subject: cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets NotifyPostmaster.java NotifySender.java > danny 01/11/30 03:23:48 > > Modified: src/java/org/apache/james/transport/mailets > NotifyPostmaster.java NotifySender.java > Log: > tidied up two annoyances, date header is now added, and "Re:" is only prepended if it isn't already the first part of the subject. > > Revision Changes Path > 1.2 +10 -1 jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.j ava > > Index: NotifyPostmaster.java > =================================================================== > RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPo stmaster.java,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- NotifyPostmaster.java 2001/05/11 10:01:03 1.1 > +++ NotifyPostmaster.java 2001/11/30 11:23:48 1.2 > @@ -14,6 +14,7 @@ > import org.apache.james.*; > import org.apache.james.transport.*; > import org.apache.mailet.*; > +import org.apache.james.util.RFC822Date; > > /** > * Sends an error message to the sender of a message (that's typically landed in > @@ -29,6 +30,7 @@ > * > * @author Serge Knystautas <[EMAIL PROTECTED]> > * @author Ivan Seskar <[EMAIL PROTECTED]> > + * @author Danny Angus <[EMAIL PROTECTED]> > */ > public class NotifyPostmaster extends GenericMailet { > MailAddress notifier = null; > @@ -160,7 +162,14 @@ > recipients.add(getMailetContext().getPostmaster()); > > //Set additional headers > - reply.setSubject("Re:" + message.getSubject()); > + if (reply.getHeader("Date")==null){ > + reply.setHeader("Date",new RFC822Date().toString()); > + } > + if(message.getSubject().indexOf("Re:")==0){ > + reply.setSubject(message.getSubject()); > + }else{ > + reply.setSubject("Re:" + message.getSubject()); > + } > reply.setHeader("In-Reply-To", message.getMessageID()); > > //Send it off... > > > > 1.2 +10 -1 jakarta-james/src/java/org/apache/james/transport/mailets/NotifySender.java > > Index: NotifySender.java > =================================================================== > RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifySe nder.java,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- NotifySender.java 2001/05/11 10:01:03 1.1 > +++ NotifySender.java 2001/11/30 11:23:48 1.2 > @@ -14,6 +14,7 @@ > import org.apache.james.*; > import org.apache.james.transport.*; > import org.apache.mailet.*; > +import org.apache.james.util.RFC822Date; > > /** > * Sends an error message to the sender of a message (that's typically landed in > @@ -29,6 +30,7 @@ > * > * @author Serge Knystautas <[EMAIL PROTECTED]> > * @author Ivan Seskar <[EMAIL PROTECTED]> > + * @author Danny Angus <[EMAIL PROTECTED]> > */ > public class NotifySender extends GenericMailet { > MailAddress notifier = null; > @@ -146,7 +148,14 @@ > recipients.add(mail.getSender()); > > //Set additional headers > - reply.setSubject("Re:" + message.getSubject()); > + if (reply.getHeader("Date")==null){ > + reply.setHeader("Date",new RFC822Date().toString()); > + } > + if(message.getSubject().indexOf("Re:")==0){ > + reply.setSubject(message.getSubject()); > + }else{ > + reply.setSubject("Re:" + message.getSubject()); > + } > reply.setHeader("In-Reply-To", message.getMessageID()); > > //Send it off... > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
