DPMime 1.0 ========== Copyright (c)1996 Daniel Pfund -FREE for non commercial use- Email: Pfund3@uni2a.unige.ch OR pfund@mail.dotcom.fr WEB: http://www.geocities.com/SiliconValley/8130/ Abstract ======== DPMime is a program that decodes MIME email attachments that are encoded with the world standard base64 encoding. It is useful if your mail program cannot handle MIME attachments (but most new ones do now since MIME is becoming an Internet standard). The program will only work on the Psion Series 3a (NOT the 3!). Usage ===== Simply install the OPO file into one of your \OPO\ directories and run it from the RunOpl icon (it's not an OPA and thus has no icon to save space). If you don't have a RunOpl icon, you must first install it with "Install Standard" (Psion-j) from your System screen; you will then see DPMime appear under the OPL bubble icon. Usage is simple: you must specify an IN file and an OUT file. See below as to how the IN file must be saved from your mail program. Once you've done that, DPMime will decode the IN file and save the results to the OUT file... how strange, no? ;-) You can use the program over a network with REM:: drives but bear in mind that the transfer speeds will be very slow (19k2 at best) so it may take quite a while to decode the program! DPMime will work with DOS (CRLF) or Amiga/UNIX (LF) or Mac (CR) end of lines. The IN file =========== You may ask: what does a MIME attachment look like? It is usually a big chunck of text of 76 characters wide. It uses only alphabetical characters (upper and lower case), numbers and "+/". It may look something like this: Q2lYICdQc2lvbi9GaWxlcycgdG9waWMuDQo9PT09PT09PT09PT09PT09PT09PT09PT0NCg0KTm90 ZSB0aGF0LCBvYnZpb3VzbHksIGFsbCBTZXJpZXMgMyBwcm9ncmFtcyB3aWxsIGFsc28gd29yayBv ..... Unfortunately, there is no start/stop indicator unlike UUencoding. But when you save your EMail message, you will usually also get the following line: --Boundary (ID some text goes here) and a blank line right after that and then the whole base64 encoded part. This is the first line you must extract. At the end of the base64 encoded block, you should again see the same line: --Boundary (ID some text goes here) preceded by a blank line again. That is the end marker and you save your data up to this last line of data (included). So save the whole block of base64 data to a file. This file is what I call the "IN file". Do NOT save any other extra characters or the program may not decode the file correctly! The OUT file ============ This is the processed 8bit binary file that will result from decoding. You may call it whatever you like, but most of the time, you should know what the file is for and call it the appropriate way (ie: if it's a ZIP compressed file, you should use the .zip extension...). How does base64 encoding work? ============================== Base64 encoding was intended to be the most versatile encoding type in order to be transported to every computer in the whole world without being corrupted by different ASCII implementations. It must thus use only the most common letters available on every computer system (ASCII codes <128). I suppose for the discussion that you know your bits from your bytes, otherwise skip this part ;-) The base64 encoding lookup table is formed of the standard alphabet letters in both upper and then lower case, then the 10 arabic numbers and finally "+/", so it looks like this: ABC...XYZabc...xyz01234567890+/ This makes the 64 encoding base letters used (hence the name "base64"). You will notice that the base64 only has 64 letters and that you can encode numbers 0-63 with only 6bits in binary base. (Where "A"=0 and "/"=63) All we have do is transform the 8bits binary data into 6bits offsets. This is done by concatenating 3*8bits into 4*6bits. For example, imagine that you wanted to encode the 3 letters: "heu" (only 7 bits are used for display reasons here). h=104 (ASCII) = 01101000 e=101 = 01100101 u=117 = 01110101 Those 3*8bit bytes would then be concatenated into: 011010000110010101110101 and split up into 4*6bits bytes: ^ ^ ^ ^ 011010 = 26 = "a" in base64 offset table 000110 = 06 = "G" 010101 = 21 = "V" 110101 = 53 = "1" So the output would be "aGV1". You can see that the final size will be 4/3 of the original 8bit binary file but at least you will be able to copy the file to every machine and being sure that it will always look the same on any computer. What DPMime does is exactly the contrary: it splits up 4 6bit bytes into 3 8bit bytes. Legal section ============= DPMime is provided "as is" and I cannot be held responsible if it crashes your Psion or of any other misbehavings it may occasion. I have tested the program myself and I used it on some different MIME programs (although I don't need it myself, because my mail program (Pine) has MIME attachments included ;-) and it seemed to work flawlessly. But you never know, if you have encoutered a problem, please report it immediately to me so I can take correct action against it in future versions. You may not use the program or any part of it in your own programs without my prior consentement. Definitively do not attempt reverse translation or your Psion will blow up!!! ;-) I hope you'll like the program. Mail me any comments you may have. History ======= ver Date Comments -------------------- 1.0 15Jul96 First public release