Lately, I implemented the function that given the native emails on BlackBerry, fetch the email attachments in the email from the Exchange Server.
Input: Emails w/ attachments on BlackBerry (The email account is on the Exchange Server)
Output: Actual attachments of the email
Complexity:
1. The attachments in an email on BlackBerry are not download to the device, therefore there is no good method to get the actual attachments through RIM API.
2. RIM API provides limited access to the properties of emails, what you can get are basically listed in the link: http://www.blackberry.com/developers/docs/4.6.0api/net/rim/blackberry/api/mail/Message.html
3. According to different exchange server versions (mainly 2003 and 2007), there are different protocols and require different transformation format. For Exchange 2003, the protocol is WebDAV which stands for Web-based Distributed Authoring and Versioning. The transformation from Exchange Message to the DAV Message that the protocol recognizes (through SQL). For Exchange 2007, the protocol is EWS which stands for Exchange Web Services. The transformation from Exchange Message to the EWS Message that the protocol recognizes (through SOAP and XML).
Possible Solutions:
Pass in a set of attributes which can be reached from RIM API (not Message ID since that is only good for BlackBerry.) and are also the same with the email record on Exchange Server. Once targeted the correct email, fetch the attachments from the Exchange Server.
Final Solutions:
Attributes passed in: Subject, Sent Time and From.
Technical requirements:
1. RIM API
2. Exchange Server and Protocols (both WebDAV and EWS)
Reference:
1. http://msdn.microsoft.com/en-us/library/bb204119.aspx
2. http://en.wikipedia.org/wiki/WebDAV