# ngx\_mail\_proxy\_module

* [指令](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_proxy_module.md#directives)
  * [proxy\_buffer](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_proxy_module.md#proxy_buffer)
  * [proxy\_pass\_error\_message](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_proxy_module.md#proxy_pass_error_message)
  * [proxy\_timeout](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_proxy_module.md#proxy_timeout)
  * [xclient](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_proxy_module.md#xclient)

## 指令 <a href="#directives" id="directives"></a>

### proxy\_buffer

| -       | 说明                        |
| ------- | ------------------------- |
| **语法**  | **proxy\_buffer** `size`; |
| **默认**  | proxy\_buffer 4k\|8k      |
| **上下文** | mail、server               |

设置用于代理的缓冲区的大小。默认情况下，缓冲区大小等于一个内存页。根据平台的不同，它可以是 4K 或 8K。

### proxy\_pass\_error\_message

| -       | 说明                                             |
| ------- | ---------------------------------------------- |
| **语法**  | **proxy\_pass\_error\_message** `on` \| `off`; |
| **默认**  | proxy\_pass\_error\_message off;               |
| **上下文** | mail、server                                    |

指示是否将后端身份验证期间获得的错误消息传递给客户端。

通常，如果 nginx 中的身份验证成功，则后端无法返回错误。如果仍然返回错误，则表示发生了一些内部错误。在这种情况下，后端消息可能包含不应显示给客户端的信息。但是，对于某些 POP3 服务器，响应一个密码错误信息是正常现象。例如，CommuniGatePro 通过定期输出[身份验证错误](http://www.stalker.com/CommuniGatePro/POP.html#Alerts)来通知用户[邮箱溢出](http://www.stalker.com/CommuniGatePro/Alerts.html#Quota)或其他事件。在这种情况下，应启用该指令。

### proxy\_timeout

| -       | 说明                            |
| ------- | ----------------------------- |
| **语法**  | **proxy\_timeout** `timeout`; |
| **默认**  | proxy\_timeout 24h;           |
| **上下文** | mail、server                   |

设置客户端或代理服务器连接上两次连续的读取或写入操作之间的超时（`timeout`）。如果在此时间内没有数据传输，则连接将关闭。

### xclient

| -       | 说明                         |
| ------- | -------------------------- |
| **语法**  | **xclient** `on` \| `off`; |
| **默认**  | xclient on;                |
| **上下文** | mail、server                |

连接到 SMTP 后端时，启用或禁用 [XCLIENT](http://www.postfix.org/XCLIENT_README.html) 命令与客户端参数的传递。

借助 `XCLIENT`，MTA 能够将客户端信息写入日志并基于此数据应用各种限制。

如果启用了 `XCLIENT`，则 nginx 在连接到后端时会传递以下命令：

* 附带[服务器名称](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_core_module.md#server_name)的 EHLO
* `XCLIENT`
* 由客户传递的 `EHLO` 或 `HELO`

如果客户端 IP 地址[找到](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_core_module.md#resolver)的名称指向相同的地址，则会在 `XCLIENT` 命令的 `NAME` 参数中传递该名称。如果找不到名称、指向其他地址或未指定[解析器](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_core_module.md#resolver)，则在 `NAME` 参数中传递 `[UNAVAILABLE]`。如果在解析过程中发生错误，则使用 `[TEMPUNAVAIL]` 值。

如果禁用了 `XCLIENT`，则如果客户端已通过 `EHLO`，则 nginx 在连接到后端时将使用[服务器名称](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_core_module.md#server_name)传递 EHLO 命令；否则，使用服务器名称传递 `HELO`。

## 原文档

* <http://nginx.org/en/docs/mail/ngx_mail_proxy_module.html>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docshome.gitbook.io/nginx-docs/he-xin-gong-neng/mail/ngx_mail_proxy_module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
