This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Mutt

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Mutt and the translation is 100% complete.

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

Introduction

멋진 그래픽 사용자 인터페이스로 치장된 전자메일 클라이언트에 관심이 없거나 SSH 연결로 메일만 재빠르게 읽으려 한다면 콘솔 기반 메일 클라이언트 종류가 해당이 될지 모르겠습니다.

Mutt는 아직도 활발히 개발중인 현재 콘솔 기반의 메일 클라언트중 하나이며, 엄청나게 많은 활동 지원자(그리고 사용자)가 있습니다. 강력하고, 이리저리 설정할 수 있으며, 작고 효율적입니다.

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

Installation

Starting your Mutt adventure simply requires you to emerge it. Unfortunately, Mutt has a lots of options, which enable or disable certain functionalities of Mutt. We now briefly discuss the most important USE flags that you may want to enable based on your intended usage of Mutt. Please note that enabling most of them won't harm your Mutt, but may make it do more than an experienced Mutt user would like.

root #emerge --ask --verbose mail-client/mutt

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

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

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

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

마지막이긴 하지만, sidebar USE 플래그도 있습니다. 화면 왼편에 존재하는 메일함이 들어있는 탐색창을 보여줄 수 있는 Mutt 확장을 활성화합니다. 절대적으로 처음 접하는 사용자를 위한 추천 기능인건 아니지만(어떤 공식 문서에도 없고, 공식적인 요소도 아닙니다), 경험을 해본 사람들이라면 이 기능을 꽤 좋아할지 모릅니다. 다행스럽게도 이 USE 플래그를 활성화 하면 모든걸 다 보여주진 않는데, 여러분이 USE 플래그를 사용하고도 활성화 했는지 알아채지 못한다는 것입니다.

Configuration

After you emerged Mutt with your USE flags of choice, the only necessary step is to create a .muttrc file in your home directory. Muttrc's are to be found in many places on the web and in Mutt's documentation. In /usr/share/doc/mutt-<version>/samples you can find some muttrc samples that are from the official distribution. We discuss a very minimal .muttrc for an IMAP based account with SMTP mail delivery below.

파일 ~/.muttrcA .muttrc example file
# character set on messages that we send
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 we compose an UTF-8 encoded message
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 colours, for more colouring 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 = "Andrew Dalziel"
set from = "andy@mail.server"
alternates "andrew@mail.server|andrew.dalziel@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://andy@imap.mail.server/
set spoolfile=imaps://andy@imap.mail.server/
set record=imaps://andy@imap.mail.server/Sent
set postponed=imaps://andy@imap.mail.server/Drafts
  
# use headercache for IMAP (make sure this is a directory for performance!)
set header_cache=/var/tmp/.mutt
  
# mailboxes we want to monitor for new mail
mailboxes "="
mailboxes "=Lists"
  
# mailing lists we are on (these are regexps!)
subscribe "gentoo-.*@gentoo\\.org"
  
# SMTP mailing configuration (for sending mail)
set smtp_url=smtp://mail.server/
참고
위 예제의 모든 설정을 다시 보든 것이 좋습니다. 실제로 여러분이 원하는 설정과는 대부분 그리고 일부의 기본 설정이 맞지 않을 수 있습니다. 여러분이 원하는대로 mutt가 처음에 제대로 동작하지 않을 경우 이 점을 상기하십시오.

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

Once your .muttrc is setup, you are ready to launch Mutt by just running mutt. If you entered a valid IMAP server url, Mutt will prompt you for your password and afterwards load all messages for you. Note that the first time entering your mailbox may take a while if you have quite some messages, since Mutt's header cache is still empty. If this succeeds you're in your IMAP mailbox ready to go.

Navigation is intuitive, as is reading messages by just pressing the Enter key or Space bar. Mutt is quite Vim alike in that it uses key strokes to perform most of its actions. You best read Mutt's manual on the web to get yourself known with all existing functions (or press ? in Mutt) and what key they are bound to, or better, what key you like it to be bound to. Some essential keys are m (for message) to start composing a new message, q for quit, r for reply, s for save and p for print.

One of the features that Mutt has that is still not in today's most savvy email clients is the ability to display attachments inline through some viewer. The auto_view directive in the .muttrc file tells Mutt which attachments (based on their MIME-type) it should view inline. To figure out how to do that, Mutt uses mailcap files to lookup how to display a certain MIME-type. Usually the system wide mailcap file isn't sufficient here, so you better start a ~/.mailcap file to put items in there for copiousoutput that Mutt can display inline.

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

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

The above .mailcap example tells Mutt what to do to "view" msword and pdf files. For the former it should run a program called antiword (emerge app-text/antiword), for the latter the program pdftotext (emerge app-text/poppler). You can go wild with these to for example display rendered HTML (give app-text/vilistextum a try), render vcards, or show ASCII representation of attached images. All you need to do is define how to call the program in your .mailcap, and tell Mutt to try to view it inline using the auto_view directive.

마무리

Mutt is a very versatile console email client. If you like the concept, Mutt can be altered to behave in nearly any way through its configuration. Search the web to find others explaining how they did "it", or find one of the many patches that exist to make Mutt do even more. Gentoo applies a couple of very popular patches to Mutt, so make sure to check mutt -v if you want something more to make sure it is not yet already at your disposal. While learning Mutt is not necessarily easy, once it is in your fingers, it can make your mail experience much faster and efficient than with other clients. Searching for example is quite powerful if you know how to hit the right flags and know which regular expression narrows your search down. Enjoy Mutting!


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
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.