Skip to main content

腾讯企业邮箱 IMAP 命令行客户端

Project description

qqmail-cli

腾讯企业邮箱 IMAP 命令行客户端,用于浏览邮件、查看正文、下载附件。所有输出均为 JSON 格式。

核心亮点

  • JSON 输出 — 所有命令输出结构化 JSON,默认格式化,--compact 紧凑输出
  • 零配置登录 — .env 文件管理账号密码,一条命令验证连通性
  • 中文文件夹名自动解码 — Modified UTF-7 编码的文件夹名自动解码
  • 纯标准库 IMAP 通信 — 不依赖第三方 IMAP 库

安装

依赖 uv 管理 Python 环境和依赖:

uv sync

安装后可直接使用 qqmail 命令:

qqmail login

也可通过 uv run main.py 执行。

配置

在项目根目录创建 .env 文件:

IMAP_HOST=imap.exmail.qq.com
IMAP_PORT=993
IMAP_USER=your_email@example.com
IMAP_PASSWORD=your_password_or_app_token

使用方法

所有命令默认输出格式化 JSON,加 --compact 输出紧凑 JSON。

验证登录

qqmail login

列举邮箱文件夹

qqmail folders

浏览邮件(分页)

# 查看 INBOX 第一页(默认每页 20 封)
qqmail mails

# 指定文件夹和页码
qqmail mails --folder "Sent Messages" --page 2

# 调整每页数量
qqmail mails --size 50

查看邮件详情

qqmail mail 1555

# 查看完整内容(含转发的历史邮件)
qqmail mail 1555 --raw

# 指定文件夹
qqmail mail 1555 --folder "Sent Messages"

输出包含:idfromtoccsubjectdatebodyattachments

操作附件

# 列出附件
qqmail attachments list 1555

# 下载全部附件
qqmail attachments download 1555 -o /tmp/attachments

# 只下载指定附件
qqmail attachments download 1555 -f "周报.xlsx" -o /tmp/attachments

命令速查

命令 说明
login 验证登录信息
folders 列举邮箱文件夹
mails 浏览邮件(--folder--page--size
mail <id> 获取邮件详情(--raw 含历史邮件)
attachments list <id> 列出邮件附件
attachments download <id> 下载附件(-f 指定单个,-o 目录)

全局选项:--compact 紧凑 JSON 输出。

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qqmail_cli-0.2.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qqmail_cli-0.2.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file qqmail_cli-0.2.0.tar.gz.

File metadata

  • Download URL: qqmail_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qqmail_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a7855a0852eda94520b0aff81a44a3b60ba5e8409d407ecebe5ae58c3660afd4
MD5 5c5ed76a75770a47736eeb793b57c6b1
BLAKE2b-256 8e6f80ff57234be9678b4dc1b67818cfcd739a174d66a26d651723b1b83b973c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qqmail_cli-0.2.0.tar.gz:

Publisher: release.yml on hualet/qqmail-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qqmail_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: qqmail_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qqmail_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ed43840705914af48ab38c67fc3162cf7458eb247a9575932c94c05208c6abb
MD5 82572337ca172f8da87de1dab0634c2a
BLAKE2b-256 77d8199fd80e1c2ea175f6bcd8b7b87def14dc628ee21bb31c13610462a6f098

See more details on using hashes here.

Provenance

The following attestation bundles were made for qqmail_cli-0.2.0-py3-none-any.whl:

Publisher: release.yml on hualet/qqmail-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page