Mutt

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Mutt and the translation is 18% complete.
Outdated translations are marked like this.

이 안내서에서는 강력한 명령행 전자메일 클라이언트 mutt 사용을 어떻게 시작하는지 보여드리겠습니다.

neomutt is a fork of mutt which is very similar, to which most of this article also applies.

Mutt는 처음에 로컬 mbox 메일 스풀(예: /var/spool/mail/ )로부터 메일을 읽는 용도로 설계했지만, 오늘날에는 폴더에 저장하는 Maildir을 지원하고, POP3 서버로부터 원격 가져오기가 가능하며, IMAP의 완벽한 관리가 됩니다. Mutt가 무얼 할 수 있는지에 대한 전체 설명을 보시려면 http://www.mutt.org/ Mutt 웹 사이트에 있는 Mutt 설명서를 보십시오.

Mutt 요청하기

Mutt에 대한 모험을 시작하는데는 그냥 이머지 동작만 필요합니다. 애석하게도 Mutt에 각각의 기능을 활성화 하거나 비활성화 할 옵션이 꽤 많습니다. 이제 Mutt를 사용하겠다는 사실을 기반으로 하여 여러분이 원하는 기능을 활성화 하는 중요한 USE 플래그에 대해 이야기해보도록 하겠습니다. 참고로 대부분의 기능을 활성화 하는건 Mutt에 문제가 되지 않겠지만 Mutt 사용자가 이미 경험했고 좋아할 그 이상의 기능을 넣게 될지도 모릅니다.

Emerge

root #emerge -pv mutt
[ebuild     N ] mail-client/mutt-1.5.21-r1 USE="gdbm gpg imap mbox nls nntp \
                  sidebar smime smtp ssl -berkdb -crypt -debug -doc -gnutls \
                  -idn -pop -qdbm -sasl -tokyocabinet"

USE flags

USE flags for mail-client/mutt A small but very powerful text-based mail client

autocrypt Enable autocrypt.org support
berkdb Enable sys-libs/db database backend for header caching
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
gdbm Enable sys-libs/gdbm database backend for header caching
gnutls Prefer net-libs/gnutls as SSL/TLS provider (ineffective with USE=-ssl)
gpgme Build gpgme backend to support S/MIME, PGP/MIME and traditional/inline PGP
gsasl Use GNU SASL via virtual/gsasl instead of Cyrus SASL (requires USE=sasl)
hcache Enable header cache, one database backend needs to be enabled
idn Enable support for Internationalized Domain Names
imap Add support for IMAP (Internet Mail Application Protocol)
kerberos Add kerberos support
lmdb Enable dev-db/lmdb database backend for header caching
mbox Add support for mbox (/var/spool/mail) style mail spools
nls Add Native Language Support (using gettext - GNU locale utilities)
pgp-classic Build classic_pgp backend to support PGP/MIME and traditional/inline PGP
pop Enable support for POP3 mailboxes
prefix Defines if a Gentoo Prefix offset installation is used
qdbm Add support for the qdbm (Quick Database Manager) library
sasl Add support for the Simple Authentication and Security Layer
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
slang Add support for the slang text display library (it's like ncurses, but different)
smime-classic Build classic_smime backend to support S/MIME
smtp Enable support for direct SMTP delivery
ssl Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
tokyocabinet Enable dev-db/tokyocabinet database backend for header caching
vanilla Do not add extra patches which change default behaviour; DO NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically

IMAP

처음 사용하시는 분들께는 아마도 imap USE 플래그가 가장 중요한게 아닌가 싶습니다. 이 플래그를 활성화 하면 그 어떤 문제로도 괴로워 하지 아니할 것이기에, Mutt로 사용할 계정이 어떤 방식인지 모르겠다면 그냥 활성화 하십시오. GMail같은 무료 서비스를 제공하는 대부분의 전자메일 서비스 제공 회사에서는 오늘날 각기 다른 장소에서 동시에 여러 클라이언트에서 전자메일을 살펴볼 수 있도록 저장하는 간편한 수단인 IMAP 방식을 사용합니다. IMAP은 서버의 메일을 그대로 두기 때문에 Mutt에서는 보고자 하는 메시지만 다운로드합니다.

Header cache backends

가끔 같은 메시지를 여러번 다운로드 해야 할 때 몇가지 메일을 가끔씩 지나치는 일이 있을 수 있습니다. 굉장히 불필요한 짓이기에 Mutt에서는 필요한 메시지의 중요한 부분을 간직하는 헤더 캐시(hcache)를 사용합니다. 헤더 캐시는 gdbm, berkdb, qdbm,tokyocabinet의 네가지 db 라이브러리를 기반으로 합니다. 기본으로 설정한 요소가 없다면, gdbm 또는 berkdb를 선택하십시오. 아마 대부분의 경우 시스템에 두가지 디비를 설치했을 것입니다. 헤더 캐시 백엔드를 위해 하나 이상의 USE 플래그를 활성화 하면 Mutt에서 가장 좋은 놈을 선택합니다. 언제든 가장 좋은 놈을 사용할 것입니다.

Sending mail

IMAP은 메일을 보는데 중요한데, 메일을 보낼때는 메일 서버가 필요합니다. Mutt는 로컬 시스템에 존재하는 메일 서버와 통신할 수 있지만 항상 그런것만은 아니며, 간단하게 말해서 이리저리 여행을 다니는 랩톱 사용자에겐 좋은 방법은 아닙니다. Mutt는 smtp USE 플래그를 사용하여 SMTP 지원을 활성화 할 수 있습니다. 다시 말하지만, 문제가 없다고 장담하지 못할 경우에 활성화 하십시오. Mutt의 SMTP 지원은 전자메일 서비스 제공자가 제공하여 여러분이 선택한 메일 서버를 통해 메일을 보내도록 합니다.

Secure protocols

IMAP과 SMTP는 대부분 오늘날 암호화 채널로 처리하지만, 두 부분중 어느 하나라도 활성화 했다면 USE 플래그 ssl 또는 gnutls 둘 중 하나를 활성화 하는 것이 좋습니다. 두 USE 플래그는 보안 버전 프로토콜 (imaps, smtps)을 Mutt의 OpenSSL이나 GNUTLS의 보안 지원 프로토콜 목록에 추가합니다. 두 경우에 대한 강력한 취향이 없으면, 그냥 ssl로 하십시오. 어쨌든 대부분 전역 USE 플래그는 이미 들어있습니다. 전자메일을 보낼때 자신을 인증하려 한다면 USE 플래그에 sasl을 미리 넣었는지 확인하십시오.

Encryption

Even with secure IMAPS and SMTPS protocols, it is best practice to sign and/or encrypt email messages. Mutt supports traditional OpenPGP and S/MIME. Both of these are supported using the gpgme wrapper. The easiest way to setup support for signed and encrypted messages is using the gpgme USE flag. Documentation and experiences in this area can be confusing to say the least. When enabling gpgme USE flag, ensure the backend has been properly setup in the configuration (see below).

Mutt 설정

골라낸 USE 플래그로 mutt를 이머지한 다음에 필요한 과정은 내 폴더에 .muttrc 파일을 만드는 것입니다. muttrc는 웹에서든 mutt 문서든 그 어디에서든 찾을 수 있습니다. /usr/share/doc/mutt-<version>/samples에서 공식 배포판의 muttrc 예제를 찾아볼 수 있습니다. 아래에서 SMTP 메일 전송이 가능한 IMAP 기반 계정에 대해 .muttrc를 설정하는 방법을 매우 간단히 이야기하도록 하겠습니다.

Files

.muttrc

파일 ~/.muttrc.muttrc 예제 파일
# character set on sent messages
set send_charset="utf-8"
# if there is no character set given on incoming messages, it is probably windows
set assumed_charset="iso-8859-1"
  
# make sure Vim knows Mutt is a mail client and that a UTF-8 encoded message will be composed
set editor="vim -c 'set syntax=mail ft=mail enc=utf-8'"
  
# just scroll one line instead of full page
set menu_scroll=yes
  
# we want to see some MIME types inline, see below this code listing for explanation
auto_view application/msword
auto_view application/pdf
  
# make default search pattern to search in To, Cc and Subject
set simple_search="~f %s | ~C %s | ~s %s"
  
# threading preferences, sort by threads
set sort=threads
set strict_threads=yes
  
# show spam score (from SpamAssassin only) when reading a message
spam "X-Spam-Score: ([0-9\\.]+).*" "SA: %1"
set pager_format = " %C - %[%H:%M] %.20v, %s%* %?H? [%H] ?"
  
# do not show all headers, just a few
ignore          *
unignore        From To Cc Bcc Date Subject
# and in this order
unhdr_order     *
hdr_order       From: To: Cc: Bcc: Date: Subject:
  
# brighten up stuff with colors, for more coloring examples see:
# http://aperiodic.net/phil/configs/mutt/colors
color normal      white          black
color hdrdefault  green          default
color quoted      green          default
color quoted1     yellow         default
color quoted2     red            default
color signature   cyan           default
color indicator   brightyellow   red
color error       brightred      default
color status      brightwhite    blue
color tree        brightmagenta  black
color tilde       blue           default
color attachment  brightyellow   default
color markers     brightred      default
color message     white          black
color search      brightwhite    magenta
color bold        brightyellow   default
# if you don't like the black progress bar at the bottom of the screen,
# comment out the following line
color progress    white          black
  
# personality settings
set realname = "Larry the cow"
set from = "larry@mail.server"
alternates "larry@mail.server|larry.the.cow@mail.server"
# this file must exist, and contains your signature, comment it out if
# you don't want a signature to be used
set signature = ~/.signature
  
# aliases (sort of address book)
source ~/.aliases
  
# IMAP connection settings
set mail_check=60
set imap_keepalive=300
  
# IMAP account settings
set folder=imaps://larry@imap.mail.server/
set spoolfile=imaps://larry@imap.mail.server/
set record=imaps://larry@imap.mail.server/Sent
set postponed=imaps://larry@imap.mail.server/Drafts
  
# use headercache for IMAP (make sure this is a directory for better performance!)
set header_cache=/var/tmp/.mutt
  
# uncomment this to enable the sidebar feature
#set sidebar_visible = yes
set sidebar_width = 15
set sidebar_folder_indent = yes
set sidebar_short_path = yes
 
# make the progress updates not that expensive, this will update the bar every 300ms
set read_inc = 1
set time_inc = 300
 
# only if you compiled Mutt with USE=gpgme, enable the gpgme backend
set crypt_use_gpgme = yes
# you can set this to hide gpg's verification output and only rely on Mutt's status flag
#set crypt_display_signature = no
# enable signing of emails by default
set pgp_autosign = yes
set pgp_sign_as = 0xXXXXXXXX   # your gpg keyid here
set pgp_replyencrypt = yes

# mailboxes we want to monitor for new mail
mailboxes "="
mailboxes "=Lists"
  
# mailing lists for a Gentoo user (these are regexps!)
subscribe "gentoo-.*@gentoo\\.org"
  
# SMTP mailing configuration (for sending mail)
set smtp_url=smtp://larry@mail.server/
참고
위 예제의 모든 설정을 다시 보든 것이 좋습니다. 실제로 여러분이 원하는 설정과는 대부분 그리고 일부의 기본 설정이 맞지 않을 수 있습니다. 여러분이 원하는대로 mutt가 처음에 제대로 동작하지 않을 경우 이 점을 상기하십시오.

위에서 보신 .muttrc 예제 내용은 IMAP 계정을 설정하고, 메일을 보내는데 SMTP 서버를 사용하며, /var/tmp/.mutt의 캐시에 저장합니다. 그리고 알려진 주소 별칭(아마 주소록인 것 같습니다)을 ~/.aliases 파일에서 읽어오고, 새 메일을 작성할때 ~/.signature 파일의 서명을 첨부합니다. 어떤 IMAP 서버에서는 스풀, 레코드, 연기 디렉터리를 INBOX라 하는 폴더 아래 SentDrafts 폴더로 바꿔야 할 수도 있습니다. mutt에서의 설정 시도는 주어진 설정을 알아내는데 가장 간단한 방법을 제공합니다.

.muttrc를 설정하고 나면, 그냥 mutt를 실행하기만 하는걸로 mutt를 실행할 준비가 됩니다. 존재하는 IMAP 서버 URL을 입력하면 mutt에서 암소를 물어보며 그 다음 모든 메시지를 읽어서 보여줍니다. 참고로 처음에 메일함에 들어갈때 좀 많은 메시지를 불러오기에 상당한 시간이 걸릴 수 있는데, mutt의 헤더 캐시가 비어있기 때문입니다. 이 과정을 제대로 끝내면 IMAP 메일함을 쓸 준비가 됩니다.

탐색은 엔터 키를 누르거나 스페이스바 키를 누르는 것으로 메시지를 읽는 것처럼 직관적입니다. mutt는 vim처럼 대부분의 동작을 키 누름을 받아 처리합니다. 여러분 자신이 모든 기능에 대해 알아보고, 해당 기능에 어떤 키가 붙어있는지, 더 좋게는 여러분이 어떤 키로 바꾸고 싶은지 웹에서 (또는 mutt에서 ?를 입력하여) mutt 설명서를 멋지게 살펴보았습니다. 몇가지 핵심적인 키로는 새 메시지를 작성할때 m(Message) 키를 사용하고, 끝낼 때는 q(Quit)키를 사용하며, 답장을 보낼때는 R(Reply)키, 저장할 때는 s(Save)키, 인쇄는 p(Print)키가 있습니다.

.mailcap

mutt의 기능중 하나는 대부분의 오늘날 메일을 저장하는 클라이언트에서 보기 프로그램을 통해 자체적으로 첨부한 내용을 보여주는 기능이 없는데, mutt에선 이 기능이 있다는 점입니다. .muttrc 파일의 auto_view 지시어는 mutt에게 어떤 첨부 파일(MIME 형식 기반)을 자체적으로 보여줄지를 알려줍니다. 이 동작을 어떻게 하는지 찾아보기 위해 mutt에서는 mailcap 파일을 사용하고 각각의 MIME 형식을 어떻게 보여줄지 찾습니다. 보통 시스템 범위의 mailcap 파일의 내용은 충분치 않으므로, ~/.mailcap 파일로 시작하여 mutt가 자체적으로 보여줄 수 있는 copiousoutput에 각 항목을 설정하는 것이 좋습니다.

예를 들어 위에서 보여드린 .muttrc에서 auto_view 지시문은 application/mswordapplication/pdf 형식에 활성화 했습니다. doc 파일로 보낸 회의 첨부 기록을 저장하지 않고도 리버오피스에서 완벽하게 제대로 읽을 수 있기 때문에, 이 기능이 대단히 쓸모가 있음을 보여줍니다. 대신 ~/.mailcap 파일에 일치하는 항목이 있을 경우 텍스트는 메시지 읽기 프로그램에 나타냅니다.

파일 ~/.mailcap.mailcap 예제 파일
application/msword; antiword '%s'; copiousoutput; description=Word Document;
nametemplate=%s.doc
application/pdf; pdftotext '%s' -; copiousoutput; description=PDF Document;
nametemplate=%s.pdf

위의 .mailcap 예제에서는 어떤 msword 파일과 pdf 파일을 "볼지" mutt에 설명합니다. 앞의 내용은 antiword (emerge app-text/antiword ) 프로그램을 호출하고, 뒤의 내용에 대해서는 pdftotext (emerge app-text/poppler ) 프로그램을 호출합니다. 예를 들어 렌더링한 HTML의 표시(app-text/vilistextum을 시도해보십시오), vcard 렌더링, 첨부 그림의 ASCII 표현을 보여줄 경우, 날바닥에서도 작업을 진행할 수 있습니다. .mailcap에 어떻게 프로그램을 호출해야 하는지 필요한 모든 동작을 정의했고, mutt에게 auto_view 지시문으로 자체적으로 보여주라고 알립니다.

마무리

mutt는 매우 다양한 기능을 가진 콘솔 전자메일 클라이언트입니다. 이 개념을 좋아한다면 mutt는 자체 설정을 통해 어떤 방법으로든 대체할 수 있습니다. 웹을 검색하여 다른 사람들이 어떻게 mutt로 갈아탔는지 설명을 찾아보시거나, mutt로 할 수 있는 더 많은 동작에 대한 패치를 찾아보세요. 젠투는 mutt 에 꽤 잘 알려진 몇가지 패치를 넣었으니, 여러분이 행한대로 mutt가 기능을 갖추었는지 더 많은걸 확인해보려면 mutt -v 명령으로 확인해보세요. mutt가 그리 쉽지 않다는걸 손 끝을 통해 배우는 동안, 다른 클라이언트보다 훨씬 빠르고 효율적인 메일 클라이언트의 경험을 할 수 있습니다. 어떻게 올바른 플래그를 찾아내는지, 어떤 정규표현식이 검색해 내려갈 조건을 좁히는지 알려면 예제를 검색하는 것이 좀 더 확실합니다. mutt를 즐기세요~!

See also


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Fabian Groffen (grobian)
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.