james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serge Knystautas" <ser...@lokitech.com>
Subject Re: cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets NotifyPostmaster.java NotifySender.java
Date Fri, 30 Nov 2001 14:17:39 GMT
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: <danny@apache.org>
To: <jakarta-james-cvs@apache.org>
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 <sergek@lokitech.com>
>     * @author  Ivan Seskar <iseskar@upsideweb.com>
>   + * @author  Danny Angus <danny@thought.co.uk>
>     */
>    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 <sergek@lokitech.com>
>     * @author  Ivan Seskar <iseskar@upsideweb.com>
>   + * @author  Danny Angus <danny@thought.co.uk>
>     */
>    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:james-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:james-dev-help@jakarta.apache.org>
>
>


--
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