MailProxy

Nginx can proxy IMAP, POP3, and SMTP protocols. Ngin可以代理IMAP,POP3和SMTP协议

指令

proxy

syntax:*proxy*on | off

default:*off*

context:*mail, server*

With this directive you can enable or disable the proxy for mail. 使用这条指令你可以开启和关闭邮件代理

proxy_buffer

syntax:*proxybuffer**size_*

default:*4K/8K*

context:*mail, server*

With this directive you can set the buffer size for the proxy connection. The default value is equal to the size of a page (this can be either 4K or 8K depending on the platform). 使用这条指令你可以设置代理连接的缓存大小。默认值为页面的大小(这个根据平台的不同可能是4K或者8K)

proxy_pass_error_message

syntax:*proxypass_error_message**on | off_*

default:*off*

context:*mail, server*

With this directive you can pass authentification error messages obtained from the backend back to the client. Usually if authorization in nginx passed successfully then the backend cannot return errors back to the client. 通过这条指令你可以使得客户端忽略从后端获得的验证错误消息.通常验证成不会返回错误消息到客户端。

But for some POP3 servers errors in response to correct password is a regular behavior. For example CommuniGatePro notifies user about overcrowding of the mailbox (or other events) periodically issuing an error in authorization. In this case is worth indicating proxy_error_message on. 但是在POP3服务器中错误是用来更重密码。例如CommuniGatePro 通过验证返回邮箱收件箱已满的错误来通知用户,这样的代理错误信息是很有意义的。

proxy_timeout

syntax:*proxytimeout**time_*

default:*24h*

context:*mail, server*

With this directive you can set the timeout for the proxy connection. 使用这条指令你可以设置代理连接的超时时间。

xclient

syntax:*xclient*on | off

default:*on*

context:*mail, server*

With this directive you can enable or disable the command XCLIENT with the connection to SMTP backend. This allows the backend to enforce limitations on the client based on IP/HELO/LOGIN. 使用这条指令你可以开启或者关闭命令XCLIENT的SMTP后端连接.这个使得后端强制可以通过IP/HELO/LOGIN限定客户端

If xclient is enabled then nginx first transfers to the backend: 如果xclient被启用,nginx首先转换到后端

  1. EHLO server_name

Then:

  1. XCLIENT PROTO=ESMTP HELO=client_helo ADDR=client_ip LOGIN=authentificated_user NAME=[UNAVAILABLE]

原文: https://wizardforcel.gitbooks.io/nginx-doc/content/Text/5.3_mailproxy.html