Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 62
Registered: ‎07-14-2008
My Device: Not Specified

!<LF> added to e-mail

I send a Base64 (about 1500 chars) string to the device with some information. The email is then caught and processed.

 

It's working on the simulator like wished. However I noticed that when the message is received on the real device, my Base64 string contains  "!<LF>" (values: 33 and 10) which makes it unusable. The message is not Multipart. 

 

I would like to know why is it added.

 

Compiled with JDE 4.2.1, tested on Pearl v4.5.0.81 (2.7.0.78).

Please use plain text.
Administrator
MSohm
Posts: 14,309
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: !<LF> added to e-mail

Are you creating the message from within an application running on the BlackBerry or from an external application?  Are you veiwing the message in your own application or using the BlackBerry Messages application?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
Posts: 62
Registered: ‎07-14-2008
My Device: Not Specified

Re: !<LF> added to e-mail

Hi Mark,

 

I'm creating the message from within a C#/.NET application and that seems to be the cause of the problem.

 

Although the SMTP paket I could catch with a sniffer was without "\!" the message finally appears in the BlackBerry Message Client with it. Sending the same message with Thunderbird which uses the same SMTP server works as wished...

 

Because I used Thunderbird (my .NET application didn't work with the the local running ESS simulator) and ESS simulator it worked on the simulator as mentioned in my first post. For tests on the real device I wrote that small application to automate sending process...

 

For the moment I cut out the inserted characters when processing the message and will see what's wrong with the .NET mailer.

 

Thanks

Please use plain text.
Developer
Posts: 62
Registered: ‎07-14-2008
My Device: Not Specified

Re: !<LF> added to e-mail

If someone should have the same problem and finds this thread not necessarily in the BlackBerry context, here is the explanation and the solution.

 

"!\n" is added by the clients sending the Base64 string if the whole string is just written in one line, which was the case in my .net code. Several other E-Mail clients do the same as I've noticed excepting Thunderbird, which sends the whole string as it is.

 

The reason can be found in the Internet Message Format spec:

2.1.1. Line Length Limits

There are two limits that this standard places on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.
...


http://www.faqs.org/rfcs/rfc2822.html

 

So to avoid base64 string truncation just add CRLFs following the restriction mentioned above. Normally all Base64 decoder implementations (including the one on the BlackBerry) are just ignoring line breaks parsing the string correctly.

 

 

Please use plain text.