mutt

来自百合仙子's Wiki
跳转到导航 跳转到搜索

操作

thread

连接

先tag子邮件,然后在父邮件上按&即可。

折叠

Esc-v切换折叠当前会话,Esc-V切换折叠所有会话。

标记

N
切换“新邮件”标记
F
切换“重要”标记
w
设定标记(会询问设定什么标记)
W
清除标记

tag

标记一封邮件,使用t;标记(或反标记)一个会话,使用<Esc>t;按模式tag,使用Shift-T

在操作前附加;即可让操作针对所有tag了的邮件。

编辑

^E
更新 MIME 类型
^T
编辑类型。可用于发送 HTML 邮件

命令行

通过命令行发送带邮件头的邮件(可用于批量回复),如

mutt -H - -e 'set record=.../INBOX' "$to" <<MAIL
From: $from
To: $to
In-Reply-To: $msgid
Subject: $subj

$body
MAIL

模式

~b EXPR
正文匹配(正则)
=b STRING
正文匹配(字符串)
~f EXPR
发送者
~t EXPR
接收者
~s EXPR
邮件主题
~=
重复的邮件
~d >3w
三周以前的邮件。可用的时间单位有y, m, w, d
~(~s ^Patch (~N | ~O))
主题以Patch开头的未读会话

快捷符号

  • ! -- $spoolfile 指定的信箱(即收件箱)
  • > -- $mbox 指定的邮箱
  • < -- $record 指定的信箱
  • ^ -- 当前信箱
  • - 或 !! -- 上次访问的文件
  • ˜ -- home目录
  • = 或 + -- $folder 指定的目录
  • @alias -- 该别名所对应的地址

问题

使用自定义的脚本来转换:

text/html; muttHtml; nametemplate=%s.txt; copiousoutput

其中muttHtml

#!/bin/bash

enconv|html2text -nobs -utf8 -style pretty $1

附件文件名编码

这样设置即可

set rfc2047_parameters=yes

设置

色彩

要使mutt能使用256色,需要让其知道终端支持256色,如可以这样:

TERM=xterm-256color mutt

颜色使用color123这样的方式来表示。

要自动 fallback,可以在特定的条件下才载入 256 色配置,如[1]

source $HOME/.muttrc-color-`tput colors`

发件设置

禁用Mail-Followup-To[2]

set followup_to=no

hooks

发送信件

给不同人发信件时使用不同的From

send-hook '~t \\<mutt-users@mutt\.org\\>' 'my_hdr From: <your address here>'
set imap_user=username
set imap_pass=password
set spoolfile=imap://host/INBOX
set folder=imap://host/

邮件管理

设置识别的回复邮件标题前导字符串

set reply_regexp="^(re:|回复[::])[ \t]*"

注:使用“Re: ”作为回复前导字符串是由 RFC 2822 定义的,来自于拉丁文。

腾讯邮箱 + offlineimap

set imap_user=xxx@xxx.com
set imap_pass=yyy

set realname = zzz
set use_from = yes
set smtp_url=smtps://$imap_user:$imap_pass@smtp.exmail.qq.com

# set header_cache = ~/.cache/mutt
# set message_cachedir = ~/.cache/mutt
# unset imap_passive
# set imap_keepalive = 300
# set mail_check = 120

set mbox_type=Maildir
set folder=~/.Maildir
set spoolfile=+INBOX
set postponed = "+Drafts"
set record = "+Sent Messages"
save-hook . +其他文件夹.存档

参见

外部链接

参考资料