james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgoldst...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/transport/matchers NESSpamCheck.java RelayLimit.java
Date Sat, 14 Sep 2002 06:22:37 GMT
pgoldstein    2002/09/13 23:22:37

  Modified:    src/java/org/apache/james James.java
               src/java/org/apache/james/core MailHeaders.java
                        MailImpl.java MimeMessageWrapper.java
               src/java/org/apache/james/transport/mailets
                        GenericListserv.java NotifyPostmaster.java
                        NotifySender.java Redirect.java
               src/java/org/apache/james/transport/matchers
                        NESSpamCheck.java RelayLimit.java
  Added:       src/java/org/apache/james/util RFC2822Headers.java
  Log:
  Removing "magic strings" by localizing header names in a single class.
  
  Revision  Changes    Path
  1.1                  jakarta-james/src/java/org/apache/james/util/RFC2822Headers.java
  
  Index: RFC2822Headers.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.util;
  
  /**
   * This utility class provides the set of header names explicitly defined in RFC 2822
   *
   * @author Peter M. Goldstein <farsight@alum.mit.edu>
   */
  public class RFC2822Headers  {
  
      // See Section 3.6.1 of RFC 2822
  
      /**
       * The name of the RFC 2822 header that stores the mail date.
       */
      public final static String DATE = "Date";
  
      // See Section 3.6.2 of RFC 2822
  
      /**
       * The name of the RFC 2822 header that stores the mail author(s).
       */
      public final static String FROM = "From";
  
      /**
       * The name of the RFC 2822 header that stores the actual mail transmission agent,
       * if this differs from the author of the message.
       */
      public final static String SENDER = "Sender";
  
      /**
       * The name of the RFC 2822 header that stores the reply-to address.
       */
      public final static String REPLY_TO = "Reply-To";
  
      // See Section 3.6.3 of RFC 2822
  
      /**
       * The name of the RFC 2822 header that stores the primary mail recipients.
       */
      public final static String TO = "To";
  
      /**
       * The name of the RFC 2822 header that stores the carbon copied mail recipients.
       */
      public final static String CC = "Cc";
  
      /**
       * The name of the RFC 2822 header that stores the blind carbon copied mail recipients.
       */
      public final static String BCC = "Bcc";
  
      // See Section 3.6.4 of RFC 2822
  
      /**
       * The name of the RFC 2822 header that stores the message id.
       */
      public final static String MESSAGE_ID = "Message-ID";
  
      /**
       * A common variation on the name of the RFC 2822 header that 
       * stores the message id.  This is needed for certain filters and
       * processing of incoming mail.
       */
      public final static String MESSAGE_ID_VARIATION = "Message-Id";
  
      /**
       * The name of the RFC 2822 header that stores the message id of the message
       * that to which this email is a reply.
       */
      public final static String IN_REPLY_TO = "In-Reply-To";
  
      /**
       * The name of the RFC 2822 header that is used to identify the thread to
       * which this message refers.
       */
      public final static String REFERENCES = "References";
  
      // See Section 3.6.5 of RFC 2822
  
      /**
       * The name of the RFC 2822 header that stores the subject.
       */
      public final static String SUBJECT = "Subject";
  
      /**
       * The name of the RFC 2822 header that stores human-readable comments.
       */
      public final static String COMMENTS = "Comments";
  
      /**
       * The name of the RFC 2822 header that stores human-readable keywords.
       */
      public final static String KEYWORDS = "Keywords";
  
      // See Section 3.6.6 of RFC 2822
  
      /**
       * The name of the RFC 2822 header that stores the date the message was resent.
       */
      public final static String RESENT_DATE = "Resent-Date";
  
      /**
       * The name of the RFC 2822 header that stores the originator of the resent message.
       */
      public final static String RESENT_FROM = "Resent-From";
  
      /**
       * The name of the RFC 2822 header that stores the transmission agent
       * of the resent message.
       */
      public final static String RESENT_SENDER = "Resent-Sender";
  
      /**
       * The name of the RFC 2822 header that stores the recipients
       * of the resent message.
       */
      public final static String RESENT_TO = "Resent-To";
  
      /**
       * The name of the RFC 2822 header that stores the carbon copied recipients
       * of the resent message.
       */
      public final static String RESENT_CC = "Resent-Cc";
  
      /**
       * The name of the RFC 2822 header that stores the blind carbon copied recipients
       * of the resent message.
       */
      public final static String RESENT_BCC = "Resent-Bcc";
  
      /**
       * The name of the RFC 2822 header that stores the message id
       * of the resent message.
       */
      public final static String RESENT_MESSAGE_ID = "Resent-Message-ID";
  
      // See Section 3.6.7 of RFC 2822
  
      /**
       * The name of the RFC 2822 headers that store the tracing data for the return path.
       */
      public final static String RETURN_PATH = "Return-Path";
  
      /**
       * The name of the RFC 2822 headers that store additional tracing data.
       */
      public final static String RECEIVED = "Received";
  
      // MIME headers
  
      /**
       * The name of the MIME header that stores the content type.
       */
      public final static String CONTENT_TYPE = "Content-Type";
  
      /**
       * Private constructor to prevent instantiation
       */
      private RFC2822Headers() {}
  
  }
  
  
  
  1.31      +9 -8      jakarta-james/src/java/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/James.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- James.java	11 Sep 2002 08:31:07 -0000	1.30
  +++ James.java	14 Sep 2002 06:22:36 -0000	1.31
  @@ -22,6 +22,7 @@
   import org.apache.james.core.MailImpl;
   import org.apache.james.services.*;
   import org.apache.james.userrepository.DefaultJamesUser;
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.james.util.RFC822DateFormat;
   import org.apache.mailet.Mail;
   import org.apache.mailet.MailAddress;
  @@ -625,9 +626,9 @@
           //Create the reply message
           MimeMessage reply = (MimeMessage) orig.reply(false);
           //If there is a Return-Path header,
  -        if (orig.getHeader("Return-Path") != null) {
  +        if (orig.getHeader(RFC2822Headers.RETURN_PATH) != null) {
               //Return the message to that address, not to the Reply-To address
  -            reply.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(orig.getHeader("Return-Path")[0]));
  +            reply.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(orig.getHeader(RFC2822Headers.RETURN_PATH)[0]));
           }
           //Create the list of recipients in our MailAddress format
           Collection recipients = new HashSet();
  @@ -643,17 +644,17 @@
               //Add message as the first mime body part
               MimeBodyPart part = new MimeBodyPart();
               part.setContent(message, "text/plain");
  -            part.setHeader("Content-Type", "text/plain");
  +            part.setHeader(RFC2822Headers.CONTENT_TYPE, "text/plain");
               multipart.addBodyPart(part);
   
               //Add the original message as the second mime body part
               part = new MimeBodyPart();
               part.setContent(orig.getContent(), orig.getContentType());
  -            part.setHeader("Content-Type", orig.getContentType());
  +            part.setHeader(RFC2822Headers.CONTENT_TYPE, orig.getContentType());
               multipart.addBodyPart(part);
  -            reply.setHeader("Date", rfc822DateFormat.format(new Date()));
  +            reply.setHeader(RFC2822Headers.DATE, rfc822DateFormat.format(new Date()));
               reply.setContent(multipart);
  -            reply.setHeader("Content-Type", multipart.getContentType());
  +            reply.setHeader(RFC2822Headers.CONTENT_TYPE, multipart.getContentType());
           } catch (IOException ioe) {
               throw new MessagingException("Unable to create multipart body", ioe);
           }
  
  
  
  1.4       +3 -1      jakarta-james/src/java/org/apache/james/core/MailHeaders.java
  
  Index: MailHeaders.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MailHeaders.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MailHeaders.java	17 Aug 2002 18:16:24 -0000	1.3
  +++ MailHeaders.java	14 Sep 2002 06:22:36 -0000	1.4
  @@ -12,6 +12,8 @@
   import java.io.*;
   import java.util.Enumeration;
   
  +import org.apache.james.util.RFC2822Headers;
  +
   /**
    * This interface defines a container for mail headers. Each header must use
    * MIME format: <pre>name: value</pre>.
  @@ -96,6 +98,6 @@
        * @return true if the headers are present, false otherwise
        */
       public boolean isValid() {
  -        return (isSet("Date") && isSet("To") && isSet("From"));
  +        return (isSet(RFC2822Headers.DATE) && isSet(RFC2822Headers.TO) &&
isSet(RFC2822Headers.FROM));
       }
   }
  
  
  
  1.14      +3 -1      jakarta-james/src/java/org/apache/james/core/MailImpl.java
  
  Index: MailImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MailImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MailImpl.java	17 Aug 2002 18:16:24 -0000	1.13
  +++ MailImpl.java	14 Sep 2002 06:22:36 -0000	1.14
  @@ -7,6 +7,8 @@
    */
   package org.apache.james.core;
   
  +import org.apache.james.util.RFC2822Headers;
  +
   import org.apache.mailet.Mail;
   import org.apache.mailet.MailAddress;
   
  @@ -399,7 +401,7 @@
           reply.setRecipients(Message.RecipientType.TO, addr);
           reply.setFrom(new InternetAddress(getRecipients().iterator().next().toString()));
           reply.setText(bounceText);
  -        reply.setHeader("Message-Id", "replyTo-" + getName());
  +        reply.setHeader(RFC2822Headers.MESSAGE_ID, "replyTo-" + getName());
   
           return new MailImpl("replyTo-" + getName(), new MailAddress(getRecipients().iterator().next().toString()),
recipients, reply);
       }
  
  
  
  1.14      +8 -7      jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java
  
  Index: MimeMessageWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MimeMessageWrapper.java	19 Aug 2002 18:57:07 -0000	1.13
  +++ MimeMessageWrapper.java	14 Sep 2002 06:22:36 -0000	1.14
  @@ -16,6 +16,7 @@
   import java.util.Enumeration;
   import java.util.Vector;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.james.util.RFC822DateFormat;
   
   /**
  @@ -269,9 +270,9 @@
           if (headers == null) {
               loadHeaders();
           }
  -        Address from[] = getAddressHeader("From");
  +        Address from[] = getAddressHeader(RFC2822Headers.FROM);
           if(from == null) {
  -            from = getAddressHeader("Sender");
  +            from = getAddressHeader(RFC2822Headers.SENDER);
           }
           return from;
       }
  @@ -332,7 +333,7 @@
           if (headers == null) {
               loadHeaders();
           }
  -        Address replyTo[] = getAddressHeader("Reply-To");
  +        Address replyTo[] = getAddressHeader(RFC2822Headers.REPLY_TO);
           if(replyTo == null) {
               replyTo = getFrom();
           }
  @@ -343,7 +344,7 @@
           if (headers == null) {
               loadHeaders();
           }
  -        String subject = getHeader("Subject", null);
  +        String subject = getHeader(RFC2822Headers.SUBJECT, null);
           if (subject == null) {
               return null;
           }
  @@ -358,7 +359,7 @@
           if (headers == null) {
               loadHeaders();
           }
  -        String header = getHeader("Date", null);
  +        String header = getHeader(RFC2822Headers.DATE, null);
           if(header != null) {
               try {
                   return mailDateFormat.parse(header);
  @@ -443,7 +444,7 @@
           if (headers == null) {
               loadHeaders();
           }
  -        String value = getHeader("Content-Type", null);
  +        String value = getHeader(RFC2822Headers.CONTENT_TYPE, null);
           if (value == null) {
               return "text/plain";
           } else {
  @@ -504,7 +505,7 @@
           if (headers == null) {
               loadHeaders();
           }
  -        return getHeader("Message-ID", null);
  +        return getHeader(RFC2822Headers.MESSAGE_ID, null);
       }
   
       public String getFileName() throws MessagingException {
  
  
  
  1.10      +3 -2      jakarta-james/src/java/org/apache/james/transport/mailets/GenericListserv.java
  
  Index: GenericListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/GenericListserv.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- GenericListserv.java	23 Aug 2002 07:48:31 -0000	1.9
  +++ GenericListserv.java	14 Sep 2002 06:22:36 -0000	1.10
  @@ -7,6 +7,7 @@
    */
   package org.apache.james.transport.mailets;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.mailet.GenericMailet;
   import org.apache.mailet.Mail;
   import org.apache.mailet.MailAddress;
  @@ -98,7 +99,7 @@
               //Create a copy of this message to send out
               MimeMessage message = new MimeMessage(mail.getMessage());
               //We need to remove this header from the copy we're sending around
  -            message.removeHeader("Return-Path");
  +            message.removeHeader(RFC2822Headers.RETURN_PATH);
   
               //Figure out the listserv address.
               MailAddress listservAddr = getListservAddress();
  @@ -161,7 +162,7 @@
   
               //If replies should go to this list, we need to set the header
               if (isReplyToList()) {
  -                message.setHeader("Reply-To", listservAddr.toString());
  +                message.setHeader(RFC2822Headers.REPLY_TO, listservAddr.toString());
               }
               //We're going to set this special header to avoid bounces
               //  getting sent back out to the list
  
  
  
  1.8       +8 -7      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- NotifyPostmaster.java	23 Aug 2002 08:00:29 -0000	1.7
  +++ NotifyPostmaster.java	14 Sep 2002 06:22:37 -0000	1.8
  @@ -7,6 +7,7 @@
    */
   package org.apache.james.transport.mailets;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.james.util.RFC822DateFormat;
   import org.apache.mailet.GenericMailet;
   import org.apache.mailet.Mail;
  @@ -175,25 +176,25 @@
               //Add message as the first mime body part
               MimeBodyPart part = new MimeBodyPart();
               part.setContent(sout.toString(), "text/plain");
  -            part.setHeader("Content-Type", "text/plain");
  +            part.setHeader(RFC2822Headers.CONTENT_TYPE, "text/plain");
               multipart.addBodyPart(part);
   
               //Add the original message as the second mime body part
               part = new MimeBodyPart();
               part.setContent(message.getContent(), message.getContentType());
  -            part.setHeader("Content-Type", message.getContentType());
  +            part.setHeader(RFC2822Headers.CONTENT_TYPE, message.getContentType());
               multipart.addBodyPart(part);
   
               //if set, attach the full stack trace
               if (attachStackTrace && mail.getErrorMessage() != null) {
                   part = new MimeBodyPart();
                   part.setContent(mail.getErrorMessage(), "text/plain");
  -                part.setHeader("Content-Type", "text/plain");
  +                part.setHeader(RFC2822Headers.CONTENT_TYPE, "text/plain");
                   multipart.addBodyPart(part);
               }
   
               reply.setContent(multipart);
  -            reply.setHeader("Content-Type", multipart.getContentType());
  +            reply.setHeader(RFC2822Headers.CONTENT_TYPE, multipart.getContentType());
           } catch (IOException ioe) {
               throw new MailetException("Unable to create multipart body");
           }
  @@ -203,8 +204,8 @@
           recipients.add(getMailetContext().getPostmaster());
   
           //Set additional headers
  -        if (reply.getHeader("Date")==null){
  -            reply.setHeader("Date", rfc822DateFormat.format(new Date()));
  +        if (reply.getHeader(RFC2822Headers.DATE)==null){
  +            reply.setHeader(RFC2822Headers.DATE, rfc822DateFormat.format(new Date()));
           }
           String subject = message.getSubject();
           if (subject == null) {
  @@ -215,7 +216,7 @@
           } else {
               reply.setSubject("Re:" + subject);
           }
  -        reply.setHeader("In-Reply-To", message.getMessageID());
  +        reply.setHeader(RFC2822Headers.IN_REPLY_TO, message.getMessageID());
   
           //Send it off...
           getMailetContext().sendMail(notifier, recipients, reply);
  
  
  
  1.9       +8 -7      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NotifySender.java	23 Aug 2002 08:00:29 -0000	1.8
  +++ NotifySender.java	14 Sep 2002 06:22:37 -0000	1.9
  @@ -7,6 +7,7 @@
    */
   package org.apache.james.transport.mailets;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.james.util.RFC822DateFormat;
   import org.apache.mailet.GenericMailet;
   import org.apache.mailet.Mail;
  @@ -160,25 +161,25 @@
               //Add message as the first mime body part
               MimeBodyPart part = new MimeBodyPart();
               part.setContent(sout.toString(), "text/plain");
  -            part.setHeader("Content-Type", "text/plain");
  +            part.setHeader(RFC2822Headers.CONTENT_TYPE, "text/plain");
               multipart.addBodyPart(part);
   
               //Add the original message as the second mime body part
               part = new MimeBodyPart();
               part.setContent(message.getContent(), message.getContentType());
  -            part.setHeader("Content-Type", message.getContentType());
  +            part.setHeader(RFC2822Headers.CONTENT_TYPE, message.getContentType());
               multipart.addBodyPart(part);
   
               //if set, attach the full stack trace
               if (attachStackTrace && mail.getErrorMessage() != null) {
                   part = new MimeBodyPart();
                   part.setContent(mail.getErrorMessage(), "text/plain");
  -                part.setHeader("Content-Type", "text/plain");
  +                part.setHeader(RFC2822Headers.CONTENT_TYPE, "text/plain");
                   multipart.addBodyPart(part);
               }
   
               reply.setContent(multipart);
  -            reply.setHeader("Content-Type", multipart.getContentType());
  +            reply.setHeader(RFC2822Headers.CONTENT_TYPE, multipart.getContentType());
           } catch (IOException ioe) {
               throw new MailetException("Unable to create multipart body");
           }
  @@ -188,8 +189,8 @@
           recipients.add(mail.getSender());
   
           //Set additional headers
  -        if (reply.getHeader("Date")==null){
  -            reply.setHeader("Date", rfc822DateFormat.format(new Date()));
  +        if (reply.getHeader(RFC2822Headers.DATE)==null){
  +            reply.setHeader(RFC2822Headers.DATE, rfc822DateFormat.format(new Date()));
           }
           String subject = message.getSubject();
           if (subject == null) {
  @@ -200,7 +201,7 @@
           } else {
               reply.setSubject("Re:" + subject);
           }
  -        reply.setHeader("In-Reply-To", message.getMessageID());
  +        reply.setHeader(RFC2822Headers.IN_REPLY_TO, message.getMessageID());
   
           //Send it off...
           getMailetContext().sendMail(notifier, recipients, reply);
  
  
  
  1.14      +5 -4      jakarta-james/src/java/org/apache/james/transport/mailets/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Redirect.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Redirect.java	10 Sep 2002 20:47:56 -0000	1.13
  +++ Redirect.java	14 Sep 2002 06:22:37 -0000	1.14
  @@ -28,6 +28,7 @@
   import javax.mail.internet.MimeMessage;
   import javax.mail.internet.MimeMultipart;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.james.util.RFC822DateFormat;
   
   import org.apache.mailet.GenericMailet;
  @@ -529,7 +530,7 @@
                   multipart.addBodyPart(part);
               }
               reply.setContent(multipart);
  -            reply.setHeader("Content-Type", multipart.getContentType());
  +            reply.setHeader(RFC2822Headers.CONTENT_TYPE, multipart.getContentType());
           } else {
               // if we need the original, create a copy of this message to redirect
               reply = getPassThrough() ? new MimeMessage(message) : message;
  @@ -537,8 +538,8 @@
           }
           //Set additional headers
           reply.setSubject(getSubjectPrefix() + message.getSubject());
  -        if(reply.getHeader("Date") == null) {
  -            reply.setHeader("Date", rfc822DateFormat.format(new Date()));
  +        if(reply.getHeader(RFC2822Headers.DATE) == null) {
  +            reply.setHeader(RFC2822Headers.DATE, rfc822DateFormat.format(new Date()));
           }
           
           reply.setRecipients(Message.RecipientType.TO, apparentlyTo);
  @@ -549,7 +550,7 @@
               reply.setReplyTo(iart);
           }
           if(sender == null) {
  -            reply.setHeader("From", message.getHeader("From", ","));
  +            reply.setHeader(RFC2822Headers.FROM, message.getHeader(RFC2822Headers.FROM,
","));
               sender = new MailAddress(((InternetAddress)message.getFrom()[0]).getAddress());
           } else {
               reply.setFrom(sender.toInternetAddress());
  
  
  
  1.3       +16 -15    jakarta-james/src/java/org/apache/james/transport/matchers/NESSpamCheck.java
  
  Index: NESSpamCheck.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/NESSpamCheck.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NESSpamCheck.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ NESSpamCheck.java	14 Sep 2002 06:22:37 -0000	1.3
  @@ -7,6 +7,7 @@
    */
   package org.apache.james.transport.matchers;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.mailet.GenericMatcher;
   import org.apache.mailet.Mail;
   import org.apache.oro.text.regex.MalformedPatternException;
  @@ -27,18 +28,18 @@
   public class NESSpamCheck extends GenericMatcher {
   
       protected Perl5Matcher matcher;
  -    protected Object patterns[][] = {{"Received", "GAA.*-0600.*EST"},
  -            {"Received", "XAA.*-0700.*EDT"},
  -            {"Received", "xxxxxxxxxxxxxxxxxxxxx"},
  -            {"Received", "untrace?able"},
  -            {"Received", "from (baby|bewellnet|kllklk) "},
  -            {"To", "Friend@public\\.com"},
  -            {"To", "user@the[-_]internet"},
  -            {"Date", "/[0-9]+/.+[AP]M.+Time"},
  -            {"Subject", "^\\(?ADV?[:;)]"},
  -            {"Message-ID", "<>"},
  -            {"Message-Id", "<>"},
  -            {"Message-Id", "<(419\\.43|989\\.28)"},
  +    protected Object patterns[][] = {{RFC2822Headers.RECEIVED, "GAA.*-0600.*EST"},
  +            {RFC2822Headers.RECEIVED, "XAA.*-0700.*EDT"},
  +            {RFC2822Headers.RECEIVED, "xxxxxxxxxxxxxxxxxxxxx"},
  +            {RFC2822Headers.RECEIVED, "untrace?able"},
  +            {RFC2822Headers.RECEIVED, "from (baby|bewellnet|kllklk) "},
  +            {RFC2822Headers.TO, "Friend@public\\.com"},
  +            {RFC2822Headers.TO, "user@the[-_]internet"},
  +            {RFC2822Headers.DATE, "/[0-9]+/.+[AP]M.+Time"},
  +            {RFC2822Headers.SUBJECT, "^\\(?ADV?[:;)]"},
  +            {RFC2822Headers.MESSAGE_ID, "<>"},
  +            {RFC2822Headers.MESSAGE_ID_VARIATION, "<>"},
  +            {RFC2822Headers.MESSAGE_ID_VARIATION, "<(419\\.43|989\\.28)"},
               {"X-MimeOLE", "MimeOLE V[^0-9]"},
               //Added 20-Jun-1999.  Appears to be broken spamware.
               {"MIME-Version", "1.0From"},
  @@ -58,8 +59,8 @@
               {"X-See-Also", "0[A-Z0-9]+$"},
               //Updated 28-Apr-1999.  Check for "Sender", "Resent-From", or "Resent-By"
               // before "X-UIDL".  If found, then exit.
  -            {"Sender", ".+"},
  -            {"Resent-From", ".+"},
  +            {RFC2822Headers.SENDER, ".+"},
  +            {RFC2822Headers.RESENT_FROM, ".+"},
               {"Resent-By", ".+"},
               //Updated 19-May-1999.  Check for "X-Mozilla-Status" before "X-UIDL".
               {"X-Mozilla-Status", ".+"},
  @@ -79,7 +80,7 @@
               //Added 25-Oct-1999.  Check for X-Confirm-Reading-To.
               {"X-Confirm-Reading-To", ".+"},
               //Check for invalid Pegasus headers
  -            {"Comments", "Authenticated sender"},
  +            {RFC2822Headers.COMMENTS, "Authenticated sender"},
               {"X-PMFLAGS", ".*"},
               {"X-Pmflags", ".*"},
               {"X-pmrqc", ".*"},
  
  
  
  1.3       +2 -1      jakarta-james/src/java/org/apache/james/transport/matchers/RelayLimit.java
  
  Index: RelayLimit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/RelayLimit.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RelayLimit.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ RelayLimit.java	14 Sep 2002 06:22:37 -0000	1.3
  @@ -7,6 +7,7 @@
    */
   package org.apache.james.transport.matchers;
   
  +import org.apache.james.util.RFC2822Headers;
   import org.apache.mailet.GenericMatcher;
   import org.apache.mailet.Mail;
   
  @@ -33,7 +34,7 @@
           int count = 0;
           for (Enumeration e = mm.getAllHeaders(); e.hasMoreElements();) {
               Header hdr = (Header)e.nextElement();
  -            if (hdr.getName().equals("Received")) {
  +            if (hdr.getName().equals(RFC2822Headers.RECEIVED)) {
                   count++;
               }
           }
  
  
  

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