Inbound is supported by alfresco and allows user to send email with attachment to alfresco. In this tutorial we are going to explain how to:
- Enable alfresco inbound
- Test if alfresco is receiving emails using telnet
Enabling alfresco inbound
Alfresco even though it supports inbound emails this feature is not enabled by default, in order to enable it you have to set this parameters into your alfresco global properties file
This next few properties are optional
email.server.port=25 #specify your port if this one is taken email.inbound.unknownUser=anonymous email.server.domain=localhost #specify your domain
Property unknownUser is interesting, as if this user exist in this case anonymous alfresco will receive emails from unknown addresses.
Only thing you need to set after this is DNS to when person sends email to firstname.lastname@example.org alfresco should receive it.
What is the email address for each node?
Each node has emailId property that will be visible when inbound is enabled. Can be seen in the properties of alfresco folder or file.
For share to work we have to add some configuration in the share-config-custom.xml
<config evaluator="aspect" condition="emailserver:aliasable"> <forms> <form> <field-visibility> <show id="emailserver:alias" /> </field-visibility> <appearance> <field id="emailserver:alias" /> </appearance> </form> </forms> </config>
This will look like this:
PS: you need to add aspect aliasable to desired node. This can be done with share manage aspects action.
Test if alfresco inbound feature is working
For testing we need to add user to EMAIL_CONTRIBUTORS group and that user must have email address set.
Second we need to have telnet in your computer, for windows users you can enable your telnet using instructions here.
Lets type some commands and send email to alfresco from console.
1 :Type telnet like so:
open localhost 25
Response from the server will be
220 localhost ESMTP SubEthaSMTP 3.1.6
2: Next we must say helo
Alfresco will respond with
3: Now we want to send email by typing next command
Email address must be known to the alfresco, or anonymous username will be used if exists.
Server should say
4: Now we will enter who is receiving the email, in this case receiver would be a folder that we know email id or alias value (inbox or 892 in this case)
Server will say :
5: Final part is to specify body of our email using commands like this:
Server will say
354 End data with <CR><LF>.<CR><LF>
We will continue with this ([enter] means press key enter)
Subject:alfrescoblog.com.txt[enter][enter] this is email test being sent from alfresco blog.[enter][enter] . [yes type dot][enter]
Server will respond with something like this if all was ok
Yeeeee we have sent the email to alfresco.
You can find your file in the inbox folder named as the subject in the email you have sent.
Sending email to alfresco with attachments
I have found this here and it works great!
Subject: This is a test mail Date: Thu, 24 Mar 2011 15:15:29 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001A_01CBEA36.4FC7F870" This is a multi-part message in MIME format. ------=_NextPart_000_001A_01CBEA36.4FC7F870 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit This is a test mail. ------=_NextPart_000_001A_01CBEA36.4FC7F870 Content-Type: image/x-png; name="Image1.png" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Image1.png" iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAIAAAADnC86AAAAFXRFWHRDcmVhdGlv biBUaW1lAAfb AxgPCwvMW+fiAAAAB3RJTUUH2wMYDwsbBO0U9gAAAAlwSFlzAAALEgAACxIB0t1+ /AAAAC1JREFU eNrtzQENAAAIAyC1f2eN8c1BAXorY0KvWCwWi8VisVgsFovFYrH4ZXzcfAFPgCy5 CQAAAABJRU5E rkJggg== ------=_NextPart_000_001A_01CBEA36.4FC7F870-- .
After you paste text above press enter .