login about faq

Hi, We are reading the SMIME encrypted emails from the pop3 server using mailman component.

Its successfully decrypting the SMIME content, But we are facing linefeed issue,

E.g The original email body contains the following content before encrypting. The content (plain text) encrypted using our own digital certificate and private key. i/p:

################################################################################
#                   CONTENT  HERE                                              #                                                   
#               S T A T U S   -   R E P O R T                                  #                                              
################################################################################

o/p :But after decrypting the mail, there was a long line instead of the above boxed # region, shown below,

################################################################################- #-----------------------------CONTENT-HERE----------------------------------------- #- #----------S-T-A-T-U-S------R-E-P-

We are not sure, what we’ve missed while decryting the SMIME content, But our customer wants exactly as the input with boxed ‘#’ region. Fyi, the result contains no CRLF/LF on the boxed '#' region and all the whitespaces replaced by ‘-’ symbol. But other contents in the body has no CRLF issue. Its shown just like in the i/p.

We are decrypting the content from 2 scenarios(our requirements),

  1. we’ve used the following code segment for decrypt the content in email textfile.
    MailMan mailman = new MailMan();
    Email email = new Email();
    bool success = mailman.UnlockComponent("license key");
    mailman.SetDecryptCert2(objCert, objPrivateKey);
    email = mailman.LoadEml(filename);
    string decrypted = email.GetMime();
    

2.And the below code segment for decrypt the email from pop3 server,

MailMan mailman = new MailMan();
Email email = new Email();
bool success = mailman.UnlockComponent("license key");
mailman.MailHost = hostName;
mailman.MailPort = port;
mailman.PopSsl = useSSL;
mailman.PopUsername = mailUserName;
mailman.PopPassword = Password;
mailman.ReadTimeout = readTimeOut;
mailman.SetDecryptCert2(objCert, objPrivateKey);
Chilkat.StringArray chilkatUidlArray = mailman.GetUidls();
string uidl = chilkatUidlArray.GetString(index);
email = mailman.FetchEmail(uidl);
string decrypted = email.GetMime();

both code segment gives the same result. i.e a long line instead of the boxed # region. Needs help.

asked Mar 27 '13 at 04:09

kumar's gravatar image

kumar
1334

edited Mar 27 '13 at 04:13


The call to email.GetMime() returns the full MIME representation of the email, which of course will include the body typically encoded using a content-transfer-encoding such as quoted-printable, bsae64, etc. You are probably looking at the quoted-printable encoding of the body.

If you want the body text, access the "Body" property of the email.

link

answered Mar 27 '13 at 14:59

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks for the quick answer, Actually i'm getting the '#' region value under the 'Header' property not on the 'Body' property thats why i've used the GetMime() method. It seems its append to the header values. My Header :

Message-ID: 20631685.1349796827856.abc@def.com Date: Sat, 9 Jan 2013 10:33:47 -0500 (CDT) To: test@abc.com From: test@abc.com Subject: testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 Content-Length: 19217

##########################################################################- #-----------------------------CONTENT-HERE----------------------------------------- #- #----------S-T-A-T-U-S------R-E-P-

Still couldn't get exactly as the i/p. Needs help.

link

answered Mar 28 '13 at 04:24

kumar's gravatar image

kumar
1334

edited Mar 28 '13 at 04:29

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15
×2
×1
×1

Asked: Mar 27 '13 at 04:09

Seen: 6,564 times

Last updated: Mar 28 '13 at 04:29

powered by OSQA