smarter handling of envelope-To/From
authoradam <adam@megacz.com>
Sat, 15 Jan 2005 11:14:54 +0000 (11:14 +0000)
committeradam <adam@megacz.com>
Sat, 15 Jan 2005 11:14:54 +0000 (11:14 +0000)
darcs-hash:20050115111454-5007d-555f96382d428ac38f6e33e96cc4f015b0b7dc6b.gz

src/org/ibex/mail/Message.java

index ac2e4a0..63ef363 100644 (file)
@@ -68,12 +68,10 @@ public class Message extends MIME.Part {
     }
     private Message(Stream stream) throws Malformed {
         super(stream, null, false);
-        this.to           = headers.gets("To") != null ? Address.parse(headers.gets("To")) : 
-                            headers.gets("Envelope-To") != null ? Address.parse(headers.gets("Envelope-To")) : null;
-        this.from         = headers.gets("From") != null ? Address.parse(headers.gets("From")) : 
-                            headers.gets("Return-Path") != null ? Address.parse(headers.gets("Return-Path")) : null;
         this.envelopeTo   = headers.gets("Envelope-To") != null ? Address.parse(headers.gets("Envelope-To")) : null;
         this.envelopeFrom = headers.gets("Return-Path") != null ? Address.parse(headers.gets("Return-Path")) : null;
+        this.to           = headers.gets("To") != null ? Address.parse(headers.gets("To")) : this.envelopeTo;
+        this.from         = headers.gets("From") != null ? Address.parse(headers.gets("From")) : this.envelopeFrom;
         this.replyto      = headers.gets("Reply-To") == null ? null : Address.parse(headers.gets("Reply-To"));
         this.subject      = headers.gets("Subject");
         this.messageid    = headers.gets("Message-Id");