Example #1
0
			internal MessageInfo (MimeMessageStream m, long start ) {
				this.start = start;
				this.header = new MimeHeader ( m, this.start );
				this.start_body = this.header.BodyPosition;
				this.end = -1;
				parts = new MimeMessageCollection();
			}
Example #2
0
 internal MessageInfo(MimeMessageStream m, long start)
 {
     this.start      = start;
     this.header     = new MimeHeader(m, this.start);
     this.start_body = this.header.BodyPosition;
     this.end        = -1;
     parts           = new MimeMessageCollection();
 }
Example #3
0
 private void ParseMessage(System.IO.Stream stream, MimeTopLevelMediaType types, DecodeOptions options, System.String preferredtextsubtype, System.String path)
 {
     this._attachments = new System.Collections.ArrayList();
     MimeMessage message = new MimeMessage(stream);
     this.ParseMessage(message, types, (options & DecodeOptions.AllowHtml) == DecodeOptions.AllowHtml, options, preferredtextsubtype, path);
     this._headers = message.Header;
     message.Close();
     // find and decode uuencoded content if configured to do so (and attachments a allowed)
     if ((options & DecodeOptions.UuDecode) == DecodeOptions.UuDecode
            && (options & DecodeOptions.AllowAttachments) == DecodeOptions.AllowAttachments)
         this.UuDecode(path);
     // Date
     this._date = MimeTools.parseDate(this._headers.Date);
     if (this._date.Equals(System.DateTime.MinValue))
     {
         System.String date = this._headers["Received"] ?? System.String.Empty;
         if (date.IndexOf("\r\n", System.StringComparison.Ordinal) > 0)
             date = date.Substring(0, date.IndexOf("\r\n", System.StringComparison.Ordinal));
         date = date.LastIndexOf(';') > 0 ? date.Substring(date.LastIndexOf(';') + 1).Trim() : System.String.Empty;
         this._date = MimeTools.parseDate(date);
     }
     // Subject
     this._subject = MimeTools.parserfc2047Header(this._headers.Subject);
     // To
     this._to = MimeAddressCollection.Parse(this._headers.To);
     // From
     MimeAddressCollection from = MimeAddressCollection.Parse(this._headers.From);
     foreach (MimeAddress item in from)
     {
         this._from_name = item["name"];
         this._from_addr = item["address"];
         if (this._from_name == null || this._from_name.Equals(System.String.Empty))
             this._from_name = item["address"];
     }
 }