IMAP Configuration

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

IMAP Configuration

Hi,

I am trying to implement IMAP to push/pull email between Alfresco and Gmail where I want to get new emails from Gmail to Alfresco. I have done the following configuration in alfresco-global.properties.

imap.server.enabled=true
imap.server.port=143
imap.server.host =10.145.27.119 ----- This is the IP address of Alfresco Server

imap.server.attachments.extraction.enabled=true

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

But I am not sure how to proceed further, I am not getting any new emails from Gmail.

Regards,

Shankha

8 Replies
Highlighted
Active Member II

Re: IMAP Configuration

Shankha,

So what you have done so far is prepare the Alfresco server to receive requests from an IMAP client, like outlook or thunderbird.

What you need to do now is configure your email client to connect to connect to Alfresco as if it were any other IMAP-capable email server.  The steps vary depending on the email client, but what you are left with is the ability to use your email client as a frontend to Alfresco, including being able to copy emails to alfresco through the email client, read content through the email client and so on.

If you are looking for the ability to receive inbound email directly to the Alfresco server, and not rely on a email client to copy the email to the server, then you want to look into enabling Alfresco to accept inbound SMTP email (https://docs.alfresco.com/5.2/concepts/email-inboundsmtp-props.html).

You can chose to do either or both, depending on your use cases.

Dan

Highlighted
Active Member

Re: IMAP Configuration

Hi Dan,

I am trying to implement both the features.

1. Prepare the Alfresco server to receive requests from an IMAP client - Here I am using G Suite app where IMAP has been already enabled. I have updated the  alfresco-global.properties file as below.

imap.server.enabled=true
imap.server.port=143
imap.server.host =10.145.27.119

###IMAP Configuration###
imap.server.imaps.enabled=true
imap.server.imaps.host=imap.gmail.com
imap.server.imaps.protocol=IMAPS
imap.server.imaps.port=993
imap.server.attachments.extraction.enabled=true
imap.server.username=**************
imap.server.password=**************

imap.server.incoming.interval=60
imap.server.incoming.disconnectdelay=1
imap.server.incoming.encryption.protocols=TLSv1
imap.server.incoming.enablessl=true
imap.server.incoming.ignoresslcertificates=false
imap.server.incoming.mailconnectiondebug=true
imap.server.incoming.timeout.seconds=90

imap.server.attachments.extraction.enabled=true

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

Still I don't see any communication. Anything more I need to configure on Alfresco or Gmail end?

2.  Looking for the ability to receive inbound email directly to the Alfresco server - I have done the below configuration in alfresco-global.properties file.

# 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=2025
email.server.domain=10.145.27.119
email.inbound.unknownUser=anonymous

email.server.allowed.senders=.*

Along with this I have done EMAIL_CONTRIBUTOR and Alias configuration in Alfresco.

But if I send any email from Gmail to Alfresco I don't see any email where as if I send email from SMTPMailSender I can receive email to Alfresco.

Regards,

Shankha

Highlighted
Active Member

Re: IMAP Configuration

Hi Dan,

Did you get a chance to look into this? Waiting for your reply.

Regards,

Shankha

Highlighted
Active Member II

Re: IMAP Configuration

For the first scenario, I have only tried connecting to alfresco with outlook and thunderbird, and haven't tried gmail, but you should look at connecting to alfresco with an email client in the same way that you would look to connect your email client to some other IMAP server, like Yahoo.  When setting up the connection in your client, you will be asked for the name of the Mail server (your Alfresco server), the port of the mail server (port 143 in your case), and the credentials to make the connection (some Alfresco credentials).  You should know at the time you are setting your client up whether things are working or not.  The client will complain if it can't connect to the Alfresco server, in the same way your client would complain if it couldn't connect to some other IMAP mail server like Yahoo.

It would be the same kind of thing if you decided to enable Alfresco to accept FTP connections.  Enabling FTP doesn't actually "do" anything, other then be ready to accept connections.  Once enabled, you can use an FTP client to connect and create/update/delete content, and as far as the FTP client is concerned, you are connecting to some plain FTP server.  In your case, your are setting your Alfresco server so that when a IMAP client connects to it, it appears to the client as if its a plain IMAP server.

So if you know all that and I am telling you things you have already figured out, then let me know what errors you are getting and we can try something else.

For the second scenario, I assume that you have followed the steps laid out in https://docs.alfresco.com/5.2/concepts/email-intro.html ?  If so, are you getting any errors on your email server or your Alfresco server?  Anything bounced back to your mail client?

Highlighted
Active Member

Re: IMAP Configuration

Hi Dan,

Our business requirement is whenever an end user sends an email to a corporate gmail id which is dedicated for Alfresco that mail should be pushed to Alfresco along with the attachment. I am looking into the below options.

Option 1 - Pull new emails from corporate gmail id using IMAP and store into Alfresco. I am not very sure about the IMAP solution you have given is suitable for our business requirement. Because the solution you have provided is more like using email client as a front end to Alfresco using IMAP.

Option 2- Push the new emails from corporate gmail id to Alfresco server whenever any new email comes. May be I will look into email forwarding option later on but right now I am just trying to send emails manually from orporate gmail id to Alfresco server. But around after 24 hrs I am getting the below message in corporate gmail id The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [10.145.27.119 10.145.27.119: timed out

Here 10.145.27.119 is the IP address of Alfresco server which is hosted in EC2 box where the required ports are open.

Regards,

Shankha

Highlighted
Active Member II

Re: IMAP Configuration

For the record, I am not recommending one or the other.  I was just trying to tease out what you were really asking, and I agree, your original question doesn't match up with the use case you describe above.

So, ignoring the IMAP use case, let's focus on the inbound SMTP example.  I would recommend troubleshooting this in a couple of pieces to isolate the different technologies.  The two things you need to watch out for here are:

 - Configure the Alfresco server to ingest inbound SMTP.  It looks like you have made some changes for this.  To test this piece only, you can "send" and an email via telnet directly to the Alfresco server.  You will be able to see immediately if your alfresco pieces are working, and be confident that that part is working.  If you haven't done it before, there are many examples of sending an email with telnet out there.

 - Configure your email server to route the emails correctly.  This is going to depend on your email environment, and i would recommend working with your mail administrators to work through this.  What you essentially want to do is allow an email sent to a publicly available email address get rerouted to your Alfresco server.

Good Luck!

Highlighted
Active Member II

Re: IMAP Configuration

Here is a good discussion on doing what you are trying to do with gmail as a server.  It sounds like it may not be possible to _directly_ do using gmail as your server.  For ideas of how you can do it, look at the 2nd and third from the bottom of the exchange.  

https://groups.google.com/forum/#!topic/alfresco-technical-discussion/-dwyozPgKCw

I have only used the SMTP inbound with MS Exchange as the server, so I don't have too much more to add.

Dan

Highlighted
Active Member

Re: IMAP Configuration

Hi Dan,

I am already able to send the email via Telnet. As you suggested I will work with mail administrator  to route the emails correctly. I will get in touch with you if I face anymore issues to achieve the particular use case. Thanks a lot for your support.

Regards,

Shankha