我在这个网站上的第一个问题,我很快就来了。
我是命令行工具和基于文本的应用程序的粉丝。我使用 tmux 和简约平铺 wm 是 qtile,我无法更改环境。我是一名开发人员,我主要使用Python和Perl。
我的第一个问题是关于 mutt 的一个好客户。我使用侧边栏来显示邮箱。我将 imap 与 google 帐户一起使用,这是我的配置:
account-hook . 'unset preconnect imap_user imap_authenticators'
#First account
account-hook 'imaps://[email protected]@imap.gmail.com:993/' \
' set imap_user = "[email protected]" \
imap_pass = "password" '
folder-hook 'imaps://[email protected]@imap.gmail.com:993/INBOX' \
' set imap_user = "[email protected]" \
imap_pass = "1password" \
smtp_url = "smtp://[email protected]@smtp.gmail.com:587/" \
smtp_pass = "password" \
from = "[email protected]" \
realname = "Natal Ngétal" \
folder = "imaps://[email protected]@imap.gmail.com:993" \
spoolfile = "+INBOX" \
postponed="+[Gmail]/Drafts" \
mail_check=60 \
imap_keepalive=300 '
#Second account
account-hook 'imaps://[email protected]@imap.gmail.com:993/' \
' set imap_user = "[email protected]" \
imap_pass = "password" '
folder-hook 'imaps://[email protected]@imap.gmail.com:993/INBOX' \
' set imap_user = "[email protected]" \
imap_pass = "password" \
smtp_url = "smtp://[email protected]@smtp.gmail.com:587/" \
smtp_pass = "password" \
from = "[email protected]" \
realname = "Natal Ngétal" \
folder = "imaps://[email protected]@imap.gmail.com:993" \
spoolfile = "+INBOX" \
postponed="+[Gmail]/Drafts" \
mail_check=60 \
imap_keepalive=300 '
mailboxes + 'imaps://[email protected]@imap.gmail.com:993/INBOX' \
+ 'imaps://[email protected]@imap.gmail.com:993/INBOX' \
+ 'imaps://[email protected]@imap.gmail.com:993/[Gmail]/Messages envoyés' \
+ 'imaps://[email protected]@imap.gmail.com:993/[Gmail]/Messages envoyés' \
+ 'imaps://[email protected]@imap.gmail.com:993/[Gmail]/Spam' \
+ 'imaps://[email protected]@imap.gmail.com:993/[Gmail]/Spam' \
+ 'imaps://[email protected]@imap.gmail.com:993/Divers' \
+ 'imaps://[email protected]@imap.gmail.com:993/Divers' \
+ 'imaps://[email protected]@imap.gmail.com:993/[Gmail]/Tous les messages' \
+ 'imaps://[email protected]@imap.gmail.com:993/[Gmail]/Tous les messages'
# Where to put the stuff
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set mail_check = 30
set move = no
set imap_keepalive = 900
set editor = "vim"
set date_format = "%D %R"
set index_format = "[%Z] %D %-20.20F %s"
set sort = threads # like gmail
set sort_aux = reverse-last-date-received # like gmail
set uncollapse_jump # don't collapse on an unread message
set sort_re # thread based on regex
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
bind index gg first-entry
bind index G last-entry
bind index R group-reply
bind index <tab> sync-mailbox
bind index <space> collapse-thread
# Ctrl-R to mark all as read
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mar
# Saner copy/move dialogs
macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"
bind index \CP sidebar-prev
bind index \CN sidebar-next
bind index \CO sidebar-open
bind pager \CP sidebar-prev
bind pager \CN sidebar-next
bind pager \CO sidebar-open
set pager_index_lines = 10 # number of index lines to show
set pager_context = 3 # number of context lines to show
set pager_stop # don't go to next message automatically
set menu_scroll # scroll in menus
set tilde # show tildes like in vim
unset markers # no ugly plus signs
bind pager k previous-line
bind pager j next-line
bind pager gg top
bind pager G bottom
bind pager R group-reply
set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
auto_view text/html # view html automatically
alternative_order text/plain text/enriched text/html
set sidebar_delim = '│'
set sidebar_visible = yes
set sidebar_width = 24
set status_chars = " *%A"
set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postpone
set beep_new # bell on new mails
unset mark_old # read/new is good enough for me
color normal white black
color attachment brightyellow black
color hdrdefault cyan black
color indicator black cyan
color markers brightred black
color quoted green black
color signature cyan black
color status brightgreen blue
color tilde blue black
color tree red black
color index red black ~D
color index magenta black ~T
set signature="~/.signature"
所以它运作良好,我可以看到我的收件箱以及其中何时有新帖子。但是当我打开 mutt 时,它首先打开了一个本地邮箱,我不明白为什么,并且要查看其他收件箱中的新帖子,我必须先在每个收件箱中移动。也许这很正常,但是如何通过要求 mutt 首先打开domain.com而不是不存在的本地域名来实现。
答案1
很难看出你想做什么,但你是否有机会寻找$spoolfile
全局上下文中的变量/配置设置?
我不确定它如何与 Mutt 的 IMAP 支持交互,但它允许您设置 Mutt 启动时默认打开的文件夹。
看起来您在帐户文件夹挂钩中设置了它,但是您需要将它设置在那些文件夹挂钩之外,以便在进入文件夹挂钩文件夹之前应用它。
尝试将以下内容添加到 ~/.muttrc 的末尾,看看是否有帮助:
set spoolfile="imaps://[email protected]@imap.gmail.com:993/INBOX"