Results 1 to 9 of 9

Thread: IMAP Email issues with Version 6

  1. #1
    dyntech is offline Junior Member
    Join Date
    Jan 2010
    Location
    Florida
    Posts
    3

    Default IMAP Email issues with Version 6

    I have a new install of version 6 using the stack installer for Windows. I am unable to view email in the Email tab even though the acount is setup and I can select folders to use. The email server is MS Exchange 2003 on the local network. I have read all the tips/fixes for using Exchange with Sugar and applied them all.

    I know there is email in the inbox I am trying to use because I can se it with Outlook Web Access.

    I am getting an error in the error log that says:

    "PHP Warning: Division by zero in C:\\Program Files\\sugarcrm\\htdocs\\sugarcrm\\modules\\Emails \\EmailUIAjax.php on line 828, referer: /sugarcrm/index.php?module=Emails&action=index"


    Any help would be appreciated.

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: IMAP Email issues with Version 6

    Anyhow your "emails per page" setting got 0.
    Try to change it to a value > 0 in the email settings page (10 or 20)
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  3. #3
    dyntech is offline Junior Member
    Join Date
    Jan 2010
    Location
    Florida
    Posts
    3

    Default Re: IMAP Email issues with Version 6

    I've changed this already and it made no difference.

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: IMAP Email issues with Version 6

    Incroyable...

    to find more details I would set a recorder trace in index.php (before $app->execute():

    $GLOBALS['log']->fatal("RECORDER:".print_r($_REQUEST,true));

    and look on the parameters which are set for the maillist.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  5. #5
    dyntech is offline Junior Member
    Join Date
    Jan 2010
    Location
    Florida
    Posts
    3

    Default Re: IMAP Email issues with Version 6

    Sorry Kuske,
    I don't know what you mean I am not a PHP guru. I have been playing with this some more and now I get an error when I test the settings that says this:

    Warning: imap_open() [function.imap-open]: Couldn't open stream {192.168.10.10:143/service=imap/notls/novalidate-cert/secure}INBOX occured in C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\InboundEmail.php on line 2395 [2010-08-13 22:03:22] display_stack_trace caller, file: C:\Program Files\sugarcrm\htdocs\sugarcrm\include\utils.php line#: 2776
    [L:](:StackTraceErrorHandler)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\InboundEmail.php[L:2395](:imap_open)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\InboundEmail.php[L:4548](InboundEmail:findOptimumSettings)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\Popup.php[L:113](InboundEmail:connectMailserver)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\View\Su garView.php[L:501](:require_once)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\View\vi ews\view.classic.php[L:52](SugarView:includeClassicFile)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\View\Su garView.php[L:121](ViewClassic:display)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\Control ler\SugarController.php[L:291](SugarViewrocess)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\Control ler\SugarController.php[L:272](SugarControllerrocessView)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\SugarAp plication.php[L:84](SugarController:execute)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\index.php[L:44](SugarApplication:execute)
    Warning: imap_close(): 157 is not a valid imap resource occured in C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\InboundEmail.php on line 4634 [2010-08-13 22:03:22] display_stack_trace caller, file: C:\Program Files\sugarcrm\htdocs\sugarcrm\include\utils.php line#: 2776
    [L:](:StackTraceErrorHandler)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\InboundEmail.php[L:4634](:imap_close)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\modules\InboundEmai l\Popup.php[L:113](InboundEmail:connectMailserver)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\View\Su garView.php[L:501](:require_once)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\View\vi ews\view.classic.php[L:52](SugarView:includeClassicFile)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\View\Su garView.php[L:121](ViewClassic:display)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\Control ler\SugarController.php[L:291](SugarViewrocess)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\Control ler\SugarController.php[L:272](SugarControllerrocessView)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\include\MVC\SugarAp plication.php[L:84](SugarController:execute)
    C:\Program Files\sugarcrm\htdocs\sugarcrm\index.php[L:44](SugarApplication:execute)



    Connection completed successfully.


    Thanks for any help.

  6. #6
    markmcs is offline Junior Member
    Join Date
    Nov 2009
    Posts
    4

    Default Re: IMAP Email issues with Version 6

    Hey,

    I've got exactly the same issue occuring too.. are there any ideas of what we can try?

    thanks,
    Mark

  7. #7
    bunset is offline Junior Member
    Join Date
    Nov 2010
    Posts
    1

    Default Re: IMAP Email issues with Version 6

    I have same issue with version 6 in linux
    when I add email account for read email with imap accessing I have that error testing email

    What can I do ? Hosting technicals are derivating this issue to sugarcrm forums because is an sugar 6 issue

    Thanks.
    bunset.

  8. #8
    crosscutrat is offline Junior Member
    Join Date
    Dec 2010
    Posts
    2

    Default Re: IMAP Email issues with Version 6

    I have this issue as well since the upgrade to 6. It appears that the options in the imap connection are not compatible with my server based on Zimbra. To isolate which options are causing a problem, I used the following php code:

    <?php
    $mailserver="mail.example.com";
    $port="993";
    $user="user@example.com";
    $pass="password";

    //$options="/imap/ssl/novalidate-cert";
    $options="/service=imap/ssl/novalidate-cert";
    //$options="/service=imap/notls/novalidate-cert/secure";
    //$options="/service=imap/ssl/tls/validate-cert/secure";
    $mbox = imap_open("{" . $mailserver . ":" . $port . $options . "}", $user, $pass);

    echo "<h1>Mailboxes</h1>\n";
    $folders = imap_listmailbox($mbox, "{" . $mailserver . ":" . $port . "}", "*");

    if ($folders == false) {
    echo "Call failed<br />\n";
    } else {
    foreach ($folders as $val) {
    echo $val . "<br />\n";
    }
    }

    echo "<h1>Headers in INBOX</h1>\n";
    $headers = imap_headers($mbox);

    if ($headers == false) {
    echo "Call failed<br />\n";
    } else {
    foreach ($headers as $val) {
    echo $val . "<br />\n";
    }
    }

    imap_close($mbox);
    ?>

    SugarCRM output after "Test Settings":
    Warning: imap_open() [function.imap-open]: Couldn't open stream {mail.example.com:143/service=imap/notls/novalidate-cert/secure}INBOX occured in /var/www/html/sugarcrm/modules/InboundEmail/InboundEmail.php on line 2395

    Based on the defaults in sugar (service=imap/notls/novalidate-cert/secure) I uncommented these options in the above script and get errors.

    However, when using the options with /service=imap/ssl/novalidate-cert, it lists my IMAP folders just fine.

    After researching how to change my options for connecting to an IMAP server, I was surprised to not find anywhere to configure this, not even checkboxes to set these options. The only place this is listed anywhere in the sugar code is:

    modules/InboundEmail/EditView.php

    if(!empty($focus->service)) {
    // will always have 2 values: /tls || /notls and /validate-cert || /novalidate-cert
    $exServ = explode('::', $focus->service);
    if($exServ[0] == 'tls') {
    $tls = "CHECKED";
    } elseif($exServ[5] == 'notls') {
    $notls = "CHECKED";
    }
    if($exServ[1] == 'validate-cert') {
    $cert = "CHECKED";
    } elseif($exServ[4] == 'novalidate-cert') {
    $novalidate_cert = 'CHECKED';
    }
    if(isset($exServ[2]) && !empty($exServ[2]) && $exServ[2] == 'ssl') {
    $ssl = "CHECKED";
    }
    }

    Although it appears to have a Port setting and "Use SSL" checkbox when visiting the page, It doesn't appear to correspond to the options in the code. So looking further, the only other place these options are outlined is in:

    modules/InboundEmail/InboundEmail.php


    $nonSsl = array('both-secure' => '/notls/novalidate-cert/secure',
    'both' => '/notls/novalidate-cert',
    'nocert-secure' => '/novalidate-cert/secure',
    'nocert' => '/novalidate-cert',
    'notls-secure' => '/notls/secure',
    'secure' => '/secure', // for POP3 servers that force CRAM-MD5
    'notls' => '/notls',
    'none' => '', // try default nothing
    );
    $ssl = array(
    'ssl-both-on-secure' => '/ssl/novalidate-cert',
    'ssl-both-on' => '/ssl/tls/validate-cert',
    'ssl-cert-secure' => '/ssl/validate-cert/secure',
    'ssl-cert' => '/ssl/validate-cert',
    'ssl-tls-secure' => '/ssl/tls/secure',
    'ssl-tls' => '/ssl/tls',
    'ssl-both-off-secure' => '/ssl/notls/novalidate-cert/secure',
    'ssl-both-off' => '/ssl/notls/novalidate-cert',
    'ssl-nocert-secure' => '/ssl/novalidate-cert/secure',
    'ssl-nocert' => '/ssl/novalidate-cert',
    'ssl-notls-secure' => '/ssl/notls/secure',
    'ssl-notls' => '/ssl/notls',
    'ssl-secure' => '/ssl/secure',
    'ssl-none' => '/ssl',
    );

    I haven't looked further yet to see how these arrays are used but I would assume they may be intended to be used within the database after being set from the Edit email page. I simply don't see where these options are supposed to be set but it appears that these IMAP options are what's killing the connection.

    After setting up a new account using port 143 with the SSL checkbox unchecked, the database shows these options:

    mysql> select port,service from inbound_email\G;
    *************************** 1. row ***************************
    port: 143
    service: ::::::imap::novalidate-cert::notls::
    1 row in set (0.00 sec)

    However, when testing these settings, the debug output shows:

    Warning: imap_open() [function.imap-open]: Couldn't open stream {mail.example.com:143/service=imap/notls/novalidate-cert/secure}INBOX occured in /var/www/html/sugarcrm/modules/InboundEmail/InboundEmail.php

    Going back to the above php script, everything works fine if I don't include "secure" as seen above. Why is this getting appended to the open stream syntax when SSL is not checked?

    $options="/service=imap/notls/novalidate-cert"; <- This works
    $options="/service=imap/notls/novalidate-cert/secure"; <- This does not and is what Sugar is doing

    Also note that when selecting SSL which auto uses port 993, this is what is saved in the db:
    mysql> select port,service from inbound_email\G;
    *************************** 1. row ***************************
    port: 993
    service: ::::ssl::imap::novalidate-cert::::
    1 row in set (0.00 sec)

    This generates the following error when testing settings from Sugar:

    Warning: imap_close(): 167 is not a valid imap resource occured in /var/www/html/sugarcrm/modules/InboundEmail/InboundEmail.php on line 4697 [2010-12-30 19:57:00] display_stack_trace caller, file: /var/www/html/sugarcrm/include/utils.php line#: 2813
    [L:](:StackTraceErrorHandler)

    FYI for other people searching the forums, this was also noticed on the php cron.php output as generating a segmentation fault.

    Thoughts anyone?

  9. #9
    crosscutrat is offline Junior Member
    Join Date
    Dec 2010
    Posts
    2

    Default Re: IMAP Email issues with Version 6

    While troubleshooting further, it is VERY useful if any line with imap_open has a die statement:

    $this->conn = imap_open($connectString, $this->email_user, $this->email_password, CL_EXPUNGE);

    $this->conn = imap_open($connectString, $this->email_user, $this->email_password, CL_EXPUNGE) OR die ("Can't connect: " . imap_last_error());

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sugarcrm 5.5.1RC3 - IMAP issues
    By bkholy in forum Help
    Replies: 1
    Last Post: 2010-05-05, 08:33 AM
  2. IMAP issues with Sugar and Outlook
    By jcdenton in forum Help
    Replies: 1
    Last Post: 2008-03-30, 04:04 PM
  3. Version 5.0 GA Issues
    By aaaccc131313 in forum Help
    Replies: 0
    Last Post: 2007-12-24, 08:22 PM
  4. IMAP issues
    By Flightbase in forum Help
    Replies: 0
    Last Post: 2007-05-03, 10:03 AM
  5. IMAP issues
    By ggolin in forum Help
    Replies: 1
    Last Post: 2006-04-07, 09:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •