| 
    
     | 
       
        | Author |  |  
        | hrzrahimi Newbie
 
  
 
 Joined: 12 October 2014
 Location: Iran
 Online Status: Offline
 Posts: 1
 | 
          Hi all
           | Posted: 12 October 2014 at 4:35am | IP Logged |   |  
           | 
 |  I install webmail in xampp and set the mail setting follow bellow:
 
 Incoming login : example@gmail.com
 Incoming mail : imap.gmail.com  port : 993
 Outgoing login : example@gmail.com
 Outgoing mail : smtp.gmail.com port : 587
 
 but I have an error that said : "Can't connect to mail server"
 
 how can I solve this problem ?
 |  
        | Back to Top |     |  
        |  |  
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Any debug should start with enabling log file. Enable logging at debug level in System/Logging, try again, and check the log file for more information.
           | Posted: 12 October 2014 at 9:40am | IP Logged |   |  
           | 
 |  
 Also, make sure you can telnet the given host and port from the server machine (to make sure the issue isn't related with the server, not with WebMail Pro).
 
 Regards,
 Alex
 |  
        | Back to Top |     |  
        |  |  
        | rino88au Newbie
 
  
 
 Joined: 16 October 2014
 Online Status: Offline
 Posts: 24
 | 
          I'm having the same problem "Can't connect to mail server" when I try to connect to gmail.
           | Posted: 17 October 2014 at 5:48am | IP Logged |   |  
           | 
 |  
 Here is a copy of the log:
 
 #0 ../libraries/afterlogic/common/managers/webmail/manager.php(142): CApiUsersManager->CreateAccount(Object(CAccount), true)
 #1 ../libraries/afterlogic/common/managers/integrator/manager.php(776): CApiWebmailManager->CreateAccountProcess('r****67@gmai...', 'p*******c', '', Array)
 #2 ../libraries/ProjectSeven/Actions.php(2499): CApiIntegratorManager->LoginToAccount('r****67@gmai...', 'p*******c', '', '')
 #3 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #4 ../libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #5 ../libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #6 ../index.php(80): include('/home3/webmail55...')
 #7 {main}
 [12:33:20.87][2b4b3727] Event: r****67@gmail.com > login-failed
 [12:33:20.87][2b4b3727] exception 'CApiManagerException' with message 'Can't connect to mail server' in ../libraries/afterlogic/common/managers/users/manager.php:467
 Stack trace:
 #0 ../libraries/afterlogic/common/managers/webmail/manager.php(142): CApiUsersManager->CreateAccount(Object(CAccount), true)
 #1 ../libraries/afterlogic/common/managers/integrator/manager.php(776): CApiWebmailManager->CreateAccountProcess('r****67@gmai...', 'p*******c', '', Array)
 #2 ../libraries/ProjectSeven/Actions.php(2499): CApiIntegratorManager->LoginToAccount('r****67@gmai...', 'p*******c', '', '')
 #3 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #4 ../libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #5 ../libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #6 ../index.php(80): include('/home3/webmail55...')
 #7 {main}
 |  
        | Back to Top |     |  
        |  |  
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          To determine what's causing this, complete log is required. Please make sure log verbosity is set to Debug. You can send us logs privately via HelpDesk.
           | Posted: 17 October 2014 at 5:50am | IP Logged |   |  
           | 
 |  
 Also, please let us know the version of PHP you currently run. Thanks.
 
 --
 Regards,
 Igor, AfterLogic Support
 |  
        | Back to Top |     |  
        |  |  
        | rino88au Newbie
 
  
 
 Joined: 16 October 2014
 Online Status: Offline
 Posts: 24
 | 
          Here is a copy of a complete log as requested:
           | Posted: 17 October 2014 at 6:25am | IP Logged |   |  
           | 
 |  
 The running PHP version is 5.4.24
 
 ///////////////////////////////////////////////////////
 [13:01:55.37][f69f2f95] Location: index.php
 
 [13:01:55.76][6dfc8c4a] [GET][ip:1*7.**.**.**] /webmail55/adminpanel/index.php
 [13:01:55.76][6dfc8c4a] POST > []
 [13:01:55.76][6dfc8c4a]
 [13:01:55.76][6dfc8c4a] call CCommonModule->PopulateData->SystemLogging()
 [13:01:55.76][6dfc8c4a] call CWebMailModule->PopulateData->SystemLogging()
 
 [13:01:59.68][f83e34b6] [POST(6)][ip:1*7.**.**.**] /webmail55/index.php?/Ajax/
 [13:01:59.68][f83e34b6] POST > [Action, Email, IncLogin, IncPassword, SignMe, Token]
 [13:01:59.68][f83e34b6]
 [13:01:59.68][f83e34b6] AJAX: Action: Login
 [13:01:59.68][f83e34b6] DB(PDO/mysql) : start connect to visco_extra@localhost
 [13:01:59.68][f83e34b6] DB : PDO(mysql:dbname=visco_test;host=localhost;charset=utf8)
 [13:01:59.69][f83e34b6] DB : connected to visco_extra@localhost
 [13:01:59.69][f83e34b6] DB[1] > SELECT `id_acct`, `id_user`, `id_domain`, `id_tenant`, `deleted`, `def_acct`, `mailing_list`, `quota`, `email`, `friendly_nm`, `mail_protocol`, `mail_inc_host`, `mail_inc_port`, `mail_inc_login`, `mail_inc_pass`, `mail_inc_ssl`, `mail_out_host`, `mail_out_port`, `mail_out_login`, `mail_out_pass`, `mail_out_auth`, `mail_out_ssl`, `hide_in_gab`, `signature`, `signature_type`, `signature_opt`, `custom_fields` FROM awm_accounts WHERE `def_acct` = 1 AND `email` = 'r****67@gmail.com'
 [13:01:59.69][f83e34b6] DB[2] > SELECT `id_domain`, `id_tenant`, `disabled`, `name`, `url`, `override_settings`, `is_internal`, `site_name`, `lang`, `def_user_timezone`, `def_user_timeformat`, `def_user_dateformat`, `allow_registration`, `allow_pass_reset`, `allow_webmail`, `mail_protocol`, `mail_inc_host`, `mail_inc_port`, `mail_inc_ssl`, `mail_out_host`, `mail_out_port`, `mail_out_auth`, `mail_out_login`, `mail_out_pass`, `mail_out_ssl`, `mail_out_method`, `check_interval`, `skin`, `msgs_per_page`, `allow_change_interface_settings`, `allow_change_account_settings`, `allow_users_add_acounts`, `allow_new_users_register`, `allow_open_pgp`, `layout`, `xlist`, `use_threads`, `allow_contacts`, `contacts_per_page`, `global_addr_book`, `allow_calendar`, `cal_show_weekends`, `cal_workday_starts`, `cal_workday_ends`, `cal_show_workday`, `cal_week_starts_on`, `cal_default_tab`, `allow_files`, `allow_helpdesk` FROM awm_domains WHERE `name` = 'gmail.com'
 [13:01:59.69][f83e34b6] DB[3] > SELECT COUNT(id_acct) as acct_count FROM awm_accounts
 WHERE def_acct = 1 AND `email` = 'r****67@gmail.com' AND `mail_inc_login` = 'r****67@gmail.com'  LIMIT 1
 [13:01:59.70][f83e34b6] IMAP[NOTE]: Start connection to "ssl://imap.gmail.com:993"
 [13:02:19.72][f83e34b6] PHP[NOTICE]: /home3/webmail55/libraries/MailSo/Net/NetClient.php [line:221, code:2]
 [13:02:19.72][f83e34b6] PHP[NOTICE]: Error: fsockopen(): unable to connect to ssl://imap.gmail.com:993 (Connection timed out)
 [13:02:19.72][f83e34b6] IMAP[NOTICE]: exception 'MailSo\Net\Exceptions\SocketCanNotConnectToHostException' with message 'Can't connect to host "ssl://imap.gmail.com:993"' in /home3/webmail55/libraries/MailSo/Net/NetClient.php:226
 Stack trace:
 #0 /home3/webmail55/libraries/MailSo/Imap/ImapClient.php(141): MailSo\Net\NetClient->Connect('imap.gmail.com', 993, 1)
 #1 /home3/webmail55/libraries/afterlogic/common/managers/users/manager.php(412): MailSo\Imap\ImapClient->Connect('imap.gmail.com', 993, 1)
 #2 /home3/webmail55/libraries/afterlogic/common/managers/webmail55/manager.php(142): CApiUsersManager->CreateAccount(Object(CAccount), true)
 #3 /home3/webmail55/libraries/afterlogic/common/managers/integrator/manager.php(776): CApiWebmailManager->CreateAccountProcess('r****67@gmai...', 'p*******c', '', Array)
 #4 /home3/webmail55/libraries/ProjectSeven/Actions.php(2499): CApiIntegratorManager->LoginToAccount('r****67@gmai...', 'p*******c', '', '')
 #5 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #6 /home3/webmail55/libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #7 /home3/webmail55/libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #8 /home3/webmail55/index.php(80): include('/home3/wemail...')
 #9 {main}
 [13:02:19.72][f83e34b6] Exception[1011]: Can't connect to mail server
 ~ /libraries/afterlogic/common/managers/users/manager.php (467)
 ----------------------------------------------------------------------
 #0 /home3/webmail55/libraries/afterlogic/common/managers/webmail55/manager.php(142): CApiUsersManager->CreateAccount(Object(CAccount), true)
 #1 /home3/webmail55/libraries/afterlogic/common/managers/integrator/manager.php(776): CApiWebmailManager->CreateAccountProcess('r****67@gmai...', 'p*******c', '', Array)
 #2 /home3/webmail55/libraries/ProjectSeven/Actions.php(2499): CApiIntegratorManager->LoginToAccount('r****67@gmai...', 'p*******c', '', '')
 #3 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #4 /home3/webmail55/libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #5 /home3/webmail55/libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #6 /home3/webmail55/index.php(80): include('/home3/wemail...')
 #7 {main}
 [13:02:19.72][f83e34b6] Exception[1011]: Can't connect to mail server
 ~ /libraries/afterlogic/common/managers/users/manager.php (467)
 ----------------------------------------------------------------------
 #0 /home3/webmail55/libraries/afterlogic/common/managers/webmail55/manager.php(142): CApiUsersManager->CreateAccount(Object(CAccount), true)
 #1 /home3/webmail55/libraries/afterlogic/common/managers/integrator/manager.php(776): CApiWebmailManager->CreateAccountProcess('r****67@gmai...', 'p*******c', '', Array)
 #2 /home3/webmail55/libraries/ProjectSeven/Actions.php(2499): CApiIntegratorManager->LoginToAccount('r****67@gmai...', 'p*******c', '', '')
 #3 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #4 /home3/webmail55/libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #5 /home3/webmail55/libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #6 /home3/webmail55/index.php(80): include('/home3/wemail...')
 #7 {main}
 [13:02:19.72][f83e34b6] exception 'CApiManagerException' with message 'Can't connect to mail server' in /home3/webmail55/libraries/afterlogic/common/managers/users/manager.php:467
 Stack trace:
 #0 /home3/webmail55/libraries/afterlogic/common/managers/webmail55/manager.php(142): CApiUsersManager->CreateAccount(Object(CAccount), true)
 #1 /home3/webmail55/libraries/afterlogic/common/managers/integrator/manager.php(776): CApiWebmailManager->CreateAccountProcess('r****67@gmai...', 'p*******c', '', Array)
 #2 /home3/webmail55/libraries/ProjectSeven/Actions.php(2499): CApiIntegratorManager->LoginToAccount('r****67@gmai...', 'p*******c', '', '')
 #3 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #4 /home3/webmail55/libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #5 /home3/webmail55/libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #6 /home3/webmail55/index.php(80): include('/home3/wemail...')
 #7 {main}
 
 Next exception 'ProjectSeven\Exceptions\ClientException' with message 'ClientException' in /home3/webmail55/libraries/ProjectSeven/Actions.php:2538
 Stack trace:
 #0 [internal function]: ProjectSeven\Actions->AjaxLogin()
 #1 /home3/webmail55/libraries/ProjectSeven/Service.php(252): call_user_func(Array)
 #2 /home3/webmail55/libraries/ProjectSeven/Boot.php(5): ProjectSeven\Service->Handle()
 #3 /home3/webmail55/index.php(80): include('/home3/wemail...')
 #4 {main}
 [13:02:19.72][f83e34b6] INFO[MEMORY]: Memory peak usage: 8.5MB
 [13:02:19.72][f83e34b6] INFO[TIME]: Time delta: 20.147548913956
 [13:02:19.72][f83e34b6] DB : disconnect from visco_extra@localhost
 
 [13:02:26.94][75627405] [GET][ip:1*7.**.**.**] /webmail55/adminpanel/index.php?pop&type=dllog
 [13:02:26.94][75627405] POST > []
 [13:02:26.94][75627405]
 [13:02:26.94][75627405] call CCommonModule->StandardPopAction->System()
 [13:02:26.94][75627405] call CWebMailModule->StandardPopAction->System()
 /////////////////////////////////////////////////////
 
 |  
        | Back to Top |     |  
        |  |  
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Thanks. The following extract of the logs:
           | Posted: 17 October 2014 at 6:33am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | [13:01:59.70][f83e34b6] IMAP[NOTE]: Start connection to "ssl://imap.gmail.com:993" [13:02:19.72][f83e34b6] PHP[NOTICE]: /home3/webmail55/libraries/MailSo/Net/NetClient.php [line:221, code:2]
 |  |  |  
 states that WebMail wasn't able to establish network connection to that server during 20 seconds, so the connection was aborted due to timeout. That's networking issue unrelated to our product, maybe the particular port is blocked on server. If you run the product on shared hosting of some kind, you might want to check this with your host, maybe they're blocking particular ports for some reason.
 
 --
 Regards,
 Igor, AfterLogic Support
 |  
        | Back to Top |     |  
        |  |  
        | rino88au Newbie
 
  
 
 Joined: 16 October 2014
 Online Status: Offline
 Posts: 24
 | 
          I have just contact my hosting company and I have been told that the following:
           | Posted: 17 October 2014 at 7:04am | IP Logged |   |  
           | 
 |  
 it is not blocked on the server, ports 26, 110, 143, 465, 587, 993, and 995 are all open mail ports.
 
 What else it could be ?
 |  
        | Back to Top |     |  
        |  |  
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          No idea really, but we can suggest running a sample script designed specifically to test connection with GMail IMAP or other SSL-enabled mail servers. Unpack the script to your web directory, run it from the browser and check the output you get.
           | Posted: 17 October 2014 at 7:21am | IP Logged |   |  
           | 
 |  
 Note the script holds $timeout value set to 40 seconds, which is twice more than standard timeout value used in WebMail Pro; there is a chance that tweaking that value might help.
 
 --
 Regards,
 Igor, AfterLogic Support
 |  
        | Back to Top |     |  
        |  |  
        | rino88au Newbie
 
  
 
 Joined: 16 October 2014
 Online Status: Offline
 Posts: 24
 | 
          Thanks for the script.
           | Posted: 17 October 2014 at 7:51am | IP Logged |   |  
           | 
 |  
 Still the same issue "time out"
 
 Can you please verify if gmail works on your end via webmail lite?
 
 If it works, please verify gmail "forwarding and POP/IMAP" settings.
 
 
 Thanks
 |  
        | Back to Top |     |  
        |  |  
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          It definitely works for us, I personally use GMail with our WebMail a lot. Actually, the script holds the basic PHP functionality for establish network connection, so the problem is definitely on web server end, it's unrelated to GMail or WebMail Pro.
           | Posted: 17 October 2014 at 7:56am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 |  
        | Back to Top |     |  
        |  |  
        | rino88au Newbie
 
  
 
 Joined: 16 October 2014
 Online Status: Offline
 Posts: 24
 | 
          Ok, I have just moved to different server and I can confirm that your script works good with gmail!
           | Posted: 17 October 2014 at 8:07am | IP Logged |   |  
           | 
 |  
 Thanks
 |  
        | Back to Top |     |  
        |  |  |  |