himalaya

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Himalaya Email CLI

Himalaya Email CLI

Himalaya is a CLI email client that lets you manage emails from the terminal using IMAP, SMTP, Notmuch, or Sendmail backends.
Himalaya是一款CLI邮件客户端,可让你通过IMAP、SMTP、Notmuch或Sendmail后端在终端中管理邮件。

References

参考资料

  • references/configuration.md
    (config file setup + IMAP/SMTP authentication)
  • references/message-composition.md
    (MML syntax for composing emails)
  • references/configuration.md
    (配置文件设置 + IMAP/SMTP身份验证)
  • references/message-composition.md
    (用于撰写邮件的MML语法)

Prerequisites

前置条件

  1. Himalaya CLI installed (
    himalaya --version
    to verify)
  2. A configuration file at
    ~/.config/himalaya/config.toml
  3. IMAP/SMTP credentials configured (password stored securely)
  1. 已安装Himalaya CLI(可通过
    himalaya --version
    验证)
  2. 配置文件位于
    ~/.config/himalaya/config.toml
  3. 已配置IMAP/SMTP凭据(密码需安全存储)

Configuration Setup

配置设置

Run the interactive wizard to set up an account:
bash
himalaya account configure
Or create
~/.config/himalaya/config.toml
manually:
toml
[accounts.personal]
email = "you@example.com"
display-name = "Your Name"
default = true

backend.type = "imap"
backend.host = "imap.example.com"
backend.port = 993
backend.encryption.type = "tls"
backend.login = "you@example.com"
backend.auth.type = "password"
backend.auth.cmd = "pass show email/imap"  # or use keyring

message.send.backend.type = "smtp"
message.send.backend.host = "smtp.example.com"
message.send.backend.port = 587
message.send.backend.encryption.type = "start-tls"
message.send.backend.login = "you@example.com"
message.send.backend.auth.type = "password"
message.send.backend.auth.cmd = "pass show email/smtp"
运行交互式向导来设置账户:
bash
himalaya account configure
或手动创建
~/.config/himalaya/config.toml
toml
[accounts.personal]
email = "you@example.com"
display-name = "Your Name"
default = true

backend.type = "imap"
backend.host = "imap.example.com"
backend.port = 993
backend.encryption.type = "tls"
backend.login = "you@example.com"
backend.auth.type = "password"
backend.auth.cmd = "pass show email/imap"  # 或使用系统密钥环

message.send.backend.type = "smtp"
message.send.backend.host = "smtp.example.com"
message.send.backend.port = 587
message.send.backend.encryption.type = "start-tls"
message.send.backend.login = "you@example.com"
message.send.backend.auth.type = "password"
message.send.backend.auth.cmd = "pass show email/smtp"

Common Operations

常用操作

List Folders

列出文件夹

bash
himalaya folder list
bash
himalaya folder list

List Emails

列出邮件

List emails in INBOX (default):
bash
himalaya envelope list
List emails in a specific folder:
bash
himalaya envelope list --folder "Sent"
List with pagination:
bash
himalaya envelope list --page 1 --page-size 20
列出收件箱中的邮件(默认):
bash
himalaya envelope list
列出指定文件夹中的邮件:
bash
himalaya envelope list --folder "Sent"
分页列出邮件:
bash
himalaya envelope list --page 1 --page-size 20

Search Emails

搜索邮件

bash
himalaya envelope list from john@example.com subject meeting
bash
himalaya envelope list from john@example.com subject meeting

Read an Email

阅读邮件

Read email by ID (shows plain text):
bash
himalaya message read 42
Export raw MIME:
bash
himalaya message export 42 --full
通过ID阅读邮件(显示纯文本):
bash
himalaya message read 42
导出原始MIME格式:
bash
himalaya message export 42 --full

Reply to an Email

回复邮件

Interactive reply (opens $EDITOR):
bash
himalaya message reply 42
Reply-all:
bash
himalaya message reply 42 --all
交互式回复(打开$EDITOR编辑器):
bash
himalaya message reply 42
回复所有人:
bash
himalaya message reply 42 --all

Forward an Email

转发邮件

bash
himalaya message forward 42
bash
himalaya message forward 42

Write a New Email

撰写新邮件

Interactive compose (opens $EDITOR):
bash
himalaya message write
Send directly using template:
bash
cat << 'EOF' | himalaya template send
From: you@example.com
To: recipient@example.com
Subject: Test Message

Hello from Himalaya!
EOF
Or with headers flag:
bash
himalaya message write -H "To:recipient@example.com" -H "Subject:Test" "Message body here"
交互式撰写(打开$EDITOR编辑器):
bash
himalaya message write
使用模板直接发送:
bash
cat << 'EOF' | himalaya template send
From: you@example.com
To: recipient@example.com
Subject: Test Message

Hello from Himalaya!
EOF
或使用头信息参数:
bash
himalaya message write -H "To:recipient@example.com" -H "Subject:Test" "Message body here"

Move/Copy Emails

移动/复制邮件

Move to folder:
bash
himalaya message move 42 "Archive"
Copy to folder:
bash
himalaya message copy 42 "Important"
移动到指定文件夹:
bash
himalaya message move 42 "Archive"
复制到指定文件夹:
bash
himalaya message copy 42 "Important"

Delete an Email

删除邮件

bash
himalaya message delete 42
bash
himalaya message delete 42

Manage Flags

管理标记

Add flag:
bash
himalaya flag add 42 --flag seen
Remove flag:
bash
himalaya flag remove 42 --flag seen
添加标记:
bash
himalaya flag add 42 --flag seen
移除标记:
bash
himalaya flag remove 42 --flag seen

Multiple Accounts

多账户管理

List accounts:
bash
himalaya account list
Use a specific account:
bash
himalaya --account work envelope list
列出所有账户:
bash
himalaya account list
使用指定账户:
bash
himalaya --account work envelope list

Attachments

附件处理

Save attachments from a message:
bash
himalaya attachment download 42
Save to specific directory:
bash
himalaya attachment download 42 --dir ~/Downloads
保存邮件中的附件:
bash
himalaya attachment download 42
保存到指定目录:
bash
himalaya attachment download 42 --dir ~/Downloads

Output Formats

输出格式

Most commands support
--output
for structured output:
bash
himalaya envelope list --output json
himalaya envelope list --output plain
大多数命令支持
--output
参数以生成结构化输出:
bash
himalaya envelope list --output json
himalaya envelope list --output plain

Debugging

调试

Enable debug logging:
bash
RUST_LOG=debug himalaya envelope list
Full trace with backtrace:
bash
RUST_LOG=trace RUST_BACKTRACE=1 himalaya envelope list
启用调试日志:
bash
RUST_LOG=debug himalaya envelope list
带回溯的完整跟踪:
bash
RUST_LOG=trace RUST_BACKTRACE=1 himalaya envelope list

Tips

小贴士

  • Use
    himalaya --help
    or
    himalaya <command> --help
    for detailed usage.
  • Message IDs are relative to the current folder; re-list after folder changes.
  • For composing rich emails with attachments, use MML syntax (see
    references/message-composition.md
    ).
  • Store passwords securely using
    pass
    , system keyring, or a command that outputs the password.
  • 使用
    himalaya --help
    himalaya <command> --help
    查看详细用法。
  • 邮件ID是相对于当前文件夹的;切换文件夹后需重新列出邮件。
  • 如需撰写带附件的富文本邮件,请使用MML语法(详见
    references/message-composition.md
    )。
  • 使用
    pass
    、系统密钥环或可输出密码的命令来安全存储密码。