How can I programatically retrieve archived mail items as msg files?
Created: 03 Feb 2013 | Updated: 14 Feb 2013 | 20 comments
This issue has been solved. See solution.
Hello,
I'm writing a program which needs to save archived mail items as .msg files. What's the standard way of doing that please? Can I use a http GET, or do I need to use EV APIs? Any examples out there?
I have access to stub and its shortcut data. Environment is Exchange 2003/2010 and EV904.
Thanks,
- Alan.
Discussion Filed Under:
Comments 20 Comments • Jump to latest comment
from http it would be download.asp and then saving out the msg file
you can find the format of download.asp by looking at the URL that is used in the view original item banner, or view message button from search.asp
The better option is to use the API
It will need to be run on a machine that has either EV or the EV API installed and it has to use the EV Admin credentials, else the calls will fail
An example posted by Wayne Humphreys can be found here:
http://www.symantec.com/connect/forums/fetch-mail-...
In order for whatever you make to be distributed publically i believe you will have to be a member of the STEP Program by symantec, that also gives you access to the API documentation which hasn't been distributed with EV since version 2007 i believe.
It will also give you the ability to contact API support, and without the STEP membership, you will not be able to get any support for API related issues
Thanks very much - the ASP page sounds like it will do what I need.
Never heard of this STEP program but I suppose it's not free? It would just be an in-house util so no public distro needed.
Regarding using the EV admin account and the APIs, if in Exchange I give a new service account read-only access to all mailboxes, then that should be carried through to EV archives. Wouldn't that be enough to retreive archived items?
Thanks again.
OK so through download.asp you will need an account to have read access on the mailbox and then use EVPM to give READ access to the archive itself.
However, this is probably inefficient because you're going to start hammering IIS with individual requests, possible like 30,000 requests to retrieve items.
plus if any errors occur, you're just going to know that the item couldn't be downloaded, but not why, but if you use the API you can see what the last error was.
For the API stuff, it absolutely has to be the EVAdmin without giving extra permissions to archives, but the API is really easy to program for, the only draw back may be if you wanted end users to be able to run the app themselves, then it will fail
as for the STEP program, it's not free and is a sizeable amount, but is aimed at third party app developers such as GlobaNet, TransVault, BlueSource etc
Well we sync mailbox perms with EV perms so won't I get away without using EVPM?
This is a utility that I'm thinking of coding to help in-house iPhone users retrieve archived items. That's a fairly small number so the number of queries wouldn't be huge (I know there are expensive third-party solns for that).
If the APIs require EVadmin access, to be honest I'd be too scared to use it. Pity. Plus the cost would be an issue anyways. And yes it would be the end-users that run it to retrieve their own archived items.
Thanks for all your advice. I'll look into the ASP pages, that sounds promising for the simple util that I need.
So what is it that you are trying to do?
Many Thanks,
Rob
www.quadrotech-it.com - All your EV Tools
PS I hope that the post proves helpful.
Honestly mate, you may want to just wait it out, there is an imap client coming out that the iphone will be able to use
as for using the API stuff, you dont need to pay anything to develop it
its just you wont have the documentation or support for it, but waynes script will work without any extra licensing requirements
Yeah you're right. I'll give it a whirl and see how far I get. I think the ASP pages are good enough. And Wayne's script looks like it has all the detals I need. Cheers for that.
Imap client? Jeez everyone uses Exchange Activesync, why on earth would anyone do imap.
why do imap? Because the protocols have long been established, you can use iOS devices (ipod, iphone, ipad), Android devices (tablets, phones), can use macs using iMail, Entourage, Outlook, Thunderbird, or windows with Windows Mail, Outlook, Outlook Express... you can hook it in your hotmail account to pull imap there, or gmail, yahoo mail etc, anywhere that can accept an imap client It makes absolute 100% sense and its a great decision imo!
oh an ActiveSync is a licenseable API, so like Google and Apple both license the AS API code, so symc would have to license it too
Good points but it's a bit of a stone age protocol. Not much use for syncing your calendar or contacts, or searching your GAL. Or remotely setting out-of-office, etc.
I suppose you could use both EAS and IMAP on a PDA but the support would be, um, challenging.
And what about archived calendar items?
I tried to run Wayne's script, but the CreateObject("EnterpriseVault.ContentManagementAPI") line fails, obviously because I have no reference in Tools/References to the right library.
I tried every DLL in C:\Program Files (x86)\Enterprise Vault\EVClient, but none was the correct one, even after displaying hidden members.
What library do I need?
You would need to install the actual API
the script is meant to run on a server installation or API installation
Where is the API installation please? Does it need an EV lic too? Thanks.
API is part of the install media, does not require a license
Hello,
So I've made a small VBS script which saves an archived item to a MSG file.
Basically, it calls http:/ /myserver.company.com/EnterpriseVault/viewmessage.asp?VaultId=myvaultID&SavesetId=mysavesetID&Format=MSG&FormatType=MSG and saves the binary stream result to an MSG file.
Couple of questions please:
1. Could that do any damage, like deleting this message or others? It won't be used very frequently enough to affect performance. Yes, I am paranoid.
2. I tried using download.asp instead of viewmessage.asp, with the same parameters as above, but the resulting MSG file is not vaild and will not open in Outlook. Any idea why?
Thanks,
- Alan.
PS - This does all I want, I don't need to look at APIs.
PPS - Sorry if this is a re-post, having problems posting.
test
1/ no. It's 'one' of the ways that end users access archived items... so it's normal.
2/ Share out the script and let's see. I've never tried using either method.
Many Thanks,
Rob
www.quadrotech-it.com - All your EV Tools
PS I hope that the post proves helpful.
Thanks Rob.
Well it's easy to test even without a script.
Just get the VaultID and SaveSetID of one of your archived messages.
Then open your browser and paste each of the links below, inserting your servername, vault and saveset IDs and removing the underscore from the h_ttp (needed to avoid post moderation).
h_ttp://myserver.company.com/EnterpriseVault/viewmessage.asp?VaultId=myvaultID&SavesetId=mysavesetID&Format=MSG&FormatType=MSG
h_ttp://myserver.company.com/EnterpriseVault/download.asp?VaultId=myvaultID&SavesetId=mysavesetID&Format=MSG&FormatType=MSG
You'll be prompted to save the unarchived message as an MSG file in each case.
Try to open the MSG files in Outlook (any version). In my case, only the MSG file from viewmessage.asp will open. I tried using Unicode or ANSI as FormatType, no help.
Anyone got documentation on the parameters maybe?
We're using EV904 against Exchange 2003/2010 here. Tried in IE9.
Then use ViewMessage.asp?
Would you like to reply?
Login or Register to post your comment.