Mail Message

0 votes
asked Feb 5, 2013 by Enrico (370 points)
edited Oct 28, 2013

Hi, i'm using rebex 1.0.4086

In some cases when i try to read a mail using imap class the content of the attached file seems to be strange. The curios things is that if i read the mail from the imap folder i have the problem, instead,if i save the mail using outlook (save as .msg) in a folder and then i read the message using the method load of the class MailMessage i read the attach well.

Other things: After reading the mail from imap i save the mail in a file. I noticed that the content of the saved file it's different from the original. The attached content seems to be inside a begin end keys.

Here below the methods used to save the mail:

MemoryStream ms = new MemoryStream();
m_Message.Save(ms, MailFormat.OutlookMsg);
byte [] b = ms.GetBuffer();

This is the content of the attached file:

begin 600 HUR_ALLBRATMITASI00342013.csv

Can you help me?

Applies to: Rebex Secure Mail
commented Feb 6, 2013 by Lukas Matyska (61,230 points)
edited Feb 7, 2013

Is it possible for you to send us the original mail received from IMAP server for investigation? It can be retrieved like this:

m_Imap.GetMessage(messPartial.UniqueId, @"C:\temp\mail.eml");

Please send it to as compressed attachment to prevent it from modifying by transport layer.

Please note that you are able to read attachment correctly from .msg file, because MS Outlook probably transformed the attachment from UUENCODE to plain text.

2 Answers

0 votes
answered Jul 29, 2013 by Lukas Matyska (61,230 points)
edited Jul 29, 2013
Best answer

This is fixed from version 2013 R1 (build number 4959) - we added support for attachments with Content-Transfer-Encoding: uuencode.

0 votes
answered Feb 5, 2013 by Enrico (370 points)
edited Feb 7, 2013

Hi, i understood that the attached file in the message received is uuencoded.

The questions are: doing the following code:

MailMessage mess = m_Imap.GetMailMessage(messPartial.UniqueId);
StreamReader reader = new StreamReader(
buff = reader.ReadToEnd();
  1. how to understand that the attachment is in uuencoded format? How to convert it?
  2. if i save the message (using method save) after reopening in outlook, the attach file appear as only text (uuencoded).
commented Feb 6, 2013 by Lukas Matyska (61,230 points)
edited Feb 7, 2013

Actually, the component supports UUENCODE, but the mail you encountered seems to be an invalid UUENCODE message (an UUENCODE attachment of a MIME message should be specified within its body, not as a single attachment). Can you please send the original MIME message to for investigation?