This release is a pre-release and may not be stable for production use.
配置
修改 .env 或 .env.* 文件以配置 Mail 适配器。
MAIL_BOTS
id: 电子邮件地址name: 显示名称password: 登录密码subject: 默认邮件主题imap: IMAP 配置host: IMAP 主机port: IMAP 端口tls: 是否使用 TLS
smtp: SMTP 配置host: SMTP 主机port: SMTP 端口tls: 是否使用 TLS
配置示例:
MAIL_BOTS='
[
{
"id": "i@example.com",
"name": "Name",
"password": "p4ssw0rd",
"subject": "Sent by NoneBot",
"imap": {
"host": "imap.example.com",
"port": 993,
"tls": true
},
"smtp": {
"host": "smtp.example.com",
"port": 465,
"tls": true
}
}
]
'
适配器默认行为
- 邮件主题按以下优先级解析:
- 调用发送时传入的
subject参数 - 消息中的
MessageSegment.subject段 - 回复时使用
Re: 原邮件主题 - 使用配置中的默认
subject
- 调用发送时传入的
- 发送函数可选参数:
cc: 抄送列表bcc: 密送列表subject: 邮件主题in_reply_to: 所回复的邮件的 Message IDreferences: 邮件线程中的邮件 Message ID 列表reply_to: 接收方回复邮件时的默认地址列表
- 发送函数中未指定
references但已指定in_reply_to时,references默认设置为in_reply_to - 快捷发送函数
bot.send的reply=True时的配置:subject未指定时使用Re: 原邮件主题in_reply_to未指定时使用原邮件的 Message IDreferences未指定时使用原邮件的 Message ID
- 消息中含有多个
MessageSegment.subject或MessageSegment.reply时,只取第一个
Metadata
Release files for nonebot-adapter-mail 1.0.0a7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_adapter_mail-1.0.0a7.tar.gz | 13.5 kB | Without provenance | Details for nonebot_adapter_mail-1.0.0a7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_adapter_mail-1.0.0a7-py3-none-any.whl | Python 3 | none | any | Details for nonebot_adapter_mail-1.0.0a7-py3-none-any.whl |
Total release size: 28.6 kB
Release files / nonebot_adapter_mail-1.0.0a7.tar.gz
| Download URL | nonebot_adapter_mail-1.0.0a7.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3aca314467d6f7331059e1d01a939172a2f72e7bce4d4d7f3a637fe5a23f84fd
|
|
BLAKE2b-256 checksum How to use checksums |
742197b4d9656728390a5a7aa3f885165bb1acacfea735660a720a871e8f4ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.21.0 CPython/3.10.10 Windows/10
|
Release files / nonebot_adapter_mail-1.0.0a7-py3-none-any.whl
| Download URL | nonebot_adapter_mail-1.0.0a7-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9676c2569dd311c56b45266c765376916f66757d9b4d6674ad373e6dcfa4e86
|
|
BLAKE2b-256 checksum How to use checksums |
2ea23b3dd13f462f3f297f3180b5222d4bb2abc4600f25b40732485c8b916d2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.21.0 CPython/3.10.10 Windows/10
|
Security for nonebot-adapter-mail 1.0.0a7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.