10-13-2008 05:31 AM
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 v22.214.171.124 (126.96.36.199).
10-14-2008 11:03 AM
10-14-2008 12:19 PM
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.
11-20-2008 04:42 AM
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
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.