Mutt는 여러 계정을 imap합니다

Mutt는 여러 계정을 imap합니다

이 사이트에 대한 첫 번째 질문이 곧 답변될 예정입니다.

저는 명령줄 도구와 텍스트 기반 응용 프로그램을 좋아합니다. 저는 tmux를 사용하고 있으며 미니멀리스트 타일 wm은 qtile이고 환경을 변경할 수 없습니다. 저는 개발자이고 주로 Python과 Perl을 사용합니다.

내 첫 번째 질문은 mutt의 좋은 클라이언트에 관한 것입니다. 사이드바를 사용하여 메일함을 표시합니다. 나는 Google 계정으로 imap을 사용하고 있으며 이것이 내 구성입니다.

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를 열면 먼저 로컬 사서함이 열리고 왜 그런지 이해가 되지 않으며 다른 받은 편지함의 새 게시물을 보려면 먼저 각 받은 편지함으로 이동해야 합니다. 어쩌면 이것이 정상일 수도 있지만 존재하지 않는 로컬 도메인 이름 대신 domain.com을 먼저 열도록 mutt에게 요청하여 이를 달성하는 방법은 무엇입니까?

답변1

하고 싶은 일이 무엇인지 알기 힘든데, 혹시 찾고 계시나요?$spoolfile전역 컨텍스트의 변수/구성 설정?

Mutt의 IMAP 지원과 어떻게 상호작용하는지 잘 모르겠지만, Mutt가 시작될 때 기본적으로 열리는 폴더를 설정할 수 있습니다.

계정 폴더 Hooks에 설정한 것처럼 보이지만 폴더 Hooks 폴더에 들어가기 전에 적용되도록 해당 폴더 Hooks 외부에 설정해야 합니다.

~/.muttrc 끝에 다음을 추가하고 도움이 되는지 확인하세요.

set spoolfile="imaps://[email protected]@imap.gmail.com:993/INBOX"

관련 정보