1

Topic: Using IMAP from remote client as opposed to localhost

======== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Linux/BSD distribution name and version: 12.0.4 Ubuntu
- Related log if you're reporting an issue:
====

I am able to retrieve emails using explicit calls to IMAP locally.  The problem is that if I run the same function from a remote machine, I am not able to connect to the IMAP anymore.

If need to change granting privileges for a specific user in table mysql, please advise which one?  If not, please share how you would solve such issue.

Thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Using IMAP from remote client as opposed to localhost

I don't know what your issue is.
What do you mean "using explicit calls to IMAP locally"?

3

Re: Using IMAP from remote client as opposed to localhost

ZhangHuangbin wrote:

I don't know what your issue is.
What do you mean "using explicit calls to IMAP locally"?

Let's say that I have an application that retrieves emails from the INBOX in java.

When I create a connection to the IMAP server when the app is on the same machine as iredmail, it works.

When I create the connection from a remote machine, such as my laptop, it fails.

Here is the code (in java):

   this.emailSession = Session.getDefaultInstance(props,null);
   this.emailStore = emailSession.getStore("imap");
   emailStore.connect(this.imap_host,this.imap_user, this.imap_password);

I suspect that one of my mysql users is not allowed to accept remote queries?!?

4

Re: Using IMAP from remote client as opposed to localhost

The java app or any client accessing IMAP doesn't access mysql directly - it communicates only with dovecot (imap server)...

Look for problem in network configuration (firewall) and/or dovecot

What exception do you get from the java class?

5

Re: Using IMAP from remote client as opposed to localhost

Please show us related error log/message, so that others can help troubleshoot.

6

Re: Using IMAP from remote client as opposed to localhost

ZhangHuangbin wrote:

Please show us related error log/message, so that others can help troubleshoot.

I catch a Messaging Exception (MessagingException) after the command:

   emailStore.connect(this.imap_host,this.imap_user, this.imap_password);

I know that each argument of the function is good.  In fact, like I said earlier, the connection is successful when the same class is deployed on the iredmail server.

I would like to investigate further the idea that the firewall might be blocking the call.  What port(s) should I be looking for in the iptables in this case?

7

Re: Using IMAP from remote client as opposed to localhost

Again, it's hard/impossible to help troubleshoot without showing us related error log/message.
Please, try to extract related log in Postfix log file, and your application log.