Hi,
Using Rebex.Net.Imap 1.0.3723.0, .Net 3.5 VS2010
Seems that Outlook 12.0 does not enclose the msgids in the References mail header with angle brackets, so when the header is parsed, the MessageIdCollection contains one item with a value of all the message ids. It should have one value for each msgid. Example section of message header:
References: 1468@dm.hubse.hubsedev 1470@dm.hubse.hubsedev
In-Reply-To: 1470@dm.hubse.hubsedev
Subject: RE: Tuesday Test Message
Date: Tue, 11 May 2010 18:16:05 +0100
Message-ID: <004c01caf12d$a42d3950$ec87abf0$@bridges@hubse.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_004D_01CAF136.05F1A150"
X-Mailer: Microsoft Office Outlook 12.0
I have to put a workaround in my code to handle this as the standard parsing of the References header does not cater for this. My code is like this:
foreach(MimeHeader header in mailMessage.Headers)
{
if(header.Value is MessageIdCollection)
{
var messageIds = header.Value as MessageIdCollection;
foreach(MessageId id in messageIds)
{
// Seems like Outlook does not put <> around the Ids so they appear as one id with a space. Use this Contains and Split to workaround
if(id.Id.Contains(" "))
{
var parts = id.Id.Split(' ');
foreach(var part in parts.Where(part =>!String.IsNullOrEmpty(part)))
{
// process header using part
}
}
else
{
// process header normally
}
}
}
}
My question is, as Outlook as a very common mail client, even if it does not comply with the RFC, should there not be support for this form of header in Rebex? Or have a missed something?
Thanks.
Scott