1---2title: "Neomutt 配置(完全版)"3date: 2022-05-29T08:02:27+08:004draft: true5---67之前写过一篇简要的 [Neomutt 的使用](https://lin.moe/tutorial/2022/02/neomutt_smtp/), 之后笔者的工具和配置发生了一些变化,遂写下此文作为记录。89本文只考虑单用户模式,其他帐号的邮件均转发至主邮箱阅读。1011涉及软件包括12* Neomutt13* offlineimap14* notmuch15* msmtp16* gnupg1718笔者最新的 dotfiles 可以在 [sourcehut](https://git.sr.ht/~lindsay/dotfiles) 找到。1920## offlineimap21首先需要配置 imap 同步软件,将 imap 文件夹同步到本地,这里选用 offlineimap。22替代方案有 mbsync。2324offlineimap 的基础配置为四部分,包括 通用配置、帐号配置、远程文件、本地文件。2526```27[general]28 accounts = i-linmoe29 pythonfile = ~/.config/offlineimap/offlineimap.py30 maxsyncaccounts = 23132[Account i-linmoe]33 autorefresh = 0.534 quick = 535 localrepository = i-linmoe-local36 remoterepository = i-linmoe-remote37 postsynchook = ~/.config/offlineimap/notmuch-hook.sh3839[Repository i-linmoe-local]40 type = Maildir41 localfolders = ~/.mail/i-linmoe4243[Repository i-linmoe-remote]44 type = IMAP45 remotehost = imap.lin.moe46 remoteuser = i@lin.moe47 keepalive = 6048 holdconnectionopen = yes49 remotepasseval = get_pass("i@lin.moe")50 #folderfilter = lambda foldername: foldername in ["INBOX", "Sent"]51 sslcacertfile = /etc/ssl/certs/ca-certificates.crt52 ssl_version = tls1_253```