Mail Apps are a new feature of Exchange2013/Exchange Online that gives you a standard way of extending the functionality of Outlook,OWA and OWA for devices. The way this particular Mail app works is first, in the Manifest file there is a filter so it will only show on messages you open/view that have an attachment eg
- <Rule xsi:type="RuleCollection" Mode="And">
- <Rule xsi:type="ItemIs" FormType = "Read" ItemType="Message" />
- <Rule xsi:type="ItemHasAttachment" />
Note in this sample I'm using openstreetmap if you going to use this in your own environment or develop a similar solution using this code you need to be aware of the tile usage policy http://wiki.openstreetmap.org/wiki/Tile_usage_policy of this or any mapping service you decide to use.
To use a Mail App you need to host all the associated the files yourself somewhere see http://msdn.microsoft.com/en-us/library/office/fp161135(v=office.15).aspx for more details. With this particular application you need to host both the Mail App and also the controller service to allow you to get the attachment content. I've put a download of the hosted code for the Mail App here https://www.dropbox.com/s/6fzzc3hpli8x5sf/HostedFiles.zip the attachment service uses a modified version of http://code.msdn.microsoft.com/office/Mail-apps-for-Office-Get-38babdc9 I've included a copy of the modified controller in the download.