[APP] Extract Outlook winmail.dat / TNEF attachments - Android Software Development

Dear all,
I guess many of us have already stumbled over "winmail.dat" or "attxxxx.dat" attachments in our Android email clients.
These attachment names usually occour, when somebody who is using a Microsoft Outlook EMail client sends you an certain RTF (rich text format) email with attachments. MS Outlook then packs these attachments into a TNEF (Transport-Neutral Encapsulation Format) envelope. Other MS Outlook Clients can deal with this format, but, however, most of the other email clients cannot! They will receive instead an attachment with the above mentioned naming and can basically do nothing with it.
While this is a well known (and annoying) circumstance there are already plug-ins for many open email clients such as Mozilla Thunderbird. For Android however there seemed to be nothing (and I have been doing quite some research on it).
So I finally decided to write my own app to deal with TNEF attachments. Luckily there was already an existing Java package which could do the extraction job so that I "only" had to create the Android app around it and do some debugging on the original code. My kudos here go to Amichai Rothman for his Java TNEF package (http://www.freeutils.net/source/jtnef/)!!
I originally created this application for my own purposes but then I thought it is worth while sharing it with the community. It is already bi-lingual (english and localized to german) and should get its job done.
The app itself registers as a handler for *.dat or *.DAT files and for email attachments. When you e.g. try to open a "winmail.dat" attachment from within your Android email client or a "winmail.dat" file with your file browser the app should be launched or you see a chooser box where you can select this app. When you do so you will see an alert box. When you press "Ok" the app will try to extract the contents of "winmail.dat" to a local folder. The default for this folder is "/sdcard/winmail". After it has successfully completed the extraction the app leaves a notification. When you open the the notification it will show you the contents of the target folder in another alert box. You can then use any file manager to browser to the target directory to access the real attachments out of the "winmail.dat" envelope.
If you launch the app directly it will present you a setup screen with some explanation on it and the possibility to specify your own target directory to where the extracted files should go.
The only system privilege that the app acquires upon installation is to be able to write to the external storage (sdcard). So it does not really have the chance to do severe harm to your device
If you have any questions please feel free to ask. Likewise I'd be interested in any feedback.
New release:
Winmail 2.1 (Donation Version)
In addition to the free version this version adds the following features:
Appointments / Calendar Items extracted into standard *.ics files (VCALENDAR industry standard) which can be imported into the device calendar
Enable / disable file browser in preferences
Launch file browser from within preferences
Browse extraction directory and subdirectories
Tap on files tries to open them according to mime type
Long tap on files opens context menu (open with, rename, send, delete)
Download:
Google Play Link Free Version
Google Play Link Donate Version
Older releases:
Winmail 1.0
some code cleanup
stability improvements
tapping on the explanation screen will launch this thread in web browser
Winmail_0.9.2
Changelog:
added the capability to extract vcards
added the capability to process/extract "multipart/*" type mime files
added user preference whether the app should create an own subdirectory for each file/mail
Winmail_0.9.1
Changelog:
added the capability to extract the message body text in either *.txt, *.html or *.rtf format depending on the original type. The message is written to the extraction directory and its file name contains the actual date and time to be able to distinguish the message files
some minor UI tweaks
Enjoy!
cooltide

reserved for future purposes

There's something I forgot. Here's a winmail.dat file for testing purposes

Superb app
Superb app to view mail attachments which weren't readable on Android otherwise. Any chance to also view or even accept appointments sent from Outlook?
Rgds

Thank you very much! I am currently looking into this calendar issue. This trickier than the other stuff. Will keep you posted.
Brgds

..

It was reported that the app was not shown as a handler for winmail.dat files by some file explorers and mail clients.
While I am investigating this the workaround is to use the OI File Manager which always worked for me.

cooltide said:
It was reported that the app was not shown as a handler for winmail.dat files by some file explorers and mail clients.
While I am investigating this the workaround is to use the OI File Manager which always worked for me.
Click to expand...
Click to collapse
Sent from my Galaxy J3 (2017) using XDA Labs

GM192513d

PepePlemmie3.7

Related

Handling email attachments on the touch hd

I just got my hd yesterday. I love it!
Anyway, regarding email attachments....
How can I set it up, so that I can read an email but not download its attachment?
Right now, I can only read the subject line. Then I can choose to download all headers PLUS attachments if I actually want to read the email. But I can't figure out how to simply read the whole email without using up my data transfer costs to download an attached file that I know I won't need on my mobile.
Is that possible? I haven't found how to do it yet.
Wow, that's a hard one, because the automatic procedures for some of the major email carriers (hotmail, yahoo, gmail, etc...) differ from the standard ones, which there are 3 of (Internet email, exchange server, custom domain). What email are you using?
I use a gmail account and a couple of Internet email accounts, and their setups are slightly different.
Try this: from the Messaging ap, click the right soft menu button called [Menu], then Tools > Options..., then tap your email account name. Next click the Download Size Settings link, and select [Entire Message] from the Message Download Limit: dropdown box. I noticed in my gmail account, there is an additional dropdown that lets you select how to download attachments.
Did you know you can save attachments on your MicroSD card? After you tap Menu > Tools > Options..., tap the [Storage] tab and check the "When available, use this storage card to store attachments" checkbox. I always do this very first thing after a hard reset or first turn-on before any new messages come in, but I believe if you check that with messages already on the phone, it will automatically move the attachments. To test, use file explorer and navigate to the "\Windows\Messaging\Attachments" folder, and it should be empty. The new folder on your MicroSD card where the new attachments are is "\Storage Card\Inbox.mst(and a bunch of numbers)\Mail Attachments"
That said, did you know you can store ALL of your messages on your MicroSD card, headers and all, not just your attachments? If you'd like to do this, you'll first need to turn off automatic email checking in all your email accounts. Then, using file explorer, navigate to "\Storage Card" and rename the "Inbox.mst(and a bunch of numbers)" folder to "Messaging", just like it is in the "\Windows" folder. Next, using a registry editor (I use Resco Explorer, but you can download PHM Registry Editor for free), edit the following key: HKLM\System\Inbox\Settings:AttachPath and change the value to '\Storage Card\Messaging\Mail Attachments\'. Next, create a new String Value entry and name it 'PropertyPath' and give it a value of '\Storage Card\Messaging\'. Exit the registry editor and bring up file explorer again and copy all of the files in '\Windows\Messaging' to '\Storage Card\Messaging'. Do the same for the attachments in the Attachments folder if they didn't move automatically. Soft reset your HD and you now have ALL your email on your storage card, freeing up valuable system memory.
Hope this helps someone...
--Jesse
Wow Jesse, great tips!! Thank you!! I'll be checking them out and I'll post how it all goes.
Well, I tried your suggestion for to somehow download the email message without downloading attachments - but it unfortunately did not change anything.
I have two email accounts set up. One is a hotmail address and the other one is with Arcor (my ISP in Germany). It's a regular POP3 account.
I did change the settings to store attachments on my storage card. Thanks for the tip. And YES - it will move the attachments from messages you already have. It automatically created a folder in my card and called it inbox.mst(and a bunch of numbers). In it, I now have a bunch of .att files. Some are a couple of KB big and a couple are about 2MB large (which I assume are the attached files). I thought the attachments would be saved as they are (for example .pdf or .doc) but everything is .att.
I haven't tried your last suggestions to edit the registry and have everything saved onto the card. If I do that, I'll post back how it turns out.
If any other ideas come to mind in terms of my initial issue with wanting to avoid downloading attachments, but still downloading the text content of an email - please let me know.

[Q] Attachments

Hi
how can i save non-supported format email attachments to my SD card.
I have received an email with a video file (AVI), and i just see a green android and a paper clip in place of the attachments, with no options to save (i tried long pressing)
I have tried k-9 client, but it also does not give me an option to download the attachment (only works for supported formats)
Thanks
anyone? dddd
I don't know, but if it's the same as for the browser (not letting you download unsupported file types) you could try something like byte tornado.
I installed that and I am now able to download any file (for sure from the browser but, if I remember well, from gmail app too) from the interwebz.

Fascinate stock email app & attachments

I have found that using the stock email app doesn't allow you to "open" or attach PDF files to emails.
I have three email accounts connected to the stock email app, Exchange, Gmail and Hotmail.
1) If I send an Excel or Word document to any of these accounts I get the option to "save" or "open" the attachment. However, if I send a PDF document to any of these accounts the only option is to the "save" the file. Then I have to go find it using a file manager before I can open it. I have tried Adobe PDF viewer & Thinkfree that comes on the device and neither will allow me to open PDFs in the email app.
2) The stock email application will not allow me to attach any files other than pictures. When I click attach it brings up the file manager (it appears to be the stock "my files" application) which allows me to view the SD card and won't show any other file types other than picture types. I have multiple PDFs on the SD card in various folders and NONE of them show up as being able to be attached to the email.
The weird part is that if I use the "Gmail" email application (the one that only allows gmail accounts) I can open PDFs straight from the Gmail application without saving first. I can also attach any file type using this application.
Does the stock email application suck this bad? My two co-workers with Dincs have no problem doing either of the above things.
I tried Touchdown, Maildroid & K9. They all attach all file types & open files directly from the email.
Does anyone elses mail app exhibit the same behavior as mine? Or did mine get messed up somehow.
The issue actually appears to be related to what program the email app will allow you to use to find attachments.
The stock mail program appears to use My Files, but it only allows you to see picture files. The Gmail program will only use "Gallery" to find attach files if you don't have a file explorer installed.
I have Astro installed and if you use the Gmail program and try to attach something it will ask you if you want to use Astro or the Gallery. I then went and uninstalled Astro and went back to attach a file through the Gmail App and it only allowed me to use the Gallery app to look for attachments.
So the problem actually DOES exist in the Gmail app, but the Gmail app will let you use other file explorers to look for attachments.
I just cant see how that got past whatever process they use in developing their app.... How can you design a mail app that doesn't allow you to attach anything but picture files.... I mean thats just ridiculous.
I would not recommend the Fascinate to be honest just because of this issue. Sure it can be worked around using other email apps and downloading file explorers. Its not that big of a deal if you only use Gmail, but if you heavily use exchange and have to rely on the mail app or a 3rd party mail app it sucks.
I ran into this just last night actually when I tried to open a pdf from an email.
So I emailed samsung to ask if this was intentional or not. They didn't give me a real good answer but here is what they said.
"Thank you for your inquiry. With the SCH-I500 mobile phone, you can only attach picture file types. If you would like to attach other files such as PDF files, you need to download an application through the android market for PDF application."
To me, that sounds like this was intentional and the stock mail app will never have the ability to attach anything other than pictures.
astraelraen said:
So I emailed samsung to ask if this was intentional or not. They didn't give me a real good answer but here is what they said.
"Thank you for your inquiry. With the SCH-I500 mobile phone, you can only attach picture file types. If you would like to attach other files such as PDF files, you need to download an application through the android market for PDF application."
To me, that sounds like this was intentional and the stock mail app will never have the ability to attach anything other than pictures.
Click to expand...
Click to collapse
Out of curiosity, with all the great email apps that you mentioned having tried, why not just use one that does what you need it to do? That's one of the great things about Android: the stock apps are just there to get you started!
Maybe this is a bug due to the DB issues, but whenever I click "Read first unread" for this thread, it takes me here: http://forum.xda-developers.com/showthread.php?p=8315757#post8315757

opening eml files in HD2

hi,
I have outlook and outlook express e-mails in my pc for business archieve and copied them to storage card.
When I click on it, it says "there is no application related with this file"
How can I open them in HD2.
thanks.
any help please?
I use a lot of .eml & .msg formated files/messages in my business too. This sounds a little backwards but it's the only way I've been able to achieve what you're trying to do using windows mobile.
Attach the .eml file to an email and email it to yourself. The messaging program in WM is able to open it as an email attachment. However, make sure your email is set up as POP and not IMAP. For some reason, WM messaging on the HD2 will not open .eml files using IMAP mailboxes, only POP.
Alternatively, you can also run Darkstone's Desire HD V2 Android build and open using HTC messaging. This new version of Sense is the only Android build I have found that handles .eml and .msg files correctly on the HD2.
thank you fatappel.
awaiting for alternative advices.
first I may be totally wrong,
secondly I have no way to check it now (having no .eml file at hand),
having said that:
isn't the format based on html (if so you could try opening it in browser) or at least readable as plain text file (for this you could use notepad of any kind, or eve word in the worst case)?
if I'm correct, then all you need to do is assigning any of those apps to open file with .eml extension (either by hand in registry editor, or using Resco Explorer or similar)
if you can want, you could send me - preferably small - eml file, and I'll try checking it for you
thank you. but it don't work this way either.
any other advices?
.eml are purely for outlook express to read, you woudl probably need to convert them to another format for them to be readable on the hd2 email client
the alternative method is to load up outlok and import the messages into outlook then sync your phone with outlook

Best way to download news from calibre wirelessly

I love the Fetch News option in Calibre to download RSS feeds into beautiful epubs but find it annoying that the Nook STR requires a USB connection to download news.
At first I decided to download the Calibre Library app, but was annoyed by having to be on the same network with my computer running.
Then I get around this by setting my Calibre library in my Dropbox folder, and using the Downloader for Dropbox app to download the entire folder daily. This works pretty well, but I still had to set my computer to wake up daily and was unable to figure out how to setup a script to have just the epubs "save to disk" in a single directory as opposed to the Calibre format... but I think I have found the best solution
If you want to use the B&N stock reader to open epubs sideloaded wirelessly:
1. Download and install ASTRO File Manager
2. Open Astro and go to preferences. Choose "Edit File Extensions" under Data. Choose "New Extension".
Extension Name: epub (no . in there, just epub)
Mime Type: application
SubType: epub (again, no . in there, just epub)
Save
Exit Astro
To automatically download news without having a computer running Calibre you will need to use Readbeam:
Readbeam hosts a Calibre server, and supports many devices (including the Nook STR). It has many stock recipes that are ready to use, and you can even use custom news recipes.
1. Go to readbeam.com and create an account.
2. There is an option for device email address - You may want to create a new gmail address just for your device.. more on this later.
3. Add recipes that you want to read and import your custom recipes if desired. Custom recipes can be found in: C:\Users\USERNAME\AppData\Roaming\calibre\custom_recipes
NOTE that custom recipes will need to be approved by an admin (this may take a few hours)
Now you have set Readbeam to automatically create an email an epub of each news source daily! You are almost done...
Now you will need to download an app called Attachments Auto Download
NOTE this app is currently $0.99
This app will automatically download any attachment sent to a gmail address. Since this app downloads every attachment, that's why it's easy to make a new gmail for this purpose.
1. Open the Attachments app and add the account information to where your news will be sent.
2. You may also want to change the Check Interval to 2 minutes. I would also check the box Flat Folder (this will save time when opening files).
3. Click the back arrow in the upper left to exit
Now just connect to WiFi and wait as your news is emailed to you and automatically downloaded!
To read the epubs with the stock B&N reader, just open ASTRO and navigate to "/sdcard/Downloaded Attachments"
You can also set this folder as ASTRO's home directory (by long clicking on it) for easy access!
I am using http://sendtodropbox.com. You receive a new mail and all attachments are saved to you dropbox folder.
For me the best solution is to use
ReadBeam to fetch news
send news from ReadBeam by mail to sendtodropbox
use Dropsync from Market to sync the "attachement" directory created by sendtodropbox on my Dropbox acount with "My Files/Magazines/" on my Nook
tebra said:
For me the best solution is to use
ReadBeam to fetch news
send news from ReadBeam by mail to sendtodropbox
use Dropsync from Market to sync the "attachement" directory created by sendtodropbox on my Dropbox acount with "My Files/Magazines/" on my Nook
Click to expand...
Click to collapse
I assume this approach requires you to root the NST? I'm still concerned about the potential for battery drain so I'm trying to avoid this initially.
BTW, for us noobs, is there a quick way to see what this would look like on the Nook? I assume have Readbeam build the file and then just wire it over for a test?
Agrajag27 said:
I assume this approach requires you to root the NST? I'm still concerned about the potential for battery drain so I'm trying to avoid this initially.
Click to expand...
Click to collapse
Yes you have to root your NST to install dropsync
i use rss reader over wifi but it doesn't always download the articles properly for offline later so I'll look into this, thanks

Categories

Resources