# ngx\_mail\_smtp\_module

* [示例配置](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_smtp_module.md#example_configuration)
* [指令](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_smtp_module.md#directives)
  * [ngx\_mail\_smtp\_module](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_smtp_module.md#ngx_mail_smtp_module)
  * [smtp\_capabilities](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_smtp_module.md#smtp_capabilities)

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

### smtp\_auth

|       - | 说明                           |
| ------: | ---------------------------- |
|  **语法** | **smtp\_auth** `method ...`; |
|  **默认** | smtp\_auth login plain;      |
| **上下文** | mail、server                  |

为 SMTP 客户端设置 [SASL 认证](https://tools.ietf.org/html/rfc2554) 的允许方法。支持的方法有：

* `login`

  [AUTH LOGIN](https://tools.ietf.org/html/draft-murchison-sasl-login-00)
* `plain`

  [AUTH PLAIN](https://tools.ietf.org/html/rfc4616)
* `cram-md5`

  [AUTH CRAM-MD5](https://tools.ietf.org/html/rfc2195)。为了使此方法正常工作，密码不加密存储。
* `external`

  [AUTH EXTERNAL](https://tools.ietf.org/html/rfc4422)（1.11.6）。
* `none`

  不需要验证

### smtp\_capabilities

|       - | 说明                                      |
| ------: | --------------------------------------- |
|  **语法** | **smtp\_capabilities** `extension ...`; |
|  **默认** | ——                                      |
| **上下文** | mail、server                             |

设置传送给客户端响应 `EHLO` 命令的 SMTP 协议扩展列表。根据 [starttls](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_ssl_module.md#starttls) 指令值，[smtp\_auth](/nginx-docs/he-xin-gong-neng/mail/ngx_mail_smtp_module.md#smtp_auth) 指令和 [STARTTLS](https://tools.ietf.org/html/rfc3207) 中指定的认证方法将自动添加到此列表中。

指定被代理客户端的 MTA 支持扩展是有意义的（当 nginx 透明地将客户端连接代理到后端，如果这些扩展与认证后使用的命令相关）。

目前的标准扩展名单已发布在 [www.iana.org](http://www.iana.org/assignments/mail-parameters)。

## 原文档

<http://nginx.org/en/docs/mail/ngx_mail_smtp_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_smtp_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.
