Author Topic: [SOLVED]connect IMAP server failed  (Read 8456 times)

Offline sorryboy

  • Jr. Member
  • **
  • Posts: 23
[SOLVED]connect IMAP server failed
« on: October 17, 2014, 01:54:18 AM »
Hi
Today ,when I login to my roundcube , the message appear "connect IMAP server failed" after more than 30 seconds..

and then I checked environment , log , service , it seems no problem. because when I using outlook with IMAP protocol ,it is work.

I really don't know ,why the connection failed. below is some information ,and my version is 1.0.2.

12:18 fbismc@gate2:~ #tail /var/log/dovecot-info.log
Oct 17 12:15:47 auth-worker(default): Info: pam(fbismc,10.0.0.55): #1/1 style=1 msg=Password:
Oct 17 12:15:47 auth(default): Info: client out: OK     1       user=fbismc
Oct 17 12:15:47 auth(default): Info: master in: REQUEST 3       88406   1
Oct 17 12:15:47 auth-worker(default): Info: passwd(fbismc,10.0.0.55): lookup
Oct 17 12:15:47 auth(default): Info: master out: USER   3       USERNAME  system_groups_user=USERNAME       uid=17354       gid=0   home=/JOY/USER/fbismc
Oct 17 12:15:47 imap-login: Info: Login: user=<USERNAME>, method=PLAIN, rip=10.0.0.55, lip=192.168.1.20
Oct 17 12:15:47 auth(default): Info: new auth connection: pid=89241
Oct 17 12:15:47 auth(default): Info: new auth connection: pid=89242
Oct 17 12:16:33 IMAP(fbismc): Info: Disconnected: Logged out bytes=2091/33733
Oct 17 12:16:33 IMAP(fbismc): Info: Disconnected: Logged out bytes=63/952

================================================

[Fri Oct 17 13:21:41 2014] [error] [client 10.0.0.55] PHP Warning:  Login failed for USERNAME from 10.0.0.55. Could not connect to mail2.joy-tech.com.tw:143: Operation timed out in /usr/local/www/apache22/data/roundcube/program/lib/Roundcube/rcube.php on line 1245

================================================
« Last Edit: October 22, 2014, 10:53:59 PM by sorryboy »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: connect IMAP server failed
« Reply #1 on: October 18, 2014, 11:16:01 AM »
The message in error log would suggest a firewall problem. Can you telnet from you webserver to you IMAP server?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline sorryboy

  • Jr. Member
  • **
  • Posts: 23
Re: connect IMAP server failed
« Reply #2 on: October 19, 2014, 09:44:15 PM »
yes ,web server and roundcube are in the same host with FreeBSD release 9.1

#telnet 192.168.1.20 143
Trying 192.168.1.20...
Connected to mail2.intra.net.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
al LOGIN Username PASSWD
al OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in


Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: connect IMAP server failed
« Reply #3 on: October 20, 2014, 02:44:05 AM »
That proves nothing. You instance of Roundcube is configued to access mail2.joy-tech.com.tw:143 not 192.168.1.20:143. Please test properly.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline sorryboy

  • Jr. Member
  • **
  • Posts: 23
Re: connect IMAP server failed
« Reply #4 on: October 21, 2014, 02:04:11 AM »
Well ,the test is works.
=====================
telnet mail2.joy-tech.com.tw 143
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
al LOGIN USERNAME PASSWD
al OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in
a1 LOGOUT
* BYE Logging out
a1 OK Logout completed.
Connection closed by foreign host.
=====================

The situation is I have a CNAME in MX Record : For Example ,below is INTERNET dns
MX Record ===>real.abc.com.tw
mail2.abc.com.tw IN CNAME  real.abc.com.tw

=====================

below is INTRANET dns
real.abc.com.tw    IN CNAME mail2.abc.com.tw

=====================
dovecot is install in real.joy-tech.com.tw , because of some reason ,the 143 port can't forward to real.joy-tech.com.tw,
I don't know why cause this problem , so I change IMAP and SMTP to real.abc.com.tw  in config file ,and it is works now.
but there is still have a problem , the personal address book  is empty ,even I restore roundcube database .
how can I restore the personal address book.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: connect IMAP server failed
« Reply #5 on: October 21, 2014, 06:29:38 AM »
Quote
but there is still have a problem , the personal address book  is empty ,even I restore roundcube database .
how can I restore the personal address book.

in the users table in the database there is column i think called host. i might have the name wrong but it is the column with the imap server host name in. you need to update that to your new host.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline sorryboy

  • Jr. Member
  • **
  • Posts: 23
Re: connect IMAP server failed
« Reply #6 on: October 22, 2014, 03:05:48 AM »
After I using  UPDATE `users` SET `mail_host`='real.abc.com.tw' WHERE `mail_host`='mail2.abc.com.tw';
The addressbook is working! thanks a lot for suggestion