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/core MailImpl.java
Date Sat, 11 Aug 2001 21:26:43 GMT
serge       01/08/11 14:26:43

  Modified:    src/java/org/apache/james/core MailImpl.java
  Log:
  Changed to store the MailAddress object, rather than the String object.  This was done to
support handling MAIL FROM: <>.  Will check to see whether an existing repository is
String to support older versions.
  
  Revision  Changes    Path
  1.3       +11 -4     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MailImpl.java	2001/08/06 03:39:22	1.2
  +++ MailImpl.java	2001/08/11 21:26:43	1.3
  @@ -47,7 +47,7 @@
       }
   
       public MailImpl(String name, MailAddress sender, Collection recipients, InputStream
messageIn)
  -    throws MessagingException {
  +            throws MessagingException {
           this(name, sender, recipients);
           MimeMessageSource source = new MimeMessageInputStreamSource(name, messageIn);
           MimeMessageWrapper wrapper = new MimeMessageWrapper(source);
  @@ -139,13 +139,20 @@
           Enumeration e = message.getAllHeaders();
           while (e.hasMoreElements()) {
               size += ((Header)e.nextElement()).toString().length();
  -         }
  +        }
           return size;
       }
   
       private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
{
           try {
  -            sender = new MailAddress((String) in.readObject());
  +            Object obj = in.readObject();
  +            if (obj == null) {
  +                sender = null;
  +            } else if (obj instanceof String) {
  +                sender = new MailAddress((String)obj);
  +            } else if (obj instanceof MailAddress) {
  +                sender = (MailAddress)obj;
  +            }
           } catch (ParseException pe) {
               throw new IOException("Error parsing sender address: " + pe.getMessage());
           }
  @@ -201,7 +208,7 @@
       private void writeObject(java.io.ObjectOutputStream out) throws IOException {
           //System.err.println("saving object");
           lastUpdated = new Date();
  -        out.writeObject(sender.toString());
  +        out.writeObject(sender);
           out.writeObject(recipients);
           out.writeObject(state);
           out.writeObject(errorMessage);
  
  
  

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


Mime
View raw message