rfc 2822 header of a rfc 2045 entity
Inheritance: IEnumerable
Example #1
0
 internal MessageInfo(SharpMimeMessageStream m, long start)
 {
     this.start = start;
     header = new SharpMimeHeader(m, this.start);
     start_body = header.BodyPosition;
     end = -1;
     parts = new SharpMimeMessageCollection();
 }
Example #2
0
 public bool newMessage(String uidl, SharpMimeHeader header)
 {
     bool error = false;
     this.inbox_view.RowFilter = String.Concat("uidl='", uidl, "'");
     if (this.inbox_view.Count == 1)
     {
         DataRowView msg = this.inbox_view[0];
         msg[4] = header.From;
         msg[5] = "";
         msg[6] = SharpMimeTools.parseFrom(header.From);
         msg[7] = header.To;
         msg[8] = SharpMimeTools.parseFrom(header.To);
         msg[9] = SharpMimeTools.parseFrom(header.Reply);
         msg[10] = SharpMimeTools.parserfc2047Header(header.Subject);
         String date = header.Date;
         if (date.Equals(String.Empty) && header.Contains("Received"))
         {
             date = header["Received"];
             if (date.IndexOf("\r\n") > 0)
                 date = date.Substring(0, date.IndexOf("\r\n"));
             if (date.LastIndexOf(';') > 0)
                 date = date.Substring(date.LastIndexOf(';') + 1).Trim();
             else
                 date = String.Empty;
         }
         msg[11] = date;
         msg[12] = header.MessageID;
         msg[13] = header;
         msg[14] = SharpMimeTools.parseDate(date);
         if (msg[6] != null)
         {
             foreach (SharpMimeAddress item in ((IEnumerable)msg[6]))
             {
                 msg[5] = item["name"];
                 if (msg[5] == null || msg[5].Equals(System.String.Empty))
                     msg[5] = item["address"];
             }
         }
     }
     else
     {
         error = true;
     }
     return !error;
 }