Comments on: Access custom email header using IMAP https://www.limilabs.com/blog/access-custom-email-header-using-imap Using Limilabs .net components Tue, 15 Apr 2014 13:39:32 +0000 hourly 1 https://wordpress.org/?v=6.6.5 By: Limilabs support https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-573972 Fri, 04 Oct 2013 15:17:03 +0000 http://www.limilabs.com/blog/?p=1390#comment-573972 In reply to Fred.

@Fred,

Mail.dll does not remove custom headers. All email headers are available using IMail.Headers collection. Are you sure this header is there (examine the text of this attachment)? Please contact us directly if you believe this is a parser problem.

Additionally you can make your code a bit more readable:

MimeRfc822 rfc822 = (MimeRfc822) mail.Attachments[1];
IMail attached = rfc822.Message;
]]>
By: Fred https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-573963 Fri, 04 Oct 2013 14:06:17 +0000 http://www.limilabs.com/blog/?p=1390#comment-573963 I see some custom header in a attachmail via Outlook/Tags/Header but not more with your interface…

This code remove Non standard Header? :

byte[] eml = email.Attachments[1].Data;
IMail attachedMessage = new MailBuilder().CreateFromEml(eml);

]]>
By: Limilabs support https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-316491 Tue, 18 Dec 2012 16:48:53 +0000 http://www.limilabs.com/blog/?p=1390#comment-316491 In reply to Math.

@Math

Neither IMAP protocol nor Mail.dll has such limit.
As for the servers, some, like Gmail, limit certain operations, but it happens rather on search level and usually is configurable.

]]>
By: Math https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-316346 Tue, 18 Dec 2012 15:47:18 +0000 http://www.limilabs.com/blog/?p=1390#comment-316346 Is it possible that there is a limit on how many uids you can give with: imap.GetHeadersByUID(uids)?

]]>
By: Limilabs support https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-12826 Tue, 15 May 2012 13:19:53 +0000 http://www.limilabs.com/blog/?p=1390#comment-12826 In reply to Paul.

@Paul

You are correct. In most cases there is just a single instance of particular email header.
You can use GetValues method to access multiple headers:

List<string> values = mail.Headers.GetValues("Received");
]]>
By: Paul https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-12823 Tue, 15 May 2012 13:10:23 +0000 http://www.limilabs.com/blog/?p=1390#comment-12823 I did some testing and it appears that it returns the top-most header if there is more than one. That’s good for me, but it may cause problems for other developers.

]]>
By: Paul https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-12820 Tue, 15 May 2012 12:58:59 +0000 http://www.limilabs.com/blog/?p=1390#comment-12820 Thanks. One more question. I noticed that there is more than one Delivered-To header but the Headers collection only returns one string value. How do I find them all and loop through? I want the one at the top (the one that Gmail stamps on with the inbox address) but I don’t know if that’s the one that will be returned.

]]>
By: Limilabs support https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-12819 Tue, 15 May 2012 12:54:55 +0000 http://www.limilabs.com/blog/?p=1390#comment-12819 In reply to Paul.

@Paul,

Headers collection is not case sensitive.
This means that email.Document.Root.Headers[“Delivered-To”] and email.Document.Root.Headers[“delivered-to”] return same header value.

]]>
By: Paul https://www.limilabs.com/blog/access-custom-email-header-using-imap#comment-12812 Tue, 15 May 2012 12:23:21 +0000 http://www.limilabs.com/blog/?p=1390#comment-12812 Is the Headers collection case sensitive? In other words, if the header I’m looking for is “Delivered-To” and I use “delivered-to” as the index, will it work? If not, is there a fast way of specifying case insensitivity?

]]>