试图让邮件反向代理的基本电子邮件在 nginx 上工作。我正在使用官方的 nginx docker 映像,并且我有以下 nginx 配置设置。
error_log /var/log/nginx/error.log info;
mail {
server_name mail.example.com;
auth_http localhost:9000/cgi-bin/nginxauth.cgi;
imap_capabilities IMAP4rev1 UIDPLUS IDLE LITERAL+ QUOTA;
pop3_auth plain apop cram-md5;
pop3_capabilities LAST TOP USER PIPELINING UIDL;
smtp_auth login plain cram-md5;
smtp_capabilities "SIZE 10485760" ENHANCEDSTATUSCODES 8BITMIME DSN;
xclient off;
server {
listen 25;
protocol smtp;
}
server {
listen 110;
protocol pop3;
proxy_pass_error_message on;
}
server {
listen 143;
protocol imap;
}
server {
listen 587;
protocol smtp;
}
}
使用以下命令启动 nginx 后
nginx -g 'daemon off;'
我收到此错误:
2017/11/14 22:54:00 [emerg] 1#1: "mail" directive is not allowed here in /etc/nginx/conf.d/default.conf:9
任何建议如何解决这个问题?