我尝试使用postfixadmin,Rspamd和Roundcube创建一个邮件服务器。我已经在Nginx和php 7.2中安装了所有必需的Postfix,Dovecot,但是在发送邮件时注册此错误:
2019/03/18 08:24:54 [error] 3140#3140: *5203 FastCGI sent in stderr: "PHP message: fsockopen failed - errno: 111 - errstr: Connection refused" while reading response header from upstream, client: ***.***.***.212, server: mail.miwebsite.com, request: "POST /sendmail.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "mail.miwebsite.com", referrer: "https://mail.miwebsite.com/sendmail.php
这在我的website.conf中:
server {
listen 443 ssl http2; # managed by Certbot
server_name mail.miwebsite.com;
root /var/www/postfixadmin;
ssl_certificate /etc/letsencrypt/live/miwebsite.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/miwebsite.com-0001/privkey.pem; # managed by Certbot
ssl_trusted_certificate /etc/letsencrypt/live/miwebsite.com-0001/chain.pem;
# include snippets/ssl.conf;
include snippets/letsencrypt.conf;
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
error_log /var/www/postfixadmin/logs/error.log;
location ~ \.php$ {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {return 404;}
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
#fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include snippets/fastcgi-php.conf;
}
location / {
try_files $uri $uri/ /index.php;
}
location /postfixadmin {
index index.php;
try_files $uri $uri/ /index.php;
}
location /rspamd {
proxy_pass http://127.0.0.1:11334/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /roundcubemail {
index index.php;
try_files $uri $uri/ /roundcubemail/index.php;
}
location ~ ^/roundcubemail/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
deny all;
}
location ~ ^/roundcubemail/(bin|SQL|config|temp|logs)/ {
deny all;
}
}