Score:0

Trouble with a certificate when sending email through PHP

in flag

I have a server that is running a PHP app through docker. In it, I'm using the PHPMailer package to send an email through another server I have, which has postfix running. When I send the email, I get this error:

2022-03-27 00:29:03 SERVER -> CLIENT: 220 mydomain.com ESMTP Postfix (Ubuntu)
2022-03-27 00:29:03 CLIENT -> SERVER: EHLO d9757e7e26c2
2022-03-27 00:29:03 SERVER -> CLIENT: 250-mydomain.com
                                      250-PIPELINING
                                      250-SIZE 10240000
                                      250-VRFY
                                      250-ETRN
                                      250-STARTTLS
                                      250-ENHANCEDSTATUSCODES
                                      250-8BITMIME
                                      250 DSN
2022-03-27 00:29:03 CLIENT -> SERVER: STARTTLS
2022-03-27 00:29:03 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2022-03-27 00:29:03 SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
                                      error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
2022-03-27 00:29:03 CLIENT -> SERVER: QUIT
2022-03-27 00:29:03 SERVER -> CLIENT: M
                                           IAx+�P^�r���+����wkշCqW�����
                                      �{�!/�loj����c@�탇�2��6�]u��<'C1`3��8|��v�
                                      ��&�e8���=���W�k�[QM3��r��q�����]��9�٭�I0�Sh�����?�P���f��zS�ZrȽS�����x�
                                W�P�_��$HJ�2�9��(+��gA�3'��s�YkL.͟�,v�zc+}7�_4Q-                                   ��[�W9�Sl�FQ�sӾ�S�6<g/#�kF                   ���P8                  }�����n�|�+;7B�dhV;|!�4�z����J
2022-03-27 00:29:03 SMTP ERROR: QUIT command failed: M
                                                          IAx+�P^�r���+����wkշCqW�����
                                      �{�!/�loj����c@�탇�2��6�]u��<'C1`3��8|��v�
                                      ��&�e8���=���W�k�[QM3��r��q�����]��9�٭�I0�Sh�����?�P���f��zS�ZrȽS�����x�
                                W�P�_��$HJ�2�9��(+��gA�3'��s�YkL.͟�,v�zc+}7�_4Q-                                   ��[�W9�Sl�FQ�sӾ�S�6<g/#�kF                   ���P8                  }�����n�|�+;7B�dhV;|!�4�z����J
2022-03-27 00:29:03 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed.

It was suggested I install ca-certificates on the docker container, but that didn't help. I'm really not familiar with emailing, so I'm not sure what certificates are missing, or what I have to add.

tilleyc avatar
us flag
Does the SMTP server have a valid certificate? Check with something like this.. `openssl s_client -connect smtp-example.com:465 -servername smtp-example.com | openssl x509 -noout -subject -enddate`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.