Email to Alfresco Folder notes 009 Created 03/21/2011 T. Patrick Bailey Email to Alfresco Folder A lot of the notes from here are derived from http://wiki.alfresco.com/wiki/inbound_smtp_email_server_configur ation [1]. Alfresco has its own email server which can be turned on via configuration settings. It is possible to email and have the attachments in that email upload into a folder. First you need to open up port 25 on the alfresco server and you need to set the MX record for your website to your alfresco server (I am not going to go into detail on that here). Assuming this is set up here are the following steps that must be done. Edit the alfresco-global.properties file. In a typical set up this is located in the tomcat/shared/classes folder. Open that file up for editing and change the following fields. # # Alfresco Email Service and Email Server #------------- # Enable/Disable the inbound email service. The service could be used by processes other than # the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service. #------------- email.inbound.enabled=true # Email Server properties #------------- email.server.enabled=true email.server.port=25 email.server.domain=example.com email.inbound.unknownuser=anonymous email.server.connections.max=3 # A comma separated list of email REGEX patterns of allowed senders. # If there are any values in the list then all sender email addresses # must match. For example: #.*\@alfresco\.com,.*\@alfresco\.org # Allow anyone: #------------- email.server.allowed.senders=.* Here is a line by line explanation (as best I can give) email.inbound.enabled=true Just enable inbound email Page 1 of 10 email.server.enabled=true email.server.port=25 email.server.domain=example.com Turn on the alfresco email server bind it to port 25 and set the server domain name email.inbound.unknownuser=anonymous Any email from an unkown user will be uploaded as if it was uploaded by this alfresco user.
email.server.allowed.senders=.* A regex field that says what email addresses in are allowed. In this case any email would be allowed. Log into alfresco as a user with admin privileges. After this has been set up restart alfresco Set up an inbox user As an example, if an email comes in from bob@example.com and we have a bob user in alfresco who has an email set as bob@example.com. Then when an email comes into our alfresco server from bob@example.com it will be treated as if bob uploaded it. With that in mind I am making an inbox user. With that in mind make sure any email you plan to send from to alfresco has a user in alfresco associated with it or set the email.inbound.unknownuser to some type of inbox user within alfresco. I personally chose to only allow one user to email into my system, a google apps user, and to let that user filter out incoming emails. (letting googleapps filter junk mail, etc ) In addition any user who wants to upload via email has to be part of the alfresco group EMAIL_CONTRIBUTORS. With that in mind I am going to go through the steps of creating an inbox user and adding it to the EMAIL_CONTRIBUTORS group. Click on the admin console, then click on Manage System Users. Page 2 of 10
Click on Create User Set the name and email Address. Click Next Page 3 of 10
Set the username and password and Home Space then click next Finally Click Finish. Page 4 of 10
Click Show All then under EMAIL_CONTRIBUTORS click the add user button. Go back to the Admin Console and click Manage User Groups. Page 5 of 10
Finally click OK. I also gave this user admin privileges so that they could upload to any folder. Type in inbox click search, then select the inbox user and click add. Page 6 of 10
Set up an email alias for alfresco folder As it turns out you can email to a specific folder. Every folder in alfresco has an Email ID. To find this in alfresco go to a folder and click view details Here you can see the Email ID for this folder. If I wanted to upload to this folder I could email to 1040259@example.com (where example.com is the domain name for the email server) This can be a bit complex so you can give a folder an email aliases. Page 7 of 10
Set the Action to Add aspect The click Set Values and Add. To do this click on Run Action Select Email Alias and click OK. Page 8 of 10
Click Next Now the file has the aspect Email Alias Click Finish Click Edit properties Page 9 of 10
Set the Email alias to inbox now if you send an email (with attachment) to inbox@example.com it will load the document to this folder. After getting all that done I forgot to open up port 25 on my server oops References [1] Inbound SMTP Email Server Configuration, http://wiki.alfresco.com/wiki/inbound_smtp_email_server_configuration Visited 3/2011 [2] Inbound SMTP Email Server Configuration, http://keytocontent.blogspot.com/2010/05/upload-files-to-alfresco-via-email.html Visited 3/2011 Page 10 of 10