Sunday, July 11, 2010

Inbound Emails with Windows localhost

In May I wrote a brief post that showed how you can post emails to the Alfresco server for automatic capture and upload into a specified Folder.  It's a great way to upload email content into Alfresco without having to bring up the Alfresco client interface.  This is powerful feature that I really like.

A few useful scenarios come to mind with this functionality:
  1. You can compose a new email with information and add attachments that you send to an Alfresco folder.  You don't need to bring up the client and navigate to the correct folder/space.
  2. You receive an email containing important information or attachments and you simply forward the email to the Alfresco folder.
  3. You can just add the target Alfresco folder alias as a cc and capture into Alfresco important emails messages when you send them.  This is a very simple way to capture emails and requires very little overhead time for interacting with the repository.
So I wanted to be able to easily demonstrate this functionality.  My previous post showed how you can setup inbound email on a server exposed on the internet.  In that case I had Alfresco installed on an Amazon EC2 server.  But I wanted to also be able to show this functionality working just on an isolated installation of Alfresco on my laptop.

It's easy to setup and here are some steps in the variation of what I described previously.  With these changes I set up Outlook Express on my Windows machine to be able to send inbound emails to the Alfresco server installed on the same machine.

Step 1  Enable the Alfresco email server to run on port 25.  See step 1 of the previous post.

Step 2  Add to the Windows hosts file.
c:\windows\system32\drivers\etc\hosts       localhost

Step 3  Configure Outlook Express (or other email client)

From the Tools menu, select Accounts...
Select the option to add a new Mail account.

Add the Display Name to use and click Next.

Add the email address.  This address needs to match the email address assigned to an Alfresco user.  In this case, I plan to use this while demonstrating as user admin, so I add the email address

Then configure the Outgoing mail SMTP server to be

Finally, enter the user name and the password for this account (admin and admin).
And then Finish the wizard.

Step 4  Setup user admin within Alfresco Share

The email address for user admin is set to -- which matches what was entered into the Outlook Express configuration.

And the user (admin) as added to the EMAIL_CONTRIBUTORS group.

Step 5  Set up an email alias folder name within Share.

Create and/or navigate to the target email folder within share.  In this case I have a folder named MailFolder within a Share Site documentLibrary area.  Add the Aliasable (Email) aspect to the folder.  Doing that will add a new metadata field that holds the name of the folder alias.
Everything is cool up until this point.  Unfortunately the email alias name field is not exposed from the Share interface.  You'll need to bring up the Alfresco JSF explorer client and navigate to the same space that you just created (or do all of this step in the Explorer client).  There you can enter the alias name for the folder.  In this case we call it 'mailfolder'.  Note that the alias name you choose is case sensitive.

Step 6   Send a Test Email

Next to test it, we send an email to mailfolder, the alias name in Alfresco that we just set up.  If we now navigate into the target Share site folder, we can see the document that was just sent.

No comments:

Post a Comment