简体   繁体   English

laravel 在使用 tls 和我自己的 postfix/virtualmin 服务器发送电子邮件时显示错误

[英]laravel shows error when sending email using tls and my own postfix/virtualmin server

We have installed our own postfix/virtualmin server and we have a laravel application,the problem is when we use external smtp servers, it is not problem to use tls option, and the emails are getting sent ok, but when using our new smtp server, when using tls we have this error :我们已经安装了我们自己的 postfix/virtualmin 服务器,我们有一个 Laravel 应用程序,问题是当我们使用外部 smtp 服务器时,使用 tls 选项没有问题,并且电子邮件可以正常发送,但是当使用我们新的 smtp 服务器时, 使用 tls 时出现此错误:

stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed 

It has to be something regarding missing certificates in our postfix/virtualmin server, but, i do not know where to start, we have already a letsencrypt certificates for it, but i believe we maybe need to convert them to ca or something like that ?它必须与我们的 postfix/virtualmin 服务器中缺少证书有关,但是,我不知道从哪里开始,我们已经为它准备了一个 Letencrypt 证书,但我相信我们可能需要将它们转换为 ca 或类似的东西? i'm not sure, that's why i need your help.我不确定,这就是为什么我需要你的帮助。

Thank you,谢谢,

Download the latest cacert.pem file from cURL website .cURL 网站下载最新的cacert.pem文件。

wget https://curl.haxx.se/ca/cacert.pem

Edit php.ini (you can do php --ini to find it), update (or create if they don't exist already) those two lines:编辑 php.ini (您可以执行php --ini来找到它),更新(如果它们不存在,则创建)这两行:

curl.cainfo="/path/to/downloaded/cacert.pem"
...
openssl.cafile="/path/to/downloaded/cacert.pem"

Those lines should already exist but commented out, so uncomment them and edit both values with the path to the downloaded cacert.pem这些行应该已经存在但已注释掉,因此取消注释它们并使用下载的cacert.pem的路径编辑这两个值

Restart PHP and Nginx/Apache.重启 PHP 和 Nginx/Apache。

I figured it out the problem.我想出了问题。

My virtualmin/postfix setup was missing the CA certificiation, and since i used letsencrypt for ssl, i had to put the path of generated CA in the config.我的 virtualmin/postfix 设置缺少 CA 认证,并且由于我将 letencrypt 用于 ssl,我不得不将生成的 CA 的路径放在配置中。

Here : Webmin --> Servers ---> PostFix Mail Server ----> Smtp authentication and encryption.此处:Webmin --> 服务器 ---> PostFix 邮件服务器 ----> Smtp 身份验证和加密。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 发送电子邮件“在对象上下文中使用$ this”时,带有伪造的服务器上的Laravel错误 - Laravel error on server with forge when sending email 'using $this in object context' 使用 smtp 服务器发送自定义 email 地址时出现 Laravel 错误 - Laravel error when sending custom email address using smtp server Laravel 5.1发送电子邮件显示错误 - Laravel 5.1 Sending email shows error 使用Postfix在Mountain Lion上发送电子邮件时的配置问题 - Configuration issue when sending email on Mountain Lion using Postfix 发送 TLS 电子邮件时 Laravel 证书验证错误 - Laravel certificate verification errors when sending TLS email 发送电子邮件时 Laravel 7 内部服务器错误 500 - Laravel 7 internal server error 500 when sending email 电子邮件服务器; 如何配置后缀以满足我的需求? (我需要SASL或/和TLS吗?) - Email Server; How to configure postfix to suit my needs? (Do I need SASL or/and TLS?) Laravel email 未发送但没有错误,使用自己的 smtp 服务器 - Laravel email not sended but no error, with own smtp server Laravel不在我的服务器上发送电子邮件,而是发送到localhost - Laravel not sending email on my server but sends on localhost 从PHP发送电子邮件时使用SSL / TLS - Using SSL/TLS when sending an email from PHP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM