public void ParseEnvelopeWithBracketsInContactString()
 {
     var parser = new EnvelopeParser();
     var b = (Envelope) parser.Parse("(\"Sun, 23 Aug 2009 05:01:56 -0700\" \"Access Gmail on your mobile phone\" ((\"Gmail Team(22222)\" NIL \"mail-noreply\" \"google.com\")) ((\"Gmail Team(222)\" NIL \"mail-noreply\" \"google.com\")) ((\"Gmail Team(Bla)\" NIL \"mail-noreply\" \"google.com\")) ((\"reg.wieser\" NIL \"reg.wieser\" \"crystalbyte.de\")) NIL NIL NIL \"<*****@*****.**>\"))", null);
     Assert.IsTrue(b.ReplyTo.Count() == 1);
     Assert.IsTrue(b.From.Count() == 1);
 }
Beispiel #2
0
        private static void AddNestedMessage(MessageInfo message, BodyPart current, string token, int sn, string original)
        {
            var nested = new MessageInfo { SequenceNumber = sn, Token = token, OriginalString = original };
            nested.Token = token;
            nested.SequenceNumber = sn;

            var envelope = original.Substring(current.EnvelopeBounds[0], current.EnvelopeBounds[1]);
            var parser = new EnvelopeParser();
            nested.Envelope = (Envelope) parser.Parse(envelope, null);
            ((List<MessageInfo>) message.NestedMessages).Add(nested);

            var i = 0;
            foreach (var child in current.Children) {
                i += 1;
                var childToken = (token + "." + i).TrimStart('.');
                ProcessChild(nested, child, childToken, sn, original);
            }
        }