Announcement

Collapse
No announcement yet.

I cannot send emails via Amazon

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

  • I cannot send emails via Amazon


    I have successfully used Amazon to send emails until today. Today I could not send a single letter and the point is in the CRM itself. I have not changed anything in the settings and have not updated the CRM. I will attach a correspondence with the hosting technical support to clarify the essence of the problem.


    I cannot send emails via Amazon. Yesterday everything worked, today it gives an error. Checked my Amazon account, so everything is fine. Here is the error from the log file.
    [2021-05-28 08:21:15] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaaex.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com' {"code":2,"message":"stream_socket_enable_crypt o() : Peer certificate CN=`server.aaaarex.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'","file":"/home/aaaaex/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} [] [2021-05-28 08:21:15] ERROR: Email sending error. Unable to connect via TLS [] [] [2021-05-28 08:21:15] ERROR: Email sending:Email sending error.; 500 [] []



    Amazon isn't the problem. I tried sending via a different SMTP and got a similar error. Last time you opened a port to fix this error.
    [2021-05-28 08:36:29] ERROR: Email sending error. Could not open socket: stream_socket_client(): unable to connect to ssl://email-smtp.us-west-2.amazonaws.com:465 (Connection refused) [] [] [2021-05-28 08:36:29] ERROR: Email sending:Email sending error.; 500 [] []




    I have tested the connectivity with Amazon using the command line on your server. its properly working : https://pastebin.com/nF4h0ZMw
    So the port is open and the connection is happening. There must be something else preventing the application from connecting , or the log record is wrong.



    These are the settings in EspoCrm

    I tried changing ports but it didn't help.



    The code doesn't help much, but:
    [2021-05-28 09:20:39] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaex.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com' {"code":2,"message":"st re am_socket_enable_crypto(): Peer certificate CN=`server.aaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'","file":"/home/azaaaax/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} []
    [2021-05-28 09:20:39] ERROR: Email sending error. Unable to connect via TLS [] []
    [2021-05-28 09:20:39] ERROR: Email sending:Email sending error.; 500 [] []



    The error message "Peer certificate CN=`server.aaaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'" means that there is a confusion between the incoming and outgoing connections.
    Maybe the app doesn't expect that the SMTP and the IMAP settings can be different? This error looks really strange.
    Please check this with the app developers as network connectivity is definitely not the issue in this case.



    But yesterday everything worked, I sent emails in the evening. I have not changed anything in the settings or updated. The only thing I did yesterday was changing the encoding of the databases in MySql from utfmb4_unicode_ci to utf8_unicode_ci, and today again for some reason I see the encoding utfmb4_unicode_ci
    I changed the encoding, but it didn't help



    The application email settings look completely fine.
    The network connectivity with the amazon services has been checked and confirmed (on both ports 465 and 587)
    There must be something in the application code that prevents the email feature from working properly.
    Since the detected SSL certificate appears to be reported as an issue in the provided logs - I would recommend you to try setting us email communication using the standard non-ssl ports. 143 for IMAP and 25 for SMTP (disabling the starttls or SSL options accordingly).



    As I have already mentioned, try using the non SSL standard ports.



    I tried various settings but it didn't work.

    [2021-05-28 10:37:34] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaaaaex.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com' {"code":2,"message":"st re am_socket_enable_crypto(): Peer certificate CN=`server.aaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'","file":"/home/aaaaaaex/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} []
    [2021-05-28 10:37:34] ERROR: Email sending error. Unable to connect via TLS [] []
    [2021-05-28 10:37:34] WARNING: Email sending:Email sending error.; 500 [] []
    [2021-05-28 10:42:55] ERROR: (0) cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.aaaaaex.com:143 (Unknown error) (errno = 0 ); POST /EmailAccount/action/testConnection; line: 94, file: /home/aaaaaax/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Imap.php [] []
    [2021-05-28 10:43:34] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com' {"code":2,"message":"st re am_socket_enable_crypto(): Peer certificate CN=`server.aaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'","file":"/home/aaaaaaex/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} []
    [2021-05-28 10:43:34] ERROR: Email sending error. Unable to connect via TLS [] []
    [2021-05-28 10:43:34] WARNING: Email sending:Email sending error.; 500 [] []
    [2021-05-28 10:43:53] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com' {"code":2,"message":"st re am_socket_enable_crypto(): Peer certificate CN=`server.aaaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'","file":"/home/aaaaaax/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} []
    [2021-05-28 10:43:53] ERROR: Email sending error. Unable to connect via TLS [] []
    [2021-05-28 10:43:53] WARNING: Email sending:Email sending error.; 500 [] []
    [2021-05-28 10:44:40] ERROR: Email sending error. Could not open socket: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number [] []
    [2021-05-28 10:44:40] WARNING: Email sending:Email sending error.; 500 [] []
    [2021-05-28 10:45:54] ERROR: (0) cannot connect to host ; error = fsockopen(): unable to connect to ssl://mail.aaaaaaex.com:143 (Unknown error) (errno = 0 ); POST /EmailAccount/action/testConnection; line: 94, file: /home/aaaaaaex/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Imap.php [] []
    [2021-05-28 10:46:15] ERROR: Email sending error. Could not open socket: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number [] []
    [2021-05-28 10:46:15] WARNING: Email sending:Email sending error.; 500 [] []
    [2021-05-28 10:46:28] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaaax.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com' {"code":2,"message":"st re am_socket_enable_crypto(): Peer certificate CN=`server.aaaaaaaex.com' did not match expected CN=`email-smtp.eu-west-2.amazonaws.com'","file":"/home/aaaaaax/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} []
    [2021-05-28 10:46:28] ERROR: Email sending error. Unable to connect via TLS [] []
    [2021-05-28 10:46:28] WARNING: Email sending:Email sending error.; 500 [] []





    Unfortunately, code level troubleshooting is out of our scope of support.
    We are not familiar with the application software you are using, so we can only check and confirm if the network connectivity works for the specified email services or not.
    I do not know how exactly the app is supposed to be sending emails. I understand that the library in use is "laminas" and the component is "laminas-mail", but this doesn't really help me to understand why the application acting as described.
    Maybe switching the app to use another email plugin will help, I can't be really sure on that.
    Only the application developer can help you with this.


    Please, help
    Last edited by sobolevfff; 05-28-2021, 12:08 PM.

  • #2
    This is a question for the developers. Check, please.

    Comment


    • eymen-elkum
      eymen-elkum commented
      Editing a comment
      check if the disck space is full

  • #3
    Originally posted by sobolevfff View Post
    This is a question for the developers. Check, please.
    There is a lot of free space

    Comment


    • #4
      Can you test STMP on a public email? E.g. Hotmail, Live, Yahoo, Gmail or your own domain that isn't with Amazon? Just a recommendation to see if you can isolate where to look.

      Comment


      • #5
        Originally posted by espcrm View Post
        Can you test STMP on a public email? E.g. Hotmail, Live, Yahoo, Gmail or your own domain that isn't with Amazon? Just a recommendation to see if you can isolate where to look.
        I tried to send via Google, but it gives an error not the correct password, although I entered everything correctly.

        Then I tried to send again through Amazon, now it shows another error.


        [2021-07-03 08:08:04] ERROR: Email sending error. Could not open socket: stream_socket_client(): unable to connect to ssl://email-smtp.eu-west-2.amazonaws.com:465 (Connection refused) [] [] [2021-07-03 08:08:04] WARNING: Email sending:Email sending error.; 500 [] []
        Attached Files

        Comment


        • #6
          Hosting support response:

          "I can connect to remote server == CT-c2c3421d-f9e1-48c6-99ea-679474921a2f /# telnet email-smtp.eu-west-2.amazonaws.com 465 Trying 18.135.77.206... Connected to email-smtp.eu-west-2.amazonaws.com. Escape character is '^]'. == Please contact them for further assitance."

          Comment


          • #7
            Received a new error while trying to send an email

            [2021-08-01 18:27:04] ERROR: Email sending error. Could not open socket: stream_socket_client(): unable to connect to ssl://email-smtp.eu-west-2.amazonaws.com:465 (Connection refused) [] [] [2021-08-01 18:27:04] WARNING: Email sending:Email sending error.; 500 [] []

            Can anyone check if Amazon emails are working via espocrm?

            Comment


            • #8
              I changed to TLS protocol and started sending.

              Comment


              • espcrm
                espcrm commented
                Editing a comment
                Glad to see this post. I keep TLS/SSL in mind for the next people that have email issue.

            • #9
              Last week everything worked correctly again, but today emails stopped sending and I got this error. Until yesterday everything worked.
              Recently there were various errors and emails stopped sending.

              [2021-08-11 08:33:51] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`server.aaaaaax.com' did not match expected CN=`email-smtp.us-west-2.amazonaws.com' {"code":2,"message":"stream_socket_enable_crypt o() : Peer certificate CN=`server.azaaaaax.com' did not match expected CN=`email-smtp.us-west-2.amazonaws.com'","file":"/home/aaaaaaex/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Smtp.php","line":216} [] [2021-08-11 08:33:51] ERROR: Email sending error. Unable to connect via TLS [] [] [2021-08-11 08:33:52] ERROR: Email sending:Email sending error.; 500 [] [] I changed the encryption method to SSL and got a different error [2021-08-11 08:44:48] ERROR: Email sending error. Could not open socket: stream_socket_client(): unable to connect to ssl://email-smtp.us-west-2.amazonaws.com:465 (Connection refused) [] [] [2021-08-11 08:44:48] WARNING: Email sending:Email sending error.; 500 [] []


              Yesterday I was getting another error like this


              [2021-08-10 07:44:02] WARNING: E_WARNING: fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:1420C0CF:SSL routines:ssl_write_internalrotocol is shutdown {"code":2,"message":"fw ri te(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1420C0CF:SSL routines:ssl_write_internalrotocol is shutdown","file":"/home/aaaaax/public_html/crm/vendor/laminas/laminas-mail/src/Protocol/Imap.php","line":340} [] [2021-08-10 07:44:02] ERROR: CronManager: Failed job running, job [61122e0657e28d003]. Error Details: Job CheckInboundEmails 5eea7130e4660348c: [0] cannot read - connection closed? at /home/aaaaaex/public_html/crm/application/Espo/Modules/Crm/Jobs/CheckInboundEmails.php:74 [] []


              Server support Ticket replies


              We would suggest you to contact a developer for further assistance, Our server able to connect remote server anyway
              == CT-c2c3421d-f9e1-48c6-99ea-679474921a2f /# telnet email-smtp.us-west-2.amazonaws.com 465 Trying 44.240.246.170... Connected to email-smtp.us-west-2.amazonaws.com. Escape character is '^]'.

              CT-c2c3421d-f9e1-48c6-99ea-679474921a2f /# telnet email-smtp.us-west-2.amazonaws.com 587 Trying 44.240.246.170... Connected to email-smtp.us-west-2.amazonaws.com. Escape character is '^]'. 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-3L7NR4LRB yVb2aDmMVzIPQbdZSQvN ==


              Comment

              Working...
              X