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.host =10.145.27.119 ----- This is the IP address of Alfresco Server
But I am not sure how to proceed further, I am not getting any new emails from Gmail.
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.
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.
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 Server properties
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.
Did you get a chance to look into this? Waiting for your reply.
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?
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.
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.
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.
I have only used the SMTP inbound with MS Exchange as the server, so I don't have too much more to add.
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.