0 votes
by (120 points)

So, I'm pretty new to this email handling in .net so I thought I'd ask about this.

We have an inbox which we process programatically by fetching emails from the inbox by using Imap.GetMessageList(ImapListFields.FullHeaders).

It works fine most of the time but if we get a bounced email back to that inbox and we fetch that email using Imap.GetMailMessage(uniqueId).

So, the problem is that the subject of the email, when I look at that email in the inbox in Outlook is the following:
"Undeliverable: Message from Customer Service (CNO-8312194-CRM)"

But when I look at the email in my c# code while debugging the subject of the email shows:
"Delivery Status Notification (failure)

Furthermore, the bodytext also mismatch between the actual email in the inbox and what I can see while debugging. There is a lot of text in the email body in Outlook but the Imap.MailMessage shows empty string. The Imap.MailMessage also shows the property "HasBodyHtml" = false which I don't think is correct because the body is definitely html.

If anybody can point me in the right direction it would be greatly appreciated.
And like I mentioned earlier, it seems to happen for only bounced emails..

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (147k points)
Would it be possible to provide a sample of one of those non-delivery status messages, downloaded using Imap.GetMessage? We are not aware of any of the issues you report, and so it's somewhat hard to comment on it without being able to actually investigate them. As for the subject, we are definitely not making those subjects up, they have to come from somewhere. Which header is present in the message downloaded into a file using GetMessage method? As for HasBodyHtml, this would only be true for messages that contain an appropriate "text/html" part as one of the view entities. Is this the case with your message or not? Try parsing the message's MIME try using the MimeExplorer sample that comes with Rebex Secure Mail install package. Is there a "text/html" part? Where is it located?
by (120 points)

Thanks for the quick reply.
Would it be possible for me to send the email message as an attachment in an email message to a private adress of yours? Since the contents of the attachment "might" be sensitive.

I'll contact a guy att work first to see if it's ok to send this email to you.
by (147k points)
It might be possible to redact the message to remove sensitive information, while still retaining enough of the original structure to make it possible to tell what is actually going on. Alternatively, we have a GDPR-compliant process of receiving confidential data - contact us at support@rebex.net for more information. (By the way, it looks like your Rebex support contract has expired last year, but we'll see what we can do.)
by (120 points)
Hello again. I found the subject in one of the "attachments" in the MailMessage.Attachments property. It seems that every MailMessage has two "attachments" and in one of the the "DisplayName" property contains the Subject that I actually see when reading the mail in Outlook....

So this discovery made me able to achieve the goal of the feature I was implementing.
by (147k points)
Thanks for the update!