EspoCRM upgrade PHP 7.2 campaign/mass mailing issue warning: TLS library problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robson
    Junior Member
    • May 2019
    • 19

    EspoCRM upgrade PHP 7.2 campaign/mass mailing issue warning: TLS library problem

    Hello,

    I have upgraded EspoCRM to version 5.5.6 o 5.6.2 and had to upgrade PHP from 7.0 to 7.1… and my campaigns stopped working.

    I have:
    Ubuntu 16 LTS running EspoCRM with MySQL
    Mailserver based on deckerized Mailcow (including Dovecot)
    PHP 7.2-fpm

    Symptoms:
    Espo send well individual emails (including test email within Campaign/Mass mailing)
    Espo reports Fail when automatically running Mass mailing within campaign. No single email is being sent from the Target list. BUT WHEN I SEND TEST EMAIL within this very Campaign/Mass mailing, IT WORKS
    Test emails from the Group Emails setting work fine, mail is delivered

    The following method successfully sends emails from terminal:
    echo "This is the body of the email" | mail -s "This is the subject line" foo@bar.com

    My view:
    You are using different PHP methods for sendng individual emails (like test email) and different for mass mailing. The method for mass mailing requires too much authentication or CA cert usage as it generates the following error on Mailcow log (the same as /var/log/mail.log)

    5/23/2019, 9:50:03 PM info disconnect from dev.aaa.com[94.17.10.14] ehlo=1 starttls=0/1 commands=1/2
    5/23/2019, 9:50:03 PM info lost connection after STARTTLS from dev.aaa.com[94.17.10.14]
    5/23/2019, 9:50:03 PM warning warning: TLS library problem: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca:../ssl/record/rec_layer_s3.c:1399:SSL alert number 48:
    5/23/2019, 9:50:03 PM info SSL_accept error from dev.aaa.com[94.17.10.14]: -1
    5/23/2019, 9:50:03 PM info connect from dev.aaa.com[94.17.10.14]

    ../data/logs/espo-2019-05-24.log shows:
    [2019-05-24 09:39:04] Espo.ERROR: CronManager: Failed job running, job [5ce7bb79b658c59d1]. Error Details: Job CheckEmailAccounts 5b505a31662e79556: [0] cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail. aaa.com:993 (Unknown error) (errno = 0 ) [] []

    To make sure that my mailserver is fine and that Espo is having trouble I have also tried to use some third party hosted mailserver for Campaign. And it is even worse with TLS. It is impossible to establish any encrypted connection. Unencypted work fine both ways.

    So my view is that you need to handle the fsockopen(): error and the CA cert issues somehow.
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hello.

    EspoCRM works fine. For campaign mass emails EspoCRM use SMTP configs in Administration -> Outbound Emails. Check your outbound configs.

    Comment

    • robson
      Junior Member
      • May 2019
      • 19

      #3
      Helo Maximus,
      All my troubles started when I migrated to v5.6.2 and had to upgrade PHP from 7.0 to 7.3... Emails stopped working. I mean first mass emails stopped working, now I have no connectivity with the following messages when clicing TEST CONNECTION in Group Email Accounts:
      For no SSL: Error 500: cannot login, user or password wrong
      For SSL:Error 500: cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.xxx.xx:993 (Unknown error) (errno = 0 )

      First message is stupid as Send Test Email at 25 works and I can login to the email account via roundcube.

      When trying to Send Test email:
      For 25: Test email has been sent (email has actually arrived)
      For SSL/465: Error 500: Could not open socket: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:, error:1416F086:SSL routines:tls_process_server_certificate:certificat e verify failed
      For TLS/587: Error 500: Unable to connect via TLS

      I am sending using hosted email account that normally works.

      I spent last 3 weeks trying to fix it and feel like shit. I have reinstalled the whole Ubuntu 16.4 from scratch (fresh VPS, fresh Ubuntu, fresh Espoo, fresh DB, ALLL FRESH and EMPTY). Downloaded you latest package and made FRESH install, tried with PHP 7.1, 7.2 and 7.3. Tried with 3 different email servers.

      OPENSSL on mailserver works fine, telnet on mailserver works fine but Espoo says: Error 500: cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.xxx.xx:993 (Unknown error) (errno = 0 )
      [2019-06-17 10:15:53] Espo.ERROR: (0) cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.xxx.xx:993 (Unknown error) (errno = 0 ); POST /api/v1/InboundEmail/action/testConnection [] []

      I'm seriously thinking to give up...




      Comment

      • robson
        Junior Member
        • May 2019
        • 19

        #4
        I have tried Tnaya's suggestion, no effect: https://forum.espocrm.com/forum/bug-...-3-0-and-5-2-1

        Comment

        • robson
          Junior Member
          • May 2019
          • 19

          #5
          Some more details:
          1. I'm not using gmail, just normal imap servers with no restrictions.
          2. All is installed:
          3. can login with webapi to all email accounts but espo shows errors. I'm pretty advanced in Ubuntu, but this stuff made me feel like an amateur. Asked other admins but they could not find errors
          4. Firewall is down

          I think guys here had similar issue but they work on windows and I usu ubuntu server: https://stackoverflow.com/questions/1705856/socket-transport-ssl-in-php-not-enabled
          Here is similar issue with codeigniter and PHP moving from 5.6 to 7.0:
          https://forum.codeigniter.com/thread-64452.html

          MY SERVER WHERE ESPO IS INSTALLED CAN PROPERLY CONNECT WITH RELAY MAIL SERVER USING POSTFIX AND SEND MAILS. SPF, DKIM AND DMARC ARE FINE...
          Last edited by robson; 06-19-2019, 12:02 AM.

          Comment

          • Maximus
            Senior Member
            • Nov 2018
            • 2731

            #6
            Hello. Have you used the recommended configs of your email server? What email server do you use?

            Comment

            • robson
              Junior Member
              • May 2019
              • 19

              #7
              I have tried using both hosted email server like imap.gmail.com.
              For gmaila (imap on on gmail side) I get:
              Send Test email:
              Error 500: Unable to connect via TLS
              Error 500: Could not open socket: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:, error:1416F086:SSL routines:tls_process_server_certificate:certificat e verify failed
              Error 500: 5.7.0 Must issue a STARTTLS command first. k82sm11655307wma.15 - gsmtp

              Test connection:
              Error 500: cannot connect to host ; error = fsockopen(): unable to connect to ssl://imap.gmail.com:993 (Unknown error) (errno = 0 )


              Last edited by robson; 06-19-2019, 12:02 AM.

              Comment

              • Maximus
                Senior Member
                • Nov 2018
                • 2731

                #8
                Originally posted by robson
                I have tried using both hosted email server like imap.gmail.com.
                Gmail works perfectly. The imap.gmail.com is the gmail host for the IMAP connection. To sent emails, you need to set up smtp.gmail.com that is the host for the SMTP connection.

                Host: smtp.gmail.com
                Port 465 (SSL required)
                Port 587 (TLS required)
                https://support.google.com/a/answer/176600?hl=en.

                Comment

                • Maximus
                  Senior Member
                  • Nov 2018
                  • 2731

                  #9
                  I saw that you are using Mailserver based on dockerized Mailcow (including Dovecot). Please, take a look into the email server configs. Is that ports that you are trying to use are open?

                  Comment

                  • robson
                    Junior Member
                    • May 2019
                    • 19

                    #10
                    Please see private message. Do you know any good admin that could fix this issue? I can pay. I just need someone to fix it or reinstall the Ubuntu on my VPS with Espo.

                    Comment

                    • robson
                      Junior Member
                      • May 2019
                      • 19

                      #11
                      I have made some progress. Not exactly how but email started working. I made 2 adjustments:
                      installed: sudo apt install sasl2-bin
                      edited /etc/php/7.1/apache2/php.ini and added:
                      openssl.cafile=/etc/ssl/certs/cacert.pem
                      openssl.capath=/etc/ssl/certs/

                      so now both gmail and my dockerized mailcow send test emails...

                      However when running email campaigns I am still encountering FAILS. Here is log... please see that both imap.gmail and my mail servers report the same issue.What these WARNINGs mean? How to fix it?

                      here is log: https://pastebin.com/embed_iframe/0sduJRVw

                      Last edited by robson; 06-19-2019, 12:12 AM.

                      Comment

                      Working...