1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# references:
# https://github.com/LukeSmithxyz/mutt-wizard
# https://wiki.archlinux.org/title/Mutt
# https://videos.lukesmith.xyz/
# https://docs.kernel.org/process/email-clients.html
# https://blog.flaport.net/configuring-neomutt-for-email.html
# maybe useful:
# `man neomuttrc`
# `man neomutt`
# /etc/neomutt
# https://neomutt.org/guide/gettingstarted.html
# /usr/share/doc/neomutt/optionalfeatures.html
# realname and spoolfile deprecated, use real_name and spool_file, also some other variable names, see:
# https://github.com/neomutt/neomutt/commit/a5eaeb51b14c484fa52f6f519446253dea5667ca
# note the imaps:// and smtps://, maybe more secure?
# note: xyz@flylightning.xyz will not work, need mail.flylightning.xyz, maybe because they require the actual imaps and smtps email server DNS
set smtp_url='smtps://xyz@mail.flylightning.xyz'
# mbox_type not sure if needed, maybe needed because isync/mbsync set to use maildir format
set mbox_type=Maildir
set folder="$XDG_DATA_HOME/mail/xyz@flylightning.xyz"
# if fully online and not using mbsync:
#set folder='imaps://xyz@mail.flylightning.xyz'
# https://wiki.archlinux.org/title/Mutt#Pass
# need "" instead of ''?
# Just `pass show xxx` also works. My xxx password also has lines of other info I do not want to output
# credit: GPL-2.0-or-later https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu
# pipe to `head -n1` also works, it seems it will auto strip out \n newline char?
set imap_pass="`pass show master3 | { IFS= read -r p; printf %s \"$p\";}`"
set smtp_pass="`pass show master3 | { IFS= read -r p; printf %s \"$p\";}`"
set from='xyz@flylightning.xyz'
# /etc/neomuttrc says if use from var this will not use? not sure if works
set real_name='Xiao Pan'
# this seems also determines sidebar mailbox order
mailboxes =INBOX =Sent =Drafts =Archive =Junk =Trash
# if fully online and use `set folder="imaps://xyz@mail.flylightning.xyz"` instead:
# default not auto subscribe to inbox? need `mailboxes =INBOX` at least
#mailboxes =INBOX
#set imap_check_subscribed
# spool_file not sure if needed
# + seems mean remote?
set spool_file='+INBOX'
set record='+Sent'
set trash='+Trash'
set postponed='+Drafts'
# `man neomuttrc.5` says "Header caching can greatly improve speed when ..."
set header_cache="$XDG_CACHE_HOME/mutt"
set message_cache_dir="$XDG_CACHE_HOME/mutt"
# Allow Mutt to open a new IMAP connection automatically.
unset imap_passive
set attach_save_dir="$XDG_DOWNLOAD_DIR"
set attach_save_without_prompting
# linux kernel mailing list rules:
set send_charset="us-ascii:utf-8"
# Sender, email address, and sign-off line must match
# because joe@localhost is just embarrassing
unset use_domain
# about pgp:
#auto_view application/pgp-encrypted
# maybe use account-hook or folder-hook to `unset crypt_auto_sign` for accounts I do not wish to auto sign
set crypt_auto_sign
set pgp_default_key='FDA389A17B94BCE0E2FA3D71842BFD347BE06812'
# maybe useful: crypt_opportunistic_encrypt, crypt-hook
# https://neomutt.org/guide/gettingstarted#2-4-%C2%A0sidebar
set sidebar_visible
set sidebar_width=20
# manpage suggested
# %<... is nested if, see https://neomutt.org/feature/nested-if
set sidebar_format='%B%<F? [%F]>%* %<N?%N/>%S'
set sidebar_short_path
# needed for some sidebar features
set mail_check_stats
# to avoid lags using IMAP with some email providers (yahoo for example)
set mail_check=60
# no ask auto save to draft
set postpone='yes'
set query_command="abook --mutt-query '%s'"
# https://neomutt.org/guide/advancedusage#8-%C2%A0external-address-queries
# completion when ask for address input
# default ^T
# another way is Q, it will let me select an address from abook and start a new email
bind editor <Tab> complete-query
# maybe:
# maybe, from mutt-wizard:
# maybe add configs from mutt-wizard:
# - add Maildir configs? see arch wiki and mutt-wizard, not fully understood
# - mime type configs
# - other configs
# seems not working with this:
#set smtp_authenticators='gssapi:login'
#set forward_attachments=yes
#set forward_format = "Fwd: %s"
# can configure mailcap configs ~/.mailcap to use lynx to auto show html with lynx
#auto_view text/html
# navigation settings
bind index,pager g noop
macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
# synchronization settings ['S' to sync]
macro index S "<shell-escape>mbsync -a<enter>" "sync email"
|