我需要使用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參與嗎? –