我需要使用nginx作为邮件代理。我对nginx完全陌生,需要一些配置帮助。无法将nginx配置为邮件代理
这里是我做过什么:
首先我建立了一个嘲笑这里所描述的身份验证服务的服务:http://wiki.nginx.org/NginxMailCoreModule。例如,
curl -v -H "Host:auth.server.hostname" -H "Auth-Method:plain" -H "Auth-User:user" -H "Auth-pass:123" -H "Auth-Protocol:imap" -H "Auth-Login-Attempt:1" -H "Client-IP: 192.168.1.1" http://localhost:8080/authorize
返回以下响应头:
< HTTP/1.1 200 OK
< Content-Type: text/html;charset=ISO-8859-1
< Auth-Status: OK
< Auth-Server: 192.168.1.10
< Auth-Port: 110
二我在我的Mac安装nginx的安装使用MacPorts后:
$ sudo port -d selfupdate
$ sudo port install nginx
三我创建了一个nginx的.conf与以下内容:
worker_processes 1;
error_log /var/log/nginx/error.log info;
mail {
server_name <my mail server here>;
auth_http http://localhost:8080/authorize;
pop3_auth plain apop cram-md5;
pop3_capabilities "LAST" "TOP" "USER" "PIPELINING" "UIDL";
xclient off;
server {
listen 110;
protocol pop3;
proxy on;
proxy_pass_error_message on;
}
}
这是我跑了nginx的:
$ nginx的-V nginx的版本:nginx的/ 1.2.4 配置参数:--prefix = /选择/本地--with-CC- opt =' - I/opt/local/include -O2'--with-ld-opt = -L/opt/local/lib --conf-path =/opt/local/etc/nginx/nginx.conf - error-log-path =/opt/local/var/log/nginx/error.log --http-log-path =/opt/local/var/log/nginx/access.log --pid-path =/opt /local/var/run/nginx/nginx.pid --lock-path =/opt/local/var/run/nginx/nginx.lock --http-client-body-temp-path =/opt/local/var/run/nginx/client_body_temp --http-proxy-temp-path =/opt/local/var/run/nginx/proxy_temp --http -fastcgi-temp-path =/opt/local/var/run/nginx/fastcgi_临时--http-uwsgi-TEMP-PATH = /选择/本地的/ var /运行/ nginx的/ uwsgi_temp --with的IPv6
$ nginx的 nginx的:在/ opt [EMERG]未知的指令 “邮件”/本地/etc/nginx/nginx.conf:6
在网络上是错误的,只有提起带来了在俄罗斯的讨论......
我的问题:
为什么我收到这个unknow指令?
我的配置一看就是正确的,还是我错过了一些使用此处所述的身份验证方法工作的邮件代理的关键组件:http://wiki.nginx.org/NginxMailCoreModule?
当我的SMTP服务器只发送电子邮件时,需要让nginx参与吗? –