cancel
Showing results for 
Search instead for 
Did you mean: 

InboundSMTP configuration option?

sscbrian
Champ on-the-rise
Champ on-the-rise
Is there any way to configure InboundSMTP to behave in a SharePoint compatible manner?  Our current SharePoint site receives e-mails into a particular folder.  Each e-mail received automatically is put into a new sub-folder with the e-mail text and attachment stored (as separate files) in that folder.  The sub-folder with the contents receives the name from the subject line of the e-mail.

So far, in Alfresco, I've only been able to get all the attachments and text for e-mails to show up in a single folder.  Attachments with significantly different names from the e-mail subject become widely separated in the list.  That makes it really hard to figure out which attachment goes with what text in our high volume situation.

Any other solutions I'm missing?
6 REPLIES 6

mrogers
Star Contributor
Star Contributor
The inbound SMTP is supposed to be pluggable.   Meaning that how inbound messages are handled can have an implementation class plugged in.    It should be a simple enhancement.

sscbrian
Champ on-the-rise
Champ on-the-rise
Can you give me any pointers on where to plug-in?  So far all I've uncovered is information about 4.2, which doesn't seem to apply anymore.  Apparently InboundSMTP changed quite a bit in 5.0.a.  I'm having a really hard time figuring out how to get started.

hgindl
Champ in-the-making
Champ in-the-making
i think a good starting point to look for would be to overwrite https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/source/ja...

kind regards,
Hannes

mrogers
Star Contributor
Star Contributor
That's the class but you should be able to "plug in" your own rather than "overwriting".   

Just replace the following spring bean:


   <bean id="folderEmailMessageHandler"
      parent="emailMessageHandlerBase"
      class="org.alfresco.email.server.handler.FolderEmailMessageHandler" >
   
      <property name="overwriteDuplicates">
          <value>${email.handler.folder.overwriteDuplicates}</value>           
        </property>
    </bean>

sscbrian
Champ on-the-rise
Champ on-the-rise
Well, I'm trying.  Been fighting with it the last couple of days, but I'm now out of ideas and stuck.

For testing purposes, I took the original FolderEmailMessageHandler.java and just commented out the addAttachments call.  I can compile it successfully and I'm placing it in tomcat\webapps\alfresco\WEB-INF\lib as "company-email.jar".  I tried making a simple override InboundSMTP.xml, but could not get it working.  Ended up copying the default one and modify the bean as you show (but with the class I used in my compiled folder e-mail handler).  I then placed that file (as InboundSMTP-context.xml) in tomcat\shared\classes\alfresco\extension.

I know the XML file is being hit on startup because any errors in it will show up in the log (and break InboundSMTP).  One known problem is that I can't get my InboundSMTP-context.xml to use the InboundSMTP properties (neither default, nor one I create and place in extension).  So, I had to replace all the <value> variables with hard coded values to get Alfresco to start again.

At this point, Alfresco starts up fine and I receive no more errors, but my code is never called.  Folder InboundSMTP still is handled via the default handler.  What piece am I missing?

sscbrian
Champ on-the-rise
Champ on-the-rise
Aha!  I finally got it!  InboundSMTP-context.xml needs to be dropped into tomcat/shared/classes/alfresco/extension/subsystems/email/InboundSMTP/inbound for the override to work!