james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets NotifyPostmaster.java NotifySender.java
Date Fri, 30 Nov 2001 14:00:01 GMT
serge       01/11/30 06:00:01

  Modified:    src/java/org/apache/james/transport/mailets
                        NotifyPostmaster.java NotifySender.java
  Log:
  Patched to deal with case when subject is null.
  
  Revision  Changes    Path
  1.3       +9 -5      jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.java
  
  Index: NotifyPostmaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NotifyPostmaster.java	2001/11/30 11:23:48	1.2
  +++ NotifyPostmaster.java	2001/11/30 14:00:01	1.3
  @@ -30,7 +30,7 @@
    *
    * @author  Serge Knystautas <sergek@lokitech.com>
    * @author  Ivan Seskar <iseskar@upsideweb.com>
  - * @author  Danny Angus <danny@thought.co.uk> 
  + * @author  Danny Angus <danny@thought.co.uk>
    */
   public class NotifyPostmaster extends GenericMailet {
       MailAddress notifier = null;
  @@ -165,10 +165,14 @@
           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());
  +        String subject = message.getSubject();
  +        if (subject == null) {
  +            subject = "";
  +        }
  +        if (subject.indexOf("Re:") == 0){
  +            reply.setSubject(subject);
  +        } else {
  +            reply.setSubject("Re:" + subject);
           }
           reply.setHeader("In-Reply-To", message.getMessageID());
   
  
  
  
  1.3       +8 -4      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/NotifySender.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NotifySender.java	2001/11/30 11:23:48	1.2
  +++ NotifySender.java	2001/11/30 14:00:01	1.3
  @@ -151,10 +151,14 @@
           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());
  +        String subject = message.getSubject();
  +        if (subject == null) {
  +            subject = "";
  +        }
  +        if (subject.indexOf("Re:") == 0){
  +            reply.setSubject(subject);
  +        } else {
  +            reply.setSubject("Re:" + subject);
           }
           reply.setHeader("In-Reply-To", message.getMessageID());
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message