swift 11/08/17 19:49:12 Modified: guide-to-mutt.xml Log: Bug #304623 - Rewrite of guide-to-mutt.xml. Thanks to Fabian Groffen
Revision Changes Path 1.20 xml/htdocs/doc/en/guide-to-mutt.xml file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml?rev=1.20&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml?rev=1.20&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml?r1=1.19&r2=1.20 Index: guide-to-mutt.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- guide-to-mutt.xml 17 Sep 2006 16:08:36 -0000 1.19 +++ guide-to-mutt.xml 17 Aug 2011 19:49:12 -0000 1.20 @@ -1,259 +1,128 @@ <?xml version='1.0' encoding="UTF-8"?> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v 1.19 2006/09/17 16:08:36 neysx Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v 1.20 2011/08/17 19:49:12 swift Exp $ --> -<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> +<!DOCTYPE guide SYSTEM "http://www.gentoo.org/dtd/guide.dtd"> -<guide link="/doc/en/guide-to-mutt.xml"> +<guide link="http://www.gentoo.org/doc/en/guide-to-mutt.xml"> <title>QuickStart Guide to Mutt E-Mail</title> <author title="Author"> - <mail link="[email protected]">Mike Polniak</mail> -</author> -<author title="Editor"> - <mail link="[email protected]">Ken Nowack</mail> -</author> -<author title="Contributor"> - <mail link="[email protected]">John Hitchings</mail> + <mail link="[email protected]">Fabian Groffen</mail> </author> <abstract> -This guide shows you how to begin using the powerful command line tools for -e-mail: fetchmail, procmail, mutt, nbsmtp, msmtp. +This guide shows you how to begin using the powerful command line e-mail +client mutt. </abstract> <!-- The content of this document is licensed under the CC-BY-SA license --> <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> <license/> -<version>1.7</version> -<date>2006-09-17</date> +<version>2</version> +<date>2011-08-17</date> <chapter> -<title>Introduction to E-Mail</title> +<title>The Mutt e-mail client</title> <section> <body> <p> If you're not a fan of e-mail clients with fancy graphical user interfaces, or -if you would just like to experiment with other mail clients before deciding -which is best for you, here is the easy way to begin using these powerful -command line tools: -</p> - -<p> -<b>fetchmail, procmail, mutt & smtp</b> -</p> - -<p> -These programs are not only powerful and highly customizable but also small and -efficient. Once you are up and running with this e-mail system you will be -amazed at what you can do with it. +you just like to be able to quickly read some mail over an SSH connection, the +class of console-based mail clients might be for you. </p> <p> -Because this is a quick start guide, we will eliminate the Mail Transfer Agent -(MTA) such as sendmail, postfix or exim. This means no complex MTA -configuration. It also eliminates using port 25 for mail service. +Mutt is one of the current console-based mail clients that's still under active +development and has a vast crowd of active supporters (and users). It is +powerful, highly customisable, small and efficient. </p> <p> -We can do this because fetchmail can force the mail it retrieves directly to a -Mail Delivery Agent (MDA) rather than forwarding to port 25. And we don't need -to use a complex MTA for plain old outgoing mail delivery. -</p> - -<p> -These are the programs you will need to get your e-mail running. -</p> - -<pre caption="Getting needed programs"> -# <i>emerge fetchmail nbsmtp procmail mutt</i> -</pre> - -<p> -Then just four quick steps to configure files and you will be up and running a -brand new e-mail system. +While Mutt was originally designed to read mail from the local mbox mail spool +(e.g. <path>/var/spool/mail/</path>), nowadays it comes with full support for +Maildir stored folders, remote fetching from POP3 servers and complete +management of IMAP accounts. For a full description of what Mutt can do, please +read the Mutt manual and Mutt website at <uri>http://www.mutt.org/</uri>. </p> -<impo> -After each step you can run a test to make sure the setup is correct. This -means you will have a complete working e-mail system when you are done. -</impo> - </body> </section> </chapter> <chapter> -<title>Fetchmail</title> +<title>Acquiring Mutt</title> <section> <body> <p> -Fetchmail fetches mail from remote servers and forwards it to your local -machines delivery system. To use it you need to set up a -<path>.fetchmailrc</path> file in your home directory like this example: -</p> - -<pre caption="Sample .fetchmailrc"> -<i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i> -</pre> - -<p> -Once you have created a <path>.fetchmailrc</path> file, you have to change the -permissions on the file using the chmod command. The file must be readable only -by the file owner. Set the permissions with the following command: -</p> - -<pre caption="Changing Permissions"> -$ <i>chmod 600 .fetchmailrc</i> -</pre> - -<p> -To see fetchmail in action, use the verbose mode (-v). To fetch all messages -use -a. And you must use the option -m to tell fetchmail to send the mail to -procmail. -</p> - -<warn> -While testing, it's a good idea to tell fetchmail to keep (-k) the mail on the -remote server in case something goes wrong and you need to fetch it again. -</warn> - -<p> -Run it now to see fetchmail in action! +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. </p> -<pre caption="Fetchmail test #1"> -$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> +<pre caption="Mutt's USE-flags"> +% <i>emerge -pv mutt</i> +[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" </pre> <p> -Once you have a working mail system you can set this as a cron job or put it in -a monitor like gkrellm. Fetchmail can also run in a daemon mode for which you -specify a polling interval in seconds. +First off, for newcomers, the <c>imap</c> USE-flag is most probably the most +important one. Enabling it won't hurt anything, so if you're unsure what +account you're going to use Mutt with, just enable it. Most email providers, +even free ones such as GMail, use IMAP these days, for it is the most convenient +way to store email that is accessed from multiple clients at the same time +and/or different locations. Because IMAP keeps all mail at the server, Mutt +just downloads the messages that you want to view. </p> -</body> -</section> -</chapter> - -<chapter> -<title>Procmail</title> -<section> -<body> - <p> -Procmail is the processor that filters the mail that is forwarded to it by -fetchmail. It also acts as the MDA to deliver mail to your mailboxes where mutt -(your e-mail client) can read it. +Often you happen to jump through a couple of messages a couple of times shortly +after each other, which would require to download the same message over and +over again. Since this simply is a waste, Mutt uses a so-called header cache +(hcache) to keep the most important bits of messages that it needs. This +hcache is backed by a db-library, of which four flavours exist: <c>gdbm</c>, +<c>berkdb</c>, <c>qdbm</c> and <c>tokyocabinet</c>. If you don't have any +preference yourself, pick gdbm or berkdb. Most likely you will have both +already installed on your system. Enabling the USE-flags for more than one +hcache backend will make Mutt choose one it likes best. It will always use +at most one. </p> <p> -To use procmail you need to create a <path>.procmailrc</path> file in your home -directory. For our quickstart purposes we will use a very simple -<path>.procmailrc</path> that will filter mail from three gentoo mailing lists -into these mailboxes:<e>gentoo-dev, gentoo-user</e> and <e>gentoo-announce</e> +While IMAP is important for reading mail, sending mail requires a mail server. +Mutt can talk to a mail server that exists on the local system, but often that's +not the case, or simply not a good solution for e.g. laptop users that often +travel around. Mutt comes with SMTP support which gets enabled by the <c>smtp</c> +USE-flag. Again, enabling it if you're not sure doesn't harm. Mutt's SMTP +support allows you just to send mail over a mail server of your choice; usually +the one that you are given by your email provider. </p> -<note> -The procmail filter rules are called recipes, and I have also included recipes -to filter out some spam. -</note> - -<pre caption="Sample .procmailrc"> -MAILDIR=$HOME/MuttMail ##you better make sure it exists -LOGFILE=$HOME/.procmaillog -LOGABSTRACT=no -#VERBOSE=on...is only used for debugging -VERBOSE=off -FORMAIL=/usr/bin/formail -NL=" -" -##recipe lines begin with :0 -##dont put comments on recipe lines -##disable a recipe with the false condition ! -##condition lines begin with * and regex is your friend -##conditions are anded and everything after * is fed straight into egrep -##one action line follows the conditions, in this case it is a mailbox name - -#catch duplicates using formail -:0 Whc: .msgid.lock -| $FORMAIL -D 16384 .msgid.cache - -:0 a -$MAILDIR/duplicates - -#people we always allow mail from -:0 -* ^From:.*(craig\@hotmail|renee\@local.com) -$MAILDIR/friends - -#now flush some spam out -:0 -* ^Subject:.*(credit|cash|money|debt|sex|sale|loan) -$MAILDIR/spam - -#no more html messages -:0 -* ^Content-Type:.*html -$MAILDIR/junk - -#now put my mail lists into mailboxes -:0 -* ^List-Id:.*gentoo-user -gentoo-user - -:0 -* ^List-Id:.*gentoo-dev -gentoo-dev - -:0 -* ^List-Id:.*gentoo-announce -gentoo-announce - -#catch any other gentoo mail -:0 -* ^From:.*gentoo.org -gentoo - -:0 -* ^From:.*@freshmeat\.net -freshmeat - -################################ -# Last rule: mail that gets # -# this far goes in default box # -################################ -:0 -* .* -default - -# End of file -</pre> - -<note> -It is only required to make the MAILDIR <path>$HOME/MuttMail</path> as Procmail -will create all the mailbox files as needed in this directory using the names -on the action lines. For some useful links visit -<uri>http://www.procmail.org/</uri> -</note> - <p> -You can now test <path>.procmailrc</path> by re-running the fetchmail command -we tested in the first step. Remember the -k option to keep all mail on the -remote server so we have it if we need to rerun it. +Both IMAP and SMTP mostly go over encrypted channels these days, hence if you +enabled any of both, it is wise to also enable either of the <c>ssl</c> or +<c>gnutls</c> USE-flags. Both just add the secure variants (imaps and smtps) to +Mutt's list of supported protocols using either OpenSSL's or GNUTLS' +implementation. If you don't have a strong preference for either, just go for +<c>ssl</c>. Most likely this is in your global USE already anyway. </p> - -<pre caption="Procmail test #1"> -$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> -</pre> - <p> -Now that fetchmail and procmail have run, go to <path>$HOME/MuttMail</path> and -read your messages with <c>less</c> or your file manager. +Last but not least, there is the <c>sidebar</c> USE-flag. It enables an +extension to Mutt that can show a navigation pane of available mailboxes on the +left hand side of the screen. While this is not a recommended feature for +absolute newcomers (it is nowhere mentioned in any official docs, since it +simply isn't official), more experienced users might like its functionality. +Luckily, just enabling the USE-flag doesn't make it visible at all, meaning you +don't even notice it's enabled. </p> </body> @@ -261,244 +130,184 @@ </chapter> <chapter> -<title>Mutt e-mail client</title> +<title>Configuring Mutt</title> <section> <body> <p> -Mutt is used to read and compose e-mail. It is powerful and highly customizable -but also small and efficient. -</p> +After you emerged mutt with your USE-flags of choice, the only necessary step is +to create a <path>.muttrc</path> file in your home directory. Muttrc's are to +be found in many places on the web and in Mutt's documentation. In +<path>/usr/share/doc/mutt-<version>/samples</path> you can find some +muttrc samples that are from the official distribution. We discuss a very +minimal <path>.muttrc</path> for an IMAP based account with SMTP mail delivery +below. +</p> + +<pre caption="A .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 = "[email protected]" +alternates "[email protected]|[email protected]" +# 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://[email protected]/ +set spoolfile=imaps://[email protected]/ +set record=imaps://[email protected]/Sent +set postponed=imaps://[email protected]/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" -<p> -Mutt supports reading and writing of four different mailbox formats: mbox, -MMDF, MH and Maildir. The mailbox type is autodetected. In our case we are -using the mbox format, where all messages of a mailbox are stored in a single -file. -</p> - -<p> -Mutt also has the ability to work with folders located on a remote IMAP server. -See IMAP Support in section 4.11 of the Mutt manual and the Mutt web site -<uri>http://www.mutt.org/</uri> -</p> - -<p> -When you emerged mutt in the first step it installed a configuration file in -<path>/etc/mutt/Muttrc</path>. You also need to create a <path>.muttrc</path> -file in your home directory. -</p> - -<pre caption="Sample .muttrc"> -<comment>(Be sure to read the fine Mutt manual in /usr/share/doc/mutt*) -(Any settings here override the system settings in /etc/mutt/Muttrc)</comment> - -# <i>cp /etc/mutt/Muttrc ~/.muttrc</i> -# <i>nano -w .muttrc</i> -set pager_context=1 -set pager_index_lines=6 #show a mini-index in pager -set menu_scroll -set pgp_verify_sig=no #dont show pgp in pager -set status_on_top #put status line at top -set sort=threads #sort by message threads in index - -set status_format=" %r %b %f %n Del %d Msgs %m %l %> (%P)" -set pager_format="%-10.10i %[!%a %b %d %R]" -set date_format="!%H:%M %a %d %b " -set index_format="%4C %Z %[%b%d] %-15.15F %s" -set folder_format="%2C %t %8s %d %N %f" - -#set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f [email protected]" - -#set from="default-mailaddress" #set to your from address -#set realname="myname" - -set record="$HOME/MuttMail/sent" #sent mail is saved here -set delete=yes #delete without prompting -set include=yes #quote msg in reply -set fast_reply=yes #no prompting on reply -set beep=no #no noise -set markers=no #no + on wrapped lines -set confirmappend=no #no prompt for save to =keep -set to_chars=" +TCF" #no L for mail_list - -set folder = $HOME/MuttMail -mailboxes =gentoo-user -mailboxes =gentoo-dev -mailboxes =gentoo-announce -mailboxes =gentoo -mailboxes =freshmeat -mailboxes =duplicates -mailboxes =default -mailboxes =friends -mailboxes =junk -mailboxes =spam -mailboxes =keep - -save-hook .* =keep #default mbox to (s)ave mail is =keep -subscribe gentoo-user gentoo-dev #subscribed to these lists - -bind pager h display-toggle-weed #toggle headers with h key - -# simulate the old url menu -macro index \cb |urlview\n 'call urlview to extract URLs out of a message' -macro pager \cb |urlview\n 'call urlview to extract URLs out of a message' - -#run fetchmail by hitting key of G -macro index G "!fetchmail -a -m 'procmail -d %T'\r" -macro pager G "!fetchmail -a -m 'procmail -d %T'\r" - -#use to edit .muttrc and then source it...no restart necessary -macro generic ,sm ":source $HOME/.muttrc\r" -macro generic \cj "!rxvt -bg wheat -e joe $HOME/.muttrc\r" - -# default list of header fields to weed out when displaying mail -#ignore them all and then unignore what you want to see -ignore * -unignore Date To From: Subject X-Mailer Organization User-Agent -hdr_order Date From To Subject X-Mailer User-Agent Organization - -##your Mutt has to have some colors -##these are for four levels of quoted text -##they override the system settings in /etc/mutt/Muttrc - -#color quoted green default -color quoted1 magenta blue -#color quoted2 yellow default -#color quoted3 red default -#color signature cyan cyan - - -#this color setup is copied from /etc/mutt/Muttrc.color -#comment it out if you want the default colors in /etc/mutt/Muttrc -# Je vois la vie en rose :-) -color hdrdefault brightcyan blue -color header brightwhite blue "^from:" -color header brightwhite blue "^subject:" - -color quoted brightgreen blue -color signature brightwhite blue - -color indicator blue green - -color error red black -mono error bold -color status black cyan -mono status bold -color tree yellow blue - -color tilde brightmagenta blue -color body brightwhite blue "[-a-z_0-9.]+@[-a-z_0-9.]+" -mono body bold "[-a-z_0-9.]+@[-a-z_0-9.]+" -color body brightyellow black "^Good signature" -mono body bold "^Good signature" -color body brightwhite red "^Bad signature from.*" -mono body bold "^Bad signature from.*" -color normal white blue -color message green black -color attachment brightgreen blue +# mailing lists we are on (these are regexps!) +subscribe "gentoo-.*@gentoo\\.org" -# End of file...but it can go on and on and on....:) +# SMTP mailing configuration (for sending mail) +set smtp_url=smtp://mail.server/ </pre> -<p> -For the record, this is just a sample <path>.muttrc</path>. There are many more -options that you can configure, such as integration with GPG. Have a look at -<uri>http://www.dotfiles.com/index.php?app_id=27</uri> for more examples and -help. -</p> - -<p> -You are now ready to test your <path>.muttrc</path>. -</p> - -<pre caption="Testing .muttrc"> -$ <i>mutt -y</i> -</pre> - -<p> -This should open Mutt with a menu showing the Mutt mailboxes that you created -in Test 2 when you ran the fetchmail command. -</p> - -<p> -Type the ? for help in navigating the Mutt Mailboxes. -</p> - -</body> -</section> -</chapter> - -<chapter> -<title>SMTP</title> -<section> -<body> - -<p> -The final step is setting up nbsmtp the 'No-Brainer SMTP' used to send mail to -your SMTP server. This setup is the easiest of all, as it only requires adding -an entry in your <path>.muttrc</path> file. -</p> - -<p> -domain: The domain you want nbsmtp to say it belongs to. This will almost -invariably be the same as the domain in your e-mail address. -</p> +<note> +It is good practice to review all settings from the example above. There are +many more, and some preferences may actually not match yours. Keep that in mind +when you feel that Mutt at first doesn't really work the way you like. +</note> <p> -from@addr: This is the address you want nbsmtp to say the message is from. Note -that this can be different than the "From:" line in your MUA. +The example <path>.muttrc</path> above sets up an IMAP account, uses an SMTP +server to send mail, stores its cache in <path>/var/tmp/.mutt</path>, reads the +known address aliases (think of it as an address book) from +<path>~/.aliases</path> and appends the signature from <path>~/.signature</path> +when composing new mail. For some IMAP servers it may be necessary to change the +spool, record and postponed directories, as the folders <path>Sent</path> and +<path>Drafts</path> may be under a folder called <path>INBOX</path>. Simply +trying this out with Mutt is the simplest way to figure this out. </p> <p> -host: This is the smtp server you are sending to. +Once your <path>.muttrc</path> is setup, you are ready to launch Mutt by just +running <c>mutt</c>. 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. </p> -<pre caption="Adding SMTP support"> -$ <i>nano -w .muttrc</i> -set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f [email protected]" -</pre> - <p> -You are now ready to send a message. So in the Mutt pager or index hit the -<c>m</c> key to compose a test message to send to your e-mail address. Mutt -will use the value of the EDITOR or VISUAL for the composition editor unless -you set <c>editor=</c> in the <path>.muttrc</path>. When you are done composing -hit <c>y</c> to send your message. If there are no errors you will see 'sending -mail' followed by 'Mail sent.' +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 <c>m</c> (for message) to start composing a new message, <c>q</c> for quit, +<c>r</c> for reply, <c>s</c> for save and <c>p</c> for print. </p> <p> -Remember in <path>.muttrc</path> we have set where to save sent mail with -<c>set record="$HOME/MuttMail/sent"</c> +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 +<path>~/.mailcap</path> file to put items in there for <c>copiousoutput</c> that +Mutt can display inline. </p> <p> -Now to complete the test, run fetchmail again to get all your mail and verify -you have received the message you sent to your e-mail address. When you find -your test message, hit the <c>h</c> key to toggle a view of all the headers and -see the complete mail transfer path. +In the example <path>.muttrc</path> above <c>auto_view</c> is enabled for +<c>application/msword</c> and <c>application/pdf</c> files. These two show +the extreme usefulness of this capability, because it means meeting notes sent +as doc file now are perfectly fine readable without having to save the +attachment and open it in OpenOffice. Instead the text just shows up in the +message reader, that is, if you have a matching entry in your +<path>~/.mailcap</path> file. </p> -<note> -There is one more program you probably want to add called urlview. This -extracts the urls in message texts and sends them to your browser. -</note> - -<pre caption="Getting urlview"> -# <i>emerge urlview</i> +<pre caption="Example .mailcap file"> +application/msword; antiword '%s'; copiousoutput; description=Word Document; +nametemplate=%s.doc +application/pdf; pdftotext '%s' -; copiousoutput; description=PDF Document; +nametemplate=%s.pdf </pre> <p> -Then create <path>~/.urlview</path> by copying the configuration file from -<path>/usr/share/doc/urlview*/</path> and setting your browser command. -</p> - -<p> -You now have a powerful and highly customizable mail system. To take advantage -of its flexibility, read all the manuals and docs and find the many user -configuration files available on the web: search for <path>procmailrc</path> and -<path>muttrc</path>. +The above <path>.mailcap</path> example tells mutt what to do to "view" +<c>msword</c> and <c>pdf</c> files. For the former it should run a program +called <c>antiword</c> (emerge <c>app-text/antiword</c>), for the latter the +program <c>pdftotext</c> (emerge <c>app-text/poppler</c>). You can go wild with +these to for example display rendered HTML (give <c>app-text/vilistextum</c> 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 <path>.mailcap</path>, and +tell Mutt to try to view it inline using the <c>auto_view</c> directive. </p> </body> @@ -506,86 +315,21 @@ </chapter> <chapter> -<title>Authenticated SMTP</title> +<title>Conclusions</title> <section> -<title>Using nbSMTP</title> <body> <p> -If you need to pass a username and password to your SMTP server, you can edit -the <c>set sendmail</c> command in your <path>.muttrc</path> to include <c>-U -<username> -P <password></c>, like this: -</p> - -<pre caption="Setting username and password for SMTP"> -set sendmail="/usr/bin/nbsmtp -U <i>username</i> -P <i>password</i> -d isp.net -h smtp.isp.net -f [email protected]" -</pre> - -<p> -If you do not want this information to be present in your <path>.muttrc</path> -file, you can also create a <path>.nbsmtprc</path> file in which you include all -information: -</p> - -<pre caption="~/.nbsmtprc example"> -auth_user = <i>username</i> -auth_pass = <i>password</i> -</pre> - -</body> -</section> -<section> -<title>Alternative: Using msmtp</title> -<body> - -<p> -<c>msmtp</c> is a simple alternative to <c>nbsmtp</c> with similar -possibilities. -</p> - -<pre caption="Installing msmtp"> -# <i>emerge msmtp</i> -</pre> - -<p> -Now login as a normal user and configure msmtp by creating a -<path>~/.msmtprc</path> file, filling in your SMTP server's information. -Remember to set the permissions to a secure value! -</p> - -<pre caption="Configuring msmtp"> -$ <i>nano -w .msmtprc</i> -account default -host <i>smtp.your_provider.net</i> -from <i>[email protected]</i> -<comment>#see man page for more auth options</comment> -auth login -user <i>your_username</i> -password <i>your_password</i> -<comment>#If your SMTP Server supports TLS encryption, uncomment the next line -#tls</comment> -</pre> - -<p> -Now set the permissions of the file to a secure value: -</p> - -<pre caption="Setting the permissions for the configuration file"> -$ <i>chmod 600 .msmtprc</i> -</pre> - -<p> -Finally, edit or add the following line to <path>.muttrc</path> -</p> - -<pre caption="Using msmtp with Mutt"> -$ <i>nano -w .muttrc</i> -set sendmail="/usr/bin/msmtp" -</pre> - -<p> -Fire up <c>mutt</c> and send yourself a test email to see if it worked! See -the msmtp man page for more options and another example. +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 <c>mutt -v</c> 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! </p> </body>
