Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

nonebot-adapter-mail

NoneBot-Adapter-Mail

✨ Mail Adapter ✨

license pypi python pre-commit

配置

修改 .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
    }
  }
]
'

适配器默认行为

  • 邮件主题按以下优先级解析:
    1. 调用发送时传入的 subject 参数
    2. 消息中的 MessageSegment.subject 段
    3. 回复时使用 Re: 原邮件主题
    4. 使用配置中的默认 subject
  • 发送函数可选参数:
    • cc: 抄送列表
    • bcc: 密送列表
    • subject: 邮件主题
    • in_reply_to: 所回复的邮件的 Message ID
    • references: 邮件线程中的邮件 Message ID 列表
    • reply_to: 接收方回复邮件时的默认地址列表
  • 发送函数中未指定 references 但已指定 in_reply_to 时,references 默认设置为 in_reply_to
  • 快捷发送函数 bot.send 的 reply=True 时的配置:
    • subject 未指定时使用 Re: 原邮件主题
    • in_reply_to 未指定时使用原邮件的 Message ID
    • references 未指定时使用原邮件的 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)

Source distribution for nonebot-adapter-mail 1.0.0a7
File Size Uploaded Provenance
nonebot_adapter_mail-1.0.0a7.tar.gz 13.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-adapter-mail 1.0.0a7
File Interpreter ABI Platform
nonebot_adapter_mail-1.0.0a7-py3-none-any.whl Python 3 none any Details

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page