在 中mutt
,我可以判断电子邮件有附件,因为它在电子邮件的显示中显示:
[-- Attachment #1 --]
[-- Type: text/plain, Encoding: quoted-printable, Size: 0.3K --]
body text here
[-- Attachment #2: IMG_1234.JPG --]
[-- Type: image/jpeg, Encoding: base64, Size: 682K --]
[-- image/jpeg is unsupported (use 'v' to view this part) --]
Run Code Online (Sandbox Code Playgroud)
我还创建了一个配色方案来突出显示索引中的这些条目(尽管我被迫使用箭头光标)。在我的muttrc
:
color index green color231 "~X 1-"
Run Code Online (Sandbox Code Playgroud)
但是,有时带有附件的电子邮件不会显示在电子邮件显示中,也不会在索引中突出显示。按下 后,这些电子邮件的结构如下v
:
-> I 1 <no description> [multipa/alternativ, 7bit, 12M]
I 2 ??><no description> [text/plain, 7bit, us-ascii, 0.1K]
I 3 ??><no description> [multipa/related, 7bit, 12M]
I 4 ??><no description> [text/html, quoted, us-ascii, 1.4K]
I 5 ??>IMG_1234.jpeg [image/jpeg, base64, 3.9M]
I 6 ??>IMG_1235.jpeg [image/jpeg, base64, 1.4M]
I 7 ??>IMG_1236.jpeg [image/jpeg, base64, 3.0M]
I 8 ??>IMG_1237.jpeg [image/jpeg, base64, 4.4M]
Run Code Online (Sandbox Code Playgroud)
此示例是在 Apple Mail 中创建的。可能这是该客户端的错误。然而,我怎样才能mutt
表明附件的存在?结果我错过了一些附件。
我探索的一种可能的选择是突出显示任意大小以上的所有电子邮件,但这显然不适用于所有情况(并且不指示电子邮件显示本身中的附件)。
color index green color231 "~z 30K-"
Run Code Online (Sandbox Code Playgroud)
小智 2
我只是使用index_format
字符串来显示附件的存在,而不是颜色,如下所示:
set index_format = "[%Z][%?X?A& ?] %D %-20.20F %s %g"
这%?X?A& ?
是一个三元组,表示如果电子邮件有非零附件则显示字符“A”,否则显示“”。您实际上可以显示附件的数量,但我通常只关心是否有或没有。