I want to use nginx as a mail proxy.I am new to nginx and need some help
with the configuration, I got some problems.
I want to use Foxmail ,use ngx proxy , this is my configuration.
mail{
#server_name mailProxy;
auth_http localhost:80/php/auth.php;
pop3_capabilities LAST TOP USER PIPELINING UIDL;
pop3_auth plain apop cram-md5;
imap_capabilities IMAP4rev1 UIDPLUS;
smtp_capabilities “SIZE 10485760” ENHANCEDSTATUSCODES 8BITMIME DSN;
smtp_auth login plain cram-md5;
server{
listen 25;
protocol smtp;
}
server{
listen 110;
protocol pop3;
proxy on;
proxy_pass_error_message on;
}
server{
listen 143;
protocol imap;
proxy on;
}
}
and my auth script using PHP as follow:
But this does not run,when i use telnet test,as follow
telnet 192.168.42.132 25
Trying 192.168.42.132…
Connected to 192.168.42.132.
Escape character is ‘^]’.
220 wack ESMTP ready
auth login
334 VXNlcm5hbWU6
base64(username==)
334 UGFzc3dvcmQ6
base64(password)
451 4.3.2 Internal server error
Connection closed by foreign host.
what’s wrong ,and the error log as follow:
2015/03/21 12:35:39 [error] 55719#0: 151 upstream sent invalid
response:
“550 insufficient authorization” while reading response from upstream,
client: 192.168.42.132, server: 0.0.0.0:25, login: "@..cn",
upstream:*.***.***.***:25
The ‘*’ is my username and backend ip. 192.168.42.132 is my vitual
machine
ip.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,257510,257510#msg-257510