Alfresco 3 Business Solutions: Types of E-mail Integration

Exclusive offer: get 50% off this eBook here
Alfresco 3 Business Solutions

Alfresco 3 Business Solutions — Save 50%

Practical implementation techniques and guidance for delivering business solutions with Alfresco

$38.99    $19.50
by Martin Bergljung | February 2011 | Content Management Open Source Web Development

The long-term vision for most ECM systems is to be able to handle almost any kind of content, and for many organizations e-mails are often next in line to manage after content such as documents, images, web content, and records. Alfresco can be used as an e-mail management solution and we will discuss what the difference is between that and an e-mail archiving solution.

In this article by Martin Bergljung, author of Alfresco 3 Business Solutions, we will look at the advantages and disadvantages between three different e-mail integration solutions and also learn how to use Alfresco's built in IMAP solution to:

  • Enable dragging-and-dropping of e-mails into the Alfresco repository
  • Enable e-mail attachment extraction
  • Enable viewing of document metadata from the e-mail client
  • Set up different folder mount points
  • Enable e-mail management in an Alfresco Share site

 

Alfresco 3 Business Solutions

Alfresco 3 Business Solutions

Practical implementation techniques and guidance for delivering business solutions with Alfresco

  • Deep practical insights into the vast possibilities that exist with the Alfresco platform for designing business solutions.
  • Each and every type of business solution is implemented through the eyes of a fictitious financial organization - giving you the right amount of practical exposure you need.
  • Packed with numerous case studies which will enable you to learn in various real world scenarios.
  • Learn to use Alfresco's rich API arsenal with ease.
  • Extend Alfresco's functionality and integrate it with external systems.
        Read more about this book      

(For more resources on Alfresco 3, see here.)

It is becoming more and more common that an ECM solution should include the possibility of storing e-mails in the repository, so they can be managed and searched in the same way all other content can. When we talk about managing e-mails in the content management system, it is important to know exactly what we mean by that. Today most companies and organizations want to use Alfresco for e-mail archiving, which is not something that is easily supported out of the box.

E-mail integration solutions

There are a number of different ways that an e-mail system can be integrated with the Alfresco CMS system. We will look at three of these and present advantages and disadvantages with each one.

The three different e-mail integration solutions are:

  • E-mail client talking directly to Alfresco via the IMAP protocol
  • E-mail client talking to Alfresco via custom built plugin and Web Scripts
  • E-mail server talking to Alfresco via custom module and Web Scripts

E-mail client talking directly to Alfresco via the IMAP protocol

This is the solution that is available out of the box with Alfresco. From version 3.2 and onwards Alfresco supports the IMAP protocol, which is one way an e-mail client can talk to e-mail servers (the other way is POP). So, with this solution Alfresco can behave like an IMAP e-mail server.

The following image illustrates how this solution works:

The e-mail clients typically receive an e-mail in their Inbox and then they can drag-and-drop that e-mail into an Alfresco folder via the IMAP channel. Any attachment can be extracted and handled separately to the e-mail in the Alfresco repository.

This is a manual process that requires the end user to manage what e-mails he or she wants to be stored in Alfresco. Nothing happens automatically and no e-mails are stored in Alfresco unless a user manually drag-and-drops them there

To achieve automatic archiving of e-mails, a user could set up an e-mail rule in their e-mail client that automatically files some or all e-mails into an Alfresco folder. However, we would still have to manually set up this rule on all users' e-mail clients. So we could not say that this would be an archiving solution that is transparent to the user, as it does not automatically force all e-mails to be saved for auditing purposes. Further on, the e-mail client has to be running in order for the e-mail rule to execute.

This solution is best thought of as an e-mail management solution where users collaborate and share information in e-mails.

The advantages of this solution are:

  • No client installation:In most e-mail clients we can set up an extra IMAP account connecting to Alfresco without the need to install any extra software on the client workstation. This includes Outlook, Lotus Notes, Mozilla Thunderbird, and GroupWise.
  • Users don't have to change working style:This is a big thing, users do not want to start learning a complete new way of managing e-mails, they just want to work in the same way they always have. The Alfresco account just shows up as another e-mail inbox in the e-mail client. Users can drag-and-drop e-mails between mailboxes just as they normally do. They do not have to learn any extra functionality.
  • Users don't have to change working style:This is a big thing, users do not want to start learning a complete new way of managing e-mails, they just want to work in the same way they always have. The Alfresco account just shows up as another e-mail inbox in the e-mail client. Users can drag-and-drop e-mails between mailboxes just as they normally do. They do not have to learn any extra functionality.
  • Supported out-of-the-box:No need to install any extra Alfresco modules, just configure some properties and the solution is ready to go.

The disadvantages of this solution are:

  • No document search:Users cannot search for documents in Alfresco and then attach them to an e-mail they want to send.
  • Cannot set custom metadata:Because this solution does not use any custom plugin on the e-mail client side there is no possibility of setting custom metadata for an e-mail, such as for example customer ID, before it is stored in Alfresco. However, you can often solve this problem by creating business rules on the server-side and apply custom metadata based on which folder an e-mail is dropped into.
  • No archiving solution:This is an e-mail collaboration and e-mail sharing solution, it does not force e-mail to be stored in the repository for compliance and regulatory reasons.

Because this solution doesn't require any client installation, or updates to the Alfresco server, it will probably be the most popular e-mail management solution. It can also easily be extended with folder rules to create sophisticated e-mail filing solutions.

E-mail client talking to Alfresco through custom built plugin and Web Scripts

There are one or two products out there that have taken a different approach to integrating e-mail clients with Alfresco. One of these products is Anovio Email Management solution for Outlook 2007 (http://www.anovio.de/aem). This product provides a solution that enables you to also work with documents from the e-mail client, and search for documents via the e-mail client.

To do this they had to implement a plugin for the e-mail client that is almost exclusively Outlook, and use Web Scripts to talk to Alfresco. The IMAP channel approach is not used as it can only handle e-mails.

The following picture gives us an overview of this solution:

This solution is also an e-mail management solution as it is up to the end user to actually save the e-mail into the repository. There is no automatic archiving going on.

The advantages of this solution are:

  • Document search: You can do a full text search for documents in the repository via the e-mail client. A document can then be attached to an e-mail that is about to be sent.
  • Users don't have to change working style: Users can drag-and-drop e-mails into the Alfresco repository in a way they are used to. They do not have to use, and learn, the extra document management functionality in the Outlook plugin if they do not want to.
  • Stores attachments directly: Attachments can be stored directly into the repository without storing the e-mail.
  • Stores attachments directly: Attachments can be stored directly into the repository without storing the e-mail.

The disadvantages of this solution are:

  • Client installationYou can do a full text search for documents in the repository via the e-mail client. A document can then be attached to an e-mail that is about to be sent.
  • Does not work for all e-mail clientsIt works only with certain e-mail clients, such as for example Outlook 2007, in the case of the Anovio product.
  • Users have to learn new functionalityIf users want to handle documents from the e-mail client then they have to learn new functionality. Also, there are usually new menus and features users have to learn even for the standard e-mail management functionality.
  • No archiving solution:This is an e-mail collaboration and sharing solution, it does not force e-mail to be stored in the repository for compliance and regulation reasons.
  • Not supported out of the box:It is not a part of the Alfresco package, so will need to be purchased separately.

This kind of solution can be very good for users that frequently need to attach documents from the Alfresco repository to e-mails that they are sending. However, if there is a larger user base, the maintenance burden could be quite substantial as you would need to install the plugin on every user's PC.

E-mail server talking to Alfresco through custom module and Web Scripts

This is the classical e-mail archiving solution where the e-mail system integration has been done on the e-mail server-side. This solution is totally transparent for the end users and usually complies with security regulations. What this means is that all e-mails are archived automatically without the user having to do anything, which guarantees that every incoming and outgoing e-mail has been filed and can be audited later.

There are—unfortunately, at the time of writing—no such solutions available for Alfresco.

But for reference purposes this is how such a solution would typically look:

This solution would require us to build an extension module for the e-mail server that captures all inbound and outbound e-mails and stores them in Alfresco without the users having to do anything. So all e-mails are captured and stored for archiving and auditing purposes.

Users can then for example, access the e-mails through the standard IMAP channel, if they are stored as standard MIME messages according to RFC-822 (http://tools.ietf.org/html/rfc822)

The advantages of this solution are:

  • Supports archiving and auditingThis is the only solution that would be compliant with security regulations as users are not involved, and cannot decide if an e-mail should be stored or not.
  • Users don't have to change working styleUsers can use their standard e-mail client to view archived e-mails.

The disadvantages of this solution are:

  • Requires server installation:We need to have access to the e-mail server and be able to install the integration module. This might be challenging in many situations when you might not be allowed to install anything on the e-mail server, or the e-mail server might be hosted externally so we would not have access to it.
  • Attachments are not extracted:The attachments would probably not be extracted and sorted into their own subfolder. This is assumed as the purpose of an e-mail archiving solution to store the complete original e-mail for auditing reasons, and not for e-mail management use.
  • Not a collaboration and sharing solutionE-mails are stored in an archiving structure and not in a project or case structure. Users would have more difficulty in collaborating around e-mail content.
  • Duplicate e-mails exist:There would be a lot of duplicate e-mails because of security regulations such as Sarbanes-Oxley that requires all e-mails to be stored for auditing purpose, even if it is a duplicate.
  • Not supported out of the boxIt is not a part of the Alfresco package so will need to be purchased separately, if it is available

This solution is mentioned here so we can easily tell the difference between an e-mail management solution and an e-mail archiving solution when we discuss this with potential clients. There has been a lot of misunderstanding around what e-mail integration solutions are currently available for Alfresco, where they are sometimes referred to as e-mail archiving solutions, which they are not.

Alfresco 3 Business Solutions Practical implementation techniques and guidance for delivering business solutions with Alfresco
Published: February 2011
eBook Price: $38.99
Book Price: $64.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Alfresco 3, see here.)

Implementing e-mail management solutions

Best Money has a couple of e-mail management requirements that they would like to implement. The first one is that they want to be able to use the MS Outlook e-mail client for dragging-and-dropping e-mails straight into Alfresco folders. They also want to be able to do automatic filing of e-mails based on patterns in the e-mail subject.

The solutions we will implement in this article will be based on the IMAP channel integration approach, which is the only solution available out of the box with Alfresco.

Implementing e-mail management solutions with Alfresco IMAP

We will start with a drag-and-drop solution that uses the out of the box IMAP server.

Configure Alfresco to enable the IMAP server

To enable the IMAP server we just have to set a couple of properties as follows in the alfresco-global.properties file:

imap.server.enabled=true
imap.server.port=143
imap.server.host=mbergljung-PC

When specifying the imap.server.host don't use localhost as that will not work. The IMAP server will be bound to the wrong network interface and you will not be able to successfully connect to the server from the e-mail client. An IP address would also work here.

Now start the server and the following should appear in the logs:

15:59:06,400 INFO [repo.imap.AlfrescoImapServer] IMAP service
started on host:port mbergljung-PC:143

The Alfresco server is now ready to act as an IMAP server for e-mail clients to connect to. It listens to IMAP port 143 that is for plain non-secure connections. The Alfresco IMAP solution does not, at the time of this writing, support secure connections on port 993.

To test the Alfresco IMAP solution, we first need a user that we can set up an account for in Microsoft Outlook. When we log in to Alfresco Explorer we will also see a new top folder called Imap Home as shown in the following screenshot:

Alfresco 3 Business Solutions: Types of E-mail Integration

This folder will be populated with mailboxes for the different users that connect through IMAP. For this example, we have set up a new user called martin.

Setting up an IMAP account in Outlook 2007

In the Outlook 2007 client, we set up a new IMAP account by selecting Tools followed by Account Settings... in the drop-down menu. Then select New... in the Account Settings dialog.

In the Choose E-mail Service dialog, we select Microsoft Exchange, POP3, IMAP, or HTTP and then click Next... and here we click the checkbox called Manually configure server settings or additional server types. In the next dialog window, choose Internet E-mail and then click Next. We should now see the following dialog:

Alfresco 3 Business Solutions: Types of E-mail Integration

Fill in the values as in the previous screenshot, use whatever username and password you created through Alfresco Explorer. Fill in the same hostname or IP for the SMTP server as for the IMAP server, this field needs to be specified even if we are not going to send e-mails from this account.

If the IMAP connection test is not successful when you test it via the Test Account Settings... button then first try and log in to Alfresco Explorer with the username and password that was used. If that works then check what IP address the IMAP server is bound to as follows:

C:\Users\mbergljung>netstat -an|find "143"
TCP 192.168.0.2:143 0.0.0.0:0 LISTENING

Now make sure that the same IP address is used as Incoming mail server, and when the connection test is successful click on the Next button to finish the setup of the new IMAP account.

We will see something like this in Outlook at this point:

Alfresco 3 Business Solutions: Types of E-mail Integration

The folders we see correspond to the same folders that user martin has permission to see when he logs in via the Alfresco Explorer user interface.

Note that it might take a minute or two before Outlook has updated the account so you can actually see all these folders. So do not panic if you do not see these folders at once, wait a bit and they should pop up.

Alfresco's IMAP solution will by default subscribe the user to all folders they have access to in Alfresco. This way the user does not have to subscribe to the folders before they are visible (that is in Outlook we can subscribe to folders via the IMAP Folders... menu item).

Users cannot unsubscribe to folders on an individual basis as the subscribe/unsubscribe feature in the Alfresco IMAP server is implemented globally for all users. So if for example, the admin user unsubscribes to a folder then all other users will also be unsubscribed to this folder.
If we need users to be able to subscribe and unsubscribe to folders on an individual basis then we can look at the OpsMailmanager product that supports this.

If we now log in to Alfresco Explorer, we will see some new folders created under the Imap Home top folder. These folders are only created for the user when he or she accesses the system via an IMAP connection:

Alfresco 3 Business Solutions: Types of E-mail Integration

These folders are special folders that are created by the E-mail client, such as for example the Junk E-mail mailbox that Outlook creates for all new accounts. Alfresco needs to store these "special" mailboxes somewhere and this is why the Imap Home top folder has been created.

Drag-and-drop e-mail into Alfresco folder in Outlook 2007

Now when we have everything set up, it is a simple task of dragging-and-dropping an e-mail from the standard Outlook Exchange Inbox into one of the folders under /Company Home that we have write permissions to.

For the initial testing of the drag-and-drop feature we can use the user's Alfresco home folder, as we can be sure that the user will have write permissions to it. In the following picture, we have dragged an e-mail from the Outlook Exchange Inbox to the user's Alfresco home folder /Company Home/User Homes/martin:

Alfresco 3 Business Solutions: Types of E-mail Integration

As we can see, the way we use the Alfresco e-mail account is exactly the same way we use any other e-mail account in Outlook. Just drag-and-drop e-mails between the accounts. If you want to keep the e-mail in the Outlook Exchange Inbox, and also store it in Alfresco, then you have to use copy and paste instead of drag-and-drop that will always move the e-mail.

Viewing the e-mail from Alfresco Explorer

Now, when we have an e-mail stored in the Alfresco repository it would be interesting to see how it is presented there. Log in to Alfresco Explorer with the same username and password that was used to set up the Alfresco IMAP account in Outlook, and then click on the My Home link at the top. You should see the e-mail displayed as follows:

Alfresco 3 Business Solutions: Types of E-mail Integration

The name of the e-mail node will have the format Message_<sequence number>.eml and cannot easily be changed without customizing the Alfresco source code. There is no naming plugin that we can implement to customize the naming convention of these e-mail nodes.

If we click on the link, (that is, Message_3285.eml) a preview page is displayed with all the properties of the e-mail and the e-mail body. This e-mail will now also be indexed and included in content searches.

If we click on the View Details button, we will see that a couple of extra e-mail metadata have been added to the node:

Alfresco 3 Business Solutions: Types of E-mail Integration

With the OpsMailmanager product a naming plugin can be created where the e-mail node name can be formatted in whatever way we want.

Alfresco 3 Business Solutions Practical implementation techniques and guidance for delivering business solutions with Alfresco
Published: February 2011
eBook Price: $38.99
Book Price: $64.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Alfresco 3, see here.)

E-mail attachment extraction

Th e Alfresco IMAP solution supports e-mail attachment extraction so when an e-mail with one or more attachments is dragged-and-dropped into an Alfresco folder all the attachments are extracted into a subfolder:

Alfresco 3 Business Solutions: Types of E-mail Integration

One subfolder per e-mail will be created. E-mail attachment extraction is turned on by default; if you look in repository.properties (located in webapps/alfresco/WEB-INF/classes/alfresco) you will find the following property that controls this:

imap.server.attachments.extraction.enabled=true

If for some reason attachment extraction is not working even though it is clearly turned on in the repository.properties file, then you can try and put the imap.server.attachments.extraction.enabled configuration in alfresco-global.properties instead—that has worked for me a couple of times.
If you would like to store all extracted attachments into the same subfolder, control what attachment types are extracted (Word, Excel, PPT, and so on), and what folders are enabled for attachment extraction, then have a look at the OpsMailmanager product.

Viewing document metadata from the e-mail client

One thing that is really cool is that you can browse the metadata for documents from the e-mail client and then decide to download a document if you like. This can be quite useful for mobile devices.

The way this works is that whenever a folder contains documents the metadata for them is wrapped into e-mails. This happens dynamically when you click on a folder. The metadata e-mails are then generated and you will see something like this in Outlook:

If we open one of these e-mails, we will see the metadata for the document and links to download the document and much more:

Alfresco 3 Business Solutions: Types of E-mail Integration

The e-mail body is controlled by a FreeMarker template that we can customize if we do not want to show all the information in the above e-mail body. This template is called emailbody-textplain.ftl and can be found in the /Company Home/DataDictionary/Imap Configs/Templates folder.

Dragging-and-dropping e-mails into Alfresco Share site

If we look in the /Company Home/Sites folder we will see that it is empty even if there are Alfresco Share sites that the user is a member of. A user who wishes to upload e-mails into an Alfresco Share site has to select it as an IMAP favorite in the Alfresco Share UI:

Alfresco 3 Business Solutions: Types of E-mail Integration

Then the Alfresco Share site will show up in the e-mail client as follows:

Alfresco 3 Business Solutions: Types of E-mail Integration

Here we have set up a Share site called alfres and the document library has been updated with two new subfolders. A user will not be able to add any e-mails into these folders until he or she has been invited to the Share site as at least a Contributor.

To be able to view metadata for documents in the document library the user must be at least a Collaborator in the site.

If a Share site does not show up in the e-mail client after we have selected it as an IMAP favorite in Alfresco Share, then we need to manually force an update of the folder list. In Outlook, we can do that by right-clicking on the account name and then selecting Update Folder List.

 

How to use Mount Points

So far a user can see all folders in Alfresco that he or she has read access to and the user can upload e-mails to any folder where he or she has write access. Further on, document metadata will be displayed for documents in any folder where the user is a Collaborator.

This is probably not what we want as e-mail clients (that is, the IMAP protocol) are usually not built to handle thousands of folders. What we want to do is mount certain folders as e-mail management folders and certain folders as document metadata viewing folders.

In Alfresco we can manage this by using the so-called Mount Points. There are three types of Mount Points (http://wiki.alfresco.com/wiki/IMAP#Mount_Point_Modes) that we can use:

  • ARCHIVE: Using a folder mount point of this type enables the folder for e-mail management (that is, we can write and read e-mails in this folder)
  • VIRTUAL: This mount point type enables the folder for document metadata viewing by dynamically generating a metadata e-mail/document
  • MIXED: It is a combination of ARCHIVE and VIRTUAL

The Alfresco IMAP system has one default mount point called AlfrescoIMAP defined with mount point type set to MIXED. The configuration looks like this:

imap.config.server.mountPoints=AlfrescoIMAP
imap.config.server.mountPoints.default.mountPointName=IMAP
imap.config.server.mountPoints.default.modeName=ARCHIVE
imap.config.server.mountPoints.default.store=${spaces.store}
imap.config.server.mountPoints.default.rootPath=/${spaces.company_
home.childname}
imap.config.server.mountPoints.value.AlfrescoIMAP.
mountPointName=Alfresco IMAP
imap.config.server.mountPoints.value.AlfrescoIMAP.modeName=MIXED

All properties in the imap.config.server.mountPoints.default namespace are default mount point property definitions. If we are happy with them then we do not need to specifically set them when defining a new mount point.

 

The AlfrescoIMAP mount point is using MIXED mount point type/mode and as the default mount point type/mode is set to ARCHIVE we need to specifically override it and set MIXED:

imap.config.server.mountPoints.value.AlfrescoIMAP.modeName=MIXED

The mount point name is also overridden to be Alfresco IMAP instead of just IMAP.

Now let's define two new mount points as follows:

  • Meeting e-mails: ARCHIVE mount point with root path set to /Company Home/Meetings
  • Documents: VIRTUAL mount point with root path set to /Company Home/docs

The configuration for these two mount points look like this:

imap.config.server.mountPoints=MeetingEmails,Documents
imap.config.server.mountPoints.value.MeetingEmails.
mountPointName=Meeting Emails
imap.config.server.mountPoints.value.MeetingEmails.rootPath=/${spaces.
company_home.childname}/Meetings
imap.config.server.mountPoints.value.Documents.
mountPointName=Documents
imap.config.server.mountPoints.value.Documents.modeName=VIRTUAL
imap.config.server.mountPoints.value.Documents.rootPath=/${spaces.
company_home.childname}/docs

The first thing we do when creating new mount points is to give them a name (not the visible name but a name to use when configuring them) and then specify these names in the imap.config.server.mountPoints property. By excluding the AlfrescoIMAP mount point from the property value it will no longer be active.

Then we override the default mount point values as needed. The MeetingEmails mount point has not specified any mount point type/mode, as the default ARCHIVE setting is correct.

After restarting the Alfresco server, we will see something like the following in the Outlook client:

Alfresco 3 Business Solutions: Types of E-mail Integration

As we can see, this view now looks a lot cleaner for the user and filters out all unnecessary folders and content.

Summary

This article has explained the different e-mail integration solutions that are available for Alfresco. The most common one is the support of the IMAP protocol in the Alfresco server that makes it easy for e-mail clients to configure a connection to Alfresco and drag-and-drop e-mails into the repository. No client software installation is required.

There are also other products, such as Anovio Email Management Solution, that require a plugin installation on the client-side, but also allows document management and search from the e-mail client.

We have learned that e-mail archiving is not currently supported for Alfresco and the solutions that are available for Alfresco are e-mail management solutions.

They require the user to be involved in storing an e-mail in Alfresco, and this is in contrast to an e-mail archiving solution that is transparent to the users and stores all e-mails automatically.


Further resources on this subject:


About the Author :


Martin Bergljung

Martin Bergljung is a Principal ECM Architect at Ixxus, a UK Platinum Alfresco partner. He has over 25 years of experience in the IT sector, where he has worked with the Java platform since 1997.

Martin began working with Alfresco in 2007, developing an e-mail management extension for Alfresco called OpsMailmanager. In 2009, he started working on Alfresco consulting projects and has worked with customers such as Pearson, World Wildlife Fund, International Financial Data Services, NHS, VHI Healthcare, Virgin Money, Unibet, BPN Paribas, University of Westminster, Aker Oilfield Services, and Amnesty International.

He is a frequent speaker and has delivered talks at Alfresco conferences in London, Berlin, and Barcelona. He is also the author of Alfresco 3 Business Solutions, Packt Publishing.

Books From Packt


Alfresco 3 Web Services
Alfresco 3 Web Services

Alfresco 3 Records Management
Alfresco 3 Records Management

Alfresco 3 Web Content Management
Alfresco 3 Web Content Management

Alfresco Developer Guide
Alfresco Developer Guide

Alfresco 3 Enterprise Content Management Implementation
Alfresco 3 Enterprise Content Management Implementation

Liferay Portal 6 Enterprise Intranets
Liferay Portal 6 Enterprise Intranets

MySQL Admin Cookbook
MySQL Admin Cookbook

Alfresco Enterprise Content Management Implementation
Alfresco Enterprise Content Management Implementation


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software