Announcement

Collapse
No announcement yet.

Recieve Email - IMAP bug without SSL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Recieve Email - IMAP bug without SSL

    Hi Team,

    Firstly, congrats on the great product. I was so impressed that I ended up buying the Advanced Pack and am a happy customer

    I did run into an issue yesterday. I was setting up an inbound email with the following settings:
    Host: mail.ourhealthmate.com
    SSL: No
    Port:143
    along with my username and password

    Note that we do not have SSL configured on our server, so I have to keep it disabled and connect on port 143.

    When I try to select a folder, it says "Cannot connect to IMAP server". Checking the logs, it gives the following error:

    ---------------------------
    (
    [controller] => InboundEmail
    [action] => getFolders
    )
    , InputData: - cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.ourhealthmate.com:143 (Unknown error) (errno = 0 ) [] []
    [2015-05-04 10:30:24] Espo.ERROR: Display Error: cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.ourhealthmate.com:143 (Unknown error) (errno = 0 ), Code: 0 URL: /espocrm/api/v1/InboundEmail/action/getFolders?host=mail.ourhealthmate.com&port=143&ss l=false&username
    ---------------------------

    It seems that even though I have de-selected SSL, it still tries to connect using the ssl protocol (ssl://mail.ourhealthmate.com:143). To double check whether this was truly causing the error, I ran this php code:

    ---------------------------
    $smtp_host = 'mail.ourhealthmate.com';
    $smtp_port = 143;
    if (!($socket = fsockopen($smtp_host, $smtp_port, $errno, $errstr, 15))) {
    echo "Could not connect to smtp host '$smtp_host' ($errno) ($errstr)", __FILE__, __LINE__;
    }
    else {
    echo "Connection successful";
    }
    ---------------------------

    I got the result as "Connection successful". I tried finding out which part of the code was causing this issue and got a little lost when I started going through Zend's mail framework.

    Can you please help?

  • #2
    Hi

    Seems it's a bug.

    application/Espo/Controllers/EmailAccount.php there should be
    'ssl' => $request->get('ssl') === 'true'

    Thanks

    Comment


    • #3
      Thanks for the input. I made that change. Also had to make the same change in application/Espo/Modules/Crm/Controllers/InboundEmail.php.

      After making the change however, I am getting the following error in the log.

      ---------------------------
      (
      [controller] => InboundEmail
      [action] => getFolders
      )
      , InputData: - cannot login, user or password wrong [] []
      [2015-05-06 01:11:28] Espo.ERROR: Display Error: cannot login, user or password wrong, Code: 0 URL: /espocrm/api/v1/InboundEmail/action/getFolders?host=mail.ourhealthmate.com&port=143&ss l=false&username=<myusername>&password=<mypassword > [] []
      ---------------------------

      I have double checked my username and password and both are correct. Any ideas what the problem could be? Would it help if I create a test email account for you to test on this server?

      Comment


      • #4
        I don't know what it could be. Could ssl=false be not a proper uri parameter?

        If you sort out this issue please let me know what was the reason.

        Anyway you can specify folders as a text field using a comma to separate folders.

        Comment


        • #5
          Unfortunately I also gets this error with version 3.3.0 - which is really strange, I cannot fetch my gmail with imap( the fsockopen error), and I cannot use my internal mailserver either( Test connection gives an OK but it never gets any mail)

          Comment


          • #6
            Hi all,

            I'm new here and I want to say sorry to revieve an older thread but its completely relevent to my issue.
            Im having this issue now on version 3.9.2 (unix install) and I can't find application/Espo/Modules/Crm/Controllers/InboundEmail.php. in my zip file i downloaded?

            It not passing any errors at all to the log either. Is there any fix for missing inbound mail?

            Cheers,
            Dan

            Comment


            • #7
              Hi Dan

              Unfortunately there is no fix yet.

              application/Espo/Modules/Crm/Controllers/InboundEmail.php is moved to application/Espo/Controllers/InboundEmail.php

              Did you specify a proper port?

              You you would like to debug you can do it here: vendor/zendframework/zend-mail/src/Storage/Imap.php

              Comment

              Working...
              X