Decode Attachment in OutLook Express .dbx with MimeUtility?

Hi boys,
I want to extract an attachment (encoded in base64 format) from outlook express .dbx file.
I construct 2 classes :
- the first extract from dbx file the attachment data and write it to disk.
- the second read from disk and decode with MimeUtility class (JavaMail).
The result is that the final file decoded is 600 byte less the original.
sigh!.
Can Anyone help me?
Thanks Emanuele
These are the classes :
package dbxreader;
import java.io.*;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
public class Reading // THIS CLASS EXTRACT FROM DBX
private BufferedReader reader;
private FileOutputStream output;
private boolean complete = false;
public Reading()
public void parse(String archive,String fileName) throws IOException
reader= new BufferedReader(new FileReader(archive));
boolean found=false;
while(!found)
String line=reader.readLine();
if(line!=null)
int i=line.indexOf("filename=\""+fileName+"\"");
if(i!=-1)
found=true;
extractFile();
output.close();
reader.close();
private void extractFile() throws IOException
boolean finish=false;
boolean firstAttempt=true;
output= new FileOutputStream("solobyte.dat");
while (!finish)
char[] buffer=new char[2048];
byte[] dest;
int numberfBytes=reader.read(buffer);
if(firstAttempt)
dest=new byte[numberfBytes-2];
byte[] src=new String(buffer).getBytes("iso-8859-1");
System.arraycopy(src,2,dest,0,dest.length);
//String stringa=new String(dest);
firstAttempt=false;
else
byte[] src=new String(buffer).getBytes("iso-8859-1");
dest=new byte[numberfBytes];
System.arraycopy(src,0,dest,0,dest.length);
// controllo se il file e finito
// e scrivo l'array
String appoggio=new String(dest);
int index=appoggio.indexOf("------=_NextPart_");
if(index!=-1)
byte[] newdest=new byte[index-4];
System.arraycopy(dest,0,newdest,0,newdest.length);
System.out.print("Ci sono");
String prova=new String(dest);
finish=true;
String prova2=new String(newdest);
output.write(newdest);
output.flush();
else
output.write(dest);
output.flush();
System.out.print("ciao");
public static void main(String[] args)
try
Reading reading = new Reading();
reading.parse("Posta in arrivo.dbx", "PathAssolutoW.exe");
catch (IOException ex)
ex.printStackTrace();
THIS CLASS rRECONSTRUCT THE FILE
package dbxreader;
import java.io.*;
import javax.mail.internet.MimeUtility;
import javax.mail.*;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
public class Decode {
public Decode() {
public static void main(String[] args)
try {
// FileInputStream file = new FileInputStream(new File("Prova.txt"));
//FileInputStream file = new FileInputStream(new File("Temp64.txt"));
FileInputStream file = new FileInputStream(new File("solobyte.dat"));
InputStream stream = MimeUtility.decode(file, "base64");
FileOutputStream output =new FileOutputStream("PathAssolutoW.exe");
//FileOutputStream output =new FileOutputStream("PathAssolutow.exe");
int iter=0;
while(stream.available()>0)
byte[] buffer=new byte[4096];
int nbytes=stream.read(buffer);
output.write(buffer,0,nbytes);
output.flush();
stream.close();
output.close();
// FileOutputStream output =new FileOutputStream("path.exe");
output.close();
catch (MessagingException ex)
ex.printStackTrace();
catch (FileNotFoundException ex)
ex.printStackTrace();
catch(IOException ex)
ex.printStackTrace();
}

The situation is this :
i have send to myself a mail with an attachment pathassolutow.exe.
The original file info are(from right click and properties)
- 85.854 byte dimension
- 86.016 byte on disk
When i launch my process (the two classes) the result is:
- 85.237 byte dimension
- 86.016 byte on disk
there is a difference :
85.854 before
85.237 after
If i try to launch the result file i get an error.
I open the result file(85.237 bytes) with visual studio tool depends.
I have get an error " NO PE SIGNATURE FOUND.This File is Not a valid win32 module.
This application write on c a text file.
Thanks for the reply Emanuele

Similar Messages

  • How to import Outlook Express DBX to Outlook PST?

    Outlook Express DBX Recovery Software comes to save all your lost emails. This tool simply and easily recovers all the precious data of Microsoft Outlook Express including emails, attachments, images and other email properties like Date, From, To, Subject and more. This repair software automatically recovers permanently deleted emails. Outlook Express Recovery software tool is a standalone email recovery program which is purely intended to separate the subfolder created on the disk for each folder of Outlook Express.It provides benefits to them with repairing and recovering Outlook Express emails and folders; undelete emails of Outlook Express and repair DBX files.
    so Check out the FREE trail version demo in which user can recover its data in free:
    http://www.recoverfilesdata.com/outlook-express-dbx-recovery.html

    No doubt, it is very simple process to import Outlook Express DBX to PST file. If you do not want to invest money, then do it manually. The given link will help you, follow the steps-
    http://ijiraojutu.wordpress.com/2014/07/09/how-to-convert-outlook-express-to-out look-format/
    There is also a costless application; you can execute on any Windows and do not worry, it does not involve any alteration into database.

  • Outlook Express dbx oversize bug

    Hi
    I´m using Outlook Express 6 and now my inbox DBX folder has reached 2 GB size.
    I thought that deleating the mails is enough.
    So I deleated the mails with attachments and kept plain-text mails in my inbox.
    Now I have a DBX inbox file of 2 GB and no more mails in the inbox.
    What can I do now to recover my mails?
    Thank you for your help.
    Martin

    You can easily use outlook express recovery with the help of OE-Mail Recovery
    This solution supports restoring dbx files more than 2GB in size, see it on http://www.oemailrecovery.com/outlook-express-recovery.html

  • Outlook Express Integration with SAP Business workflow

    Hi,
    There is a user requirement for Outlook Express Integration with SAP Business workflow for PR approvals.
    They want a link to be put in there outlook inbox so that the approvers can directly release the PR's worklist without seperately login into the SAP system. We are using 4.7 version.
    I went through some ABAP material where i came across T-Code SCOT and Program RSWUWFML to schedule a job to pull worklists. But Iam not sure about this.
    I want to know that whether this is possible in first place and if it is then how can we do it.
    Regards
    Vivek Nair

    Hi ,
      Thanks for the link..
    but its not the one I have been looking for ragarding the mentioned scenario.
    !)A User will be present in both outlook express and SAP system ,when we add a security group (SG *) in outlook expressthe user will get authorization on Portal screen.
    2) After assigning a role in R/3 ,we should add the security group to that use for some access permission.
    Could u pls explain me how the concept could be and Integration method.
    Thanks in advance
    I appreciate all your help.

  • Outlook/Outlook Express .dbx files

    Is there a way to read Outlook Express .dbx files? Any free library or something like that?

    Once again, problem is solved. In using the DBXCONV utility, I needed to use the -mbx parameter on the command line. Dooh! Read the directions. Once I reconverted the DBX files using this parameter, I was able to successfully import all my messages. It was quite painless and very quick. Hats off to the DBXCONV developer. It worked very slick.
    Mike

  • How can I sync Outlook Express email with Nokia 58...

    Hello -
    I'd like to know if/how I can sync my works outlook express emails with my nokia 5800?  Not via a web browser but setting up the sync in the messages area.  All the sites/manuals I've searched are too vague and don't seem to offer any explanations on what I need to do specifically for outlook.
    Can anyone help?
    Many Thanks

    In general you don't sync with a mail client's local message store (such as the Outlook Express message store on your Work PC).  You generally sync to a mail server.
    So what you can do is find out which server your Outlook Express mail client is configured for on your PC, and then use the same server settings on your Nokia Phone.
    For further questions, you may want search in, and post to the Mail, Messaging & Browsing discussion forum.
    Lumia 920, Lumia 800
    Nokia N8-00 (NAM, Product Code: 059C8T6), Symbian Belle, Type RM-596, 111.030.0609
    Nokia 5800 XpressMusic (NAM, Product Code: 0577454) Software v51.2.007, Type RM-428

  • ATT00001.htm attachment in Outlook when sent with Apple Mail

    Hi,
    This issue was highlighted previously
    ATT00001.htm shows up along a Mail attachment
    http://discussions.apple.com/thread.jspa?messageID=8433141
    Apple mail compatibility issues / ATT00001.c
    http://discussions.apple.com/thread.jspa?messageID=8239867
    Both of these topics are locked so I couldn't comment about this annoying issue there and had to start a new topic.
    Looks like no-one is able to get to the bottom of this very annoying issue including Experts Exchange who I signed up for to see the answer they had given (their website is ranked highly in Google for this problem).
    I thought I would post the comments from Experts Exchange here to save anyone signing up for a free trial just to get their answer like I did...
    Title:
    Mac Mail att htm issue in outlook
    Question:
    I'm using mac original mail software. I did set my HTML style template. The software is best ever.
    And works good when I send email to outlook users on PC. However if I attach PDF for example, it does go through and outlook users get it, however when they open message all they see.
    - attached PDF
    - and att00001.htm file which has inside email text
    Not everybody gets idea to open it and thy think it is empty email. The same email will be sent to apple user everything looks properly. Why email text is converting into the htm file? It happens only if i attach something to my message, if I don't then email text is not being converted to htm attachment.
    I think there are a lot of user that know this issue, did anybody find a solution yet?
    Thank you
    jhyiesla:
    I don't think there is anything you can really do about it.
    I think that it's how the receivers program is going to interpret it.
    For example, I sent an email to my Outlook account from my Mac with just an attachment; no text. I looked at the email in Outlook 2000 and I see the attachment as an item in the body text section of the email. When I look at that same email in Outlook 2003 the attachment shows in the attachment area under the subject line and the body text area is blank.
    Then I sent another one with an attachment and some text in the body of the email. In Outlook 2000 I see the text in the text area and the attachment as well as a attxxx file in an area at the bottom of the email. The att file was empty. In Outlook 2003 that same email as the attachment and the empty att file in the attachment area at the top and under the subject line and in the body text area of the email is the text that I typed.
    Although Mac Mail uses standard protocols, which is why you can send an email to a Windows PC, it just does some different things. In the WIndows world Outlook and Outlook Express also handle some things differently.
    Goldblum:
    Thank you for your reply
    This issue makes mail.app useless, do you have any recommendations?
    Other client which are as good as the mail.app or would be nice to know what is forcing to convert body text to attachment? I could reduce beautiness of my email template by taking out header (jpg) or not using rich text. What exactly is forcing outlook to convert body to attxxxxx.htm file?
    jhyiesla:
    I truly don't know the answer to that question. Sometimes similar things happen coming the other way. I'll get emails in to my Mac Mail that have jpg files and I'll see the actual pictures in the body of the email.
    I happen to also have Office 2008 for the Mac installed and when I sent my self a message and looked at it in Outlook 2000 and XP, the email looked "normal" in all instances. The attachment was marked as an attachment, text was where it should be and no att file.
    There are other email clients that would probably work on the Mac like Thunderbird... but I'm guessing that you'd have a similar thing as happens with mac mail. Still it might be worth the download to test it out.
    Goldblum:
    I used entourage and same HTML template for email and have no problems. It is just so that entourage is as any other MS product "broken" out of the box but did good job and same message is not being converted to HTML attachment when it goes to outlook on PC. I will continue researching internet because it has to be solved. I can't send a message to client without comment to attached invoice. This is so not professional. I will play more with settings of mail.app to see what else can be done to avoid conversion.
    jhyiesla:
    Entourage probably works well with Outlook because they're both MS products and MS is going to have somewhat similar looks to all their Office products... although there is quite a bit of difference between Entourage and Outlook.
    Here's a link that may help you on your search:
    http://email.about.com/od/macemailclients/tp/free.htm

    As mentioned, Outlook is not email standards compliant. It probably never will be based on Microsoft's history. However, I think there are various issues involved in the problems people have. I often send emails from home to my Outlook account at work. I have never experienced any of the problems that I've seen posted anywhere regarding Mail and Outlook.
    My conclusion is that there are issues with certain Exchange Server configurations and/or issues with your own ISP mail server causing the issues.
    I do have my system set up to Always send windows friendly attachments (from what I've read, this really is 'send Outlook friendly attachments'), and always put attachments at the end. Prior to the 'always put attachments at the end,' I wasn't having any issues, either. However, I read that that setting helped with other email clients, so I use it.
    The obvious question is, "well, how is your exchange server configured." I would love to provide the answer to that question; however, I work for a DoD organization, so actually tracking down the person that knows the answer to that question will take somewhere between five years and never. With my 20+ years experience with the DoD, I'm leaning towards the never end of the spectrum. The other half of the equation is, "I'm using cox as my ISP."

  • Thunderbird crashes when importing high amount of Outlook Express .dbx files.

    Greetings !
    I'm trying to make a migration from Outlook Express to Thunderbird for a professional. His mail folder is made of around 1400 .dbx files (18GB of mails -woh-). Every time I'm trying to do the importation, Thunderbird crashes.
    I think I should specify that this importation is happening on the new computer I set up and from the old hard drive.
    I also tried importing small amounts : it worked but it's killing the file tree, which is not acceptable on a such amount of mails.
    I found mention of an 'Undbx' software that could help me. I'll try it very soon and report.
    I will provide a dxdiag.txt soon too, but I really think the PC is set up correctly (I have some experience in this domain).
    Importing this mail folder is critical since it's a professional need, so I'm relying on you and deeply thank you for your effort here.
    PS : English is not my native tongue, excuse the grammar and spelling mistakes.

    Dear Matt.
    I can proudly announced the problem is solved !
    In 'accounts settings' (not sure of my translation here), I set the mail storage folder to a new one, near the hard drive root, then launched the importation. And it went just well, keeping up the file tree and all.
    Thank you a lot for the informations you gave me. I wouldn't have found out the path length is limited to 255 without you. '''You rock, sir !'''
    I owe you.
    Keep up the good work. Thanks again.
    Sincerly yours,
    Jack
    PS : Some information on this issue on the database would be welcome I think and I'd happily participate.

  • Outlook express integration with R/3 and Portal

    Hi,
        I have seen a new system setup where we can assign security group to a user in Outlook express and it will give some authorization in R/3 and Portal. I am first time seeing this concept .Can anybody pls explain me how to create the security group in outlook express and method of integrating it with both R/3 and Portal.
    I appreciate all your help.
    Thanks in advance

    Hi ,
      Thanks for the link..
    but its not the one I have been looking for ragarding the mentioned scenario.
    !)A User will be present in both outlook express and SAP system ,when we add a security group (SG *) in outlook expressthe user will get authorization on Portal screen.
    2) After assigning a role in R/3 ,we should add the security group to that use for some access permission.
    Could u pls explain me how the concept could be and Integration method.
    Thanks in advance
    I appreciate all your help.

  • ATT00001.htm attachment in Outlook when sent with Apple Mail - SOLVED!

    Hi All,
    We recently discovered the problem where emails with attachments sent from Apple Mail were being received in Outlook, blank but with BOTH the attachment and the email itself as an ATT00001.htm attachment!
    I've discovered that the problem kicks in if the attachment is placed BEFORE the email message! If I write an email and then add an attachment AFTERWARD, ie. below the text, there is no problem.
    I hope this helps...

    Hi, you could try Universal Mailer plugin (http://noware-it.zxq.net), it solves this issue by correctly handling attachments. This also solves the problem for inlined images, which can now be correctly seen by recipients.
    PS: following Apple's forum rules I have to state that, since I'm the developer of Universal Mailer, I might make some profits from it. Also, on the website you can find a free version of the plugin, which has some limitation but can be used to test its functionality.

  • Viewing .doc Attachment  in Outlook Express

    When receiving a MS Word .doc in Outlook Express, SunOffice Writer grabs the file and displays it instead of MS Word which is also on my Windows XP machine. Usually, it doesn't present the document as the sender had intended.
    How can I make MS Word the default so that I can view the file correctly?

    Use the the search-function of the forum ans search for 'Star Office Changes All Office Files'.

  • Outlook express compatibility with iTunes

    I have had to delete iTunes (temporarily) so that I can receive email in outlook express.Is there a remedy so that I can reinstall iTunes?
    pentium 4 pc   Windows XP  

    Use something other than Outlook Express if you have any control over what is installed. Thunderbird works well for me.

  • Firefox 5 does not play well with Outlook Express

    This bug has been locking up my computer since FF4. When I drag an attachment from Outlook Express email to the XP desktop with Firefox 5 (or 4) open, my computer freezes. It happens on multiple computers and does not happen with FF3, IE8, or Chrome. Plus it even just locked up after reboot when FF attempted to restore the previous session.

    Here's the bug on Bugzilla: [https://bugzilla.mozilla.org/show_bug.cgi?id=674644 https://bugzilla.mozilla.org/show_bug.cgi?id=674644]
    Hope they'll fix it soon! :-(

  • I need to make outlook express repair. How to realize it?

    I have recently lost my general outlook express folders. I try to open them but oe says they are corrupted.

    Outlook Express Repair Toolbox is a Microsoft Outlook Express DBX repair tool that restores data from *.DBX Microsoft Outlook Express files.
    Main capabilities of the Microsoft Outlook Express inbox repair tool include:
    > Restore information from *. DBX files for Outlook Express 5, 5.5, 6
    > Batch restoration mode for *.dbx files
    > Compatible with Windows 98, NT 4.0, 2000, Me, XP, Vista and Windows 7
    Source: http://www.outlookexpress.repairtoolbox.com/

  • How do I import Outlook Express message files into Outlook 2013 without using LiveMail

    I bought a new Windows 7 computer and have copied the Outlook Express .dbx files from the old XP computer onto the new one. Outlook 2013 's import facility does not have a .dbx option.  I  do not want to use Windows Live for anything. How do
    I import my Outlook Express mail files into Outlook 2013 ?

    Hi,
    It isn't only to Outlook 2013, other versions of Outlook cannot access the .dbx files directly.
    In the situation, Windows Live Mail is needed to transfer the mail data to Outlook.
    Best regards,
    Rex Zhang
    TechNet Community Support

Maybe you are looking for

  • How do I stop safari from reopening previous sessions even after restart?

    Finally made the leap to Lion. WHY does safari insist on starting up and restoring the previous session, all tabs and everything even after a restart.  I've looked in preferences and for the life of me cannot find how/where to turn this off.  I just

  • Currency translation problem for calculated key figure

    Hi All I have a problem with the currency translation for a calculated key figure. I have a requirement to show the MM consignment stock value in the specified currency from the selection screen. For consignment stock, there is no value maintained in

  • Setting the page encoding with an extension

    Folks: DW CS3 on MacOS 10.6.x I  have a lot of legacy files encoded in ISO Latin-1 --and some exception cases in other encodings-- and I'd like to  convert uniformly to UTF8.  It's sufficient to convert files one-by-one  as I work on them for other r

  • Problem with LSMW ?

    Hi all, i have a dought regarding can we use <b>Batch session</b> and <b>call transaction</b> methods in LSMW ?

  • What's the benefit of Macbook??

    I live in Laos , I use Macbook 2.0 Intel core 2 Duo I can't use iTunes store ..... i don't know what can't i do more???? What i can do with the Macbook????? please tell me should i change the laptop? Please explain how should i do to use Macbook for