/[gentoo]/xml/htdocs/doc/en/guide-to-mutt.xml
Gentoo

Diff of /xml/htdocs/doc/en/guide-to-mutt.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.19 Revision 1.20
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v 1.19 2006/09/17 16:08:36 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v 1.20 2011/08/17 19:49:12 swift Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "http://www.gentoo.org/dtd/guide.dtd">
5 5
6<guide link="/doc/en/guide-to-mutt.xml"> 6<guide link="http://www.gentoo.org/doc/en/guide-to-mutt.xml">
7 7
8<title>QuickStart Guide to Mutt E-Mail</title> 8<title>QuickStart Guide to Mutt E-Mail</title>
9 9
10<author title="Author"> 10<author title="Author">
11 <mail link="mikpolniak@adelphia.net">Mike Polniak</mail> 11 <mail link="grobian@gentoo.org">Fabian Groffen</mail>
12</author> 12</author>
13<author title="Editor">
14 <mail link="antifa@gentoo.org">Ken Nowack</mail>
15</author>
16<author title="Contributor">
17 <mail link="hitch17@gmail.com">John Hitchings</mail>
18</author>
19 13
20<abstract> 14<abstract>
21This guide shows you how to begin using the powerful command line tools for 15This guide shows you how to begin using the powerful command line e-mail
22e-mail: fetchmail, procmail, mutt, nbsmtp, msmtp. 16client mutt.
23</abstract> 17</abstract>
24 18
25<!-- The content of this document is licensed under the CC-BY-SA license --> 19<!-- The content of this document is licensed under the CC-BY-SA license -->
26<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 20<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
27<license/> 21<license/>
28 22
29<version>1.7</version> 23<version>2</version>
30<date>2006-09-17</date> 24<date>2011-08-17</date>
31 25
32<chapter> 26<chapter>
33<title>Introduction to E-Mail</title> 27<title>The Mutt e-mail client</title>
34<section> 28<section>
35<body> 29<body>
36 30
37<p> 31<p>
38If you're not a fan of e-mail clients with fancy graphical user interfaces, or 32If you're not a fan of e-mail clients with fancy graphical user interfaces, or
39if you would just like to experiment with other mail clients before deciding 33you just like to be able to quickly read some mail over an SSH connection, the
40which is best for you, here is the easy way to begin using these powerful 34class of console-based mail clients might be for you.
41command line tools:
42</p>
43
44<p> 35</p>
45<b>fetchmail, procmail, mutt &amp; smtp</b> 36
46</p> 37<p>
47 38Mutt is one of the current console-based mail clients that's still under active
39development and has a vast crowd of active supporters (and users). It is
40powerful, highly customisable, small and efficient.
48<p> 41</p>
49These programs are not only powerful and highly customizable but also small and 42
50efficient. Once you are up and running with this e-mail system you will be
51amazed at what you can do with it.
52</p> 43<p>
53 44While Mutt was originally designed to read mail from the local mbox mail spool
45(e.g. <path>/var/spool/mail/</path>), nowadays it comes with full support for
46Maildir stored folders, remote fetching from POP3 servers and complete
47management of IMAP accounts. For a full description of what Mutt can do, please
48read the Mutt manual and Mutt website at <uri>http://www.mutt.org/</uri>.
54<p> 49</p>
55Because this is a quick start guide, we will eliminate the Mail Transfer Agent
56(MTA) such as sendmail, postfix or exim. This means no complex MTA
57configuration. It also eliminates using port 25 for mail service.
58</p>
59
60<p>
61We can do this because fetchmail can force the mail it retrieves directly to a
62Mail Delivery Agent (MDA) rather than forwarding to port 25. And we don't need
63to use a complex MTA for plain old outgoing mail delivery.
64</p>
65
66<p>
67These are the programs you will need to get your e-mail running.
68</p>
69
70<pre caption="Getting needed programs">
71# <i>emerge fetchmail nbsmtp procmail mutt</i>
72</pre>
73
74<p>
75Then just four quick steps to configure files and you will be up and running a
76brand new e-mail system.
77</p>
78
79<impo>
80After each step you can run a test to make sure the setup is correct. This
81means you will have a complete working e-mail system when you are done.
82</impo>
83 50
84</body> 51</body>
85</section> 52</section>
86</chapter> 53</chapter>
87 54
88<chapter> 55<chapter>
89<title>Fetchmail</title> 56<title>Acquiring Mutt</title>
90<section> 57<section>
91<body> 58<body>
92 59
93<p> 60<p>
94Fetchmail fetches mail from remote servers and forwards it to your local 61Starting your Mutt adventure simply requires you to emerge it.
95machines delivery system. To use it you need to set up a 62Unfortunately, Mutt has a lots of options, which enable or disable certain
96<path>.fetchmailrc</path> file in your home directory like this example: 63functionalities of Mutt. We now briefly discuss the most important USE-flags
64that you may want to enable based on your intended usage of Mutt. Please note
65that enabling most of them won't harm your Mutt, but may make it do more than an
66experienced Mutt user would like.
97</p> 67</p>
98 68
99<pre caption="Sample .fetchmailrc"> 69<pre caption="Mutt's USE-flags">
100<i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i> 70% <i>emerge -pv mutt</i>
71[ebuild N ] mail-client/mutt-1.5.21-r1 USE="gdbm gpg imap mbox nls nntp \
72 sidebar smime smtp ssl -berkdb -crypt -debug -doc -gnutls \
73 -idn -pop -qdbm -sasl -tokyocabinet"
101</pre> 74</pre>
102 75
103<p> 76<p>
104Once you have created a <path>.fetchmailrc</path> file, you have to change the 77First off, for newcomers, the <c>imap</c> USE-flag is most probably the most
105permissions on the file using the chmod command. The file must be readable only 78important one. Enabling it won't hurt anything, so if you're unsure what
106by the file owner. Set the permissions with the following command: 79account you're going to use Mutt with, just enable it. Most email providers,
107</p> 80even free ones such as GMail, use IMAP these days, for it is the most convenient
108 81way to store email that is accessed from multiple clients at the same time
109<pre caption="Changing Permissions"> 82and/or different locations. Because IMAP keeps all mail at the server, Mutt
110$ <i>chmod 600 .fetchmailrc</i> 83just downloads the messages that you want to view.
111</pre>
112
113<p> 84</p>
114To see fetchmail in action, use the verbose mode (-v). To fetch all messages 85
115use -a. And you must use the option -m to tell fetchmail to send the mail to
116procmail.
117</p> 86<p>
118 87Often you happen to jump through a couple of messages a couple of times shortly
119<warn> 88after each other, which would require to download the same message over and
120While testing, it's a good idea to tell fetchmail to keep (-k) the mail on the 89over again. Since this simply is a waste, Mutt uses a so-called header cache
121remote server in case something goes wrong and you need to fetch it again. 90(hcache) to keep the most important bits of messages that it needs. This
122</warn> 91hcache is backed by a db-library, of which four flavours exist: <c>gdbm</c>,
123 92<c>berkdb</c>, <c>qdbm</c> and <c>tokyocabinet</c>. If you don't have any
93preference yourself, pick gdbm or berkdb. Most likely you will have both
94already installed on your system. Enabling the USE-flags for more than one
95hcache backend will make Mutt choose one it likes best. It will always use
96at most one.
124<p> 97</p>
125Run it now to see fetchmail in action! 98
126</p> 99<p>
127 100While IMAP is important for reading mail, sending mail requires a mail server.
128<pre caption="Fetchmail test #1"> 101Mutt can talk to a mail server that exists on the local system, but often that's
129$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> 102not the case, or simply not a good solution for e.g. laptop users that often
130</pre> 103travel around. Mutt comes with SMTP support which gets enabled by the <c>smtp</c>
131 104USE-flag. Again, enabling it if you're not sure doesn't harm. Mutt's SMTP
105support allows you just to send mail over a mail server of your choice; usually
106the one that you are given by your email provider.
132<p> 107</p>
133Once you have a working mail system you can set this as a cron job or put it in 108
134a monitor like gkrellm. Fetchmail can also run in a daemon mode for which you 109<p>
135specify a polling interval in seconds. 110Both IMAP and SMTP mostly go over encrypted channels these days, hence if you
111enabled any of both, it is wise to also enable either of the <c>ssl</c> or
112<c>gnutls</c> USE-flags. Both just add the secure variants (imaps and smtps) to
113Mutt's list of supported protocols using either OpenSSL's or GNUTLS'
114implementation. If you don't have a strong preference for either, just go for
115<c>ssl</c>. Most likely this is in your global USE already anyway.
116</p>
117
118<p>
119Last but not least, there is the <c>sidebar</c> USE-flag. It enables an
120extension to Mutt that can show a navigation pane of available mailboxes on the
121left hand side of the screen. While this is not a recommended feature for
122absolute newcomers (it is nowhere mentioned in any official docs, since it
123simply isn't official), more experienced users might like its functionality.
124Luckily, just enabling the USE-flag doesn't make it visible at all, meaning you
125don't even notice it's enabled.
136</p> 126</p>
137 127
138</body> 128</body>
139</section> 129</section>
140</chapter> 130</chapter>
141 131
142<chapter> 132<chapter>
143<title>Procmail</title> 133<title>Configuring Mutt</title>
144<section> 134<section>
145<body> 135<body>
146 136
147<p> 137<p>
148Procmail is the processor that filters the mail that is forwarded to it by 138After you emerged mutt with your USE-flags of choice, the only necessary step is
149fetchmail. It also acts as the MDA to deliver mail to your mailboxes where mutt 139to create a <path>.muttrc</path> file in your home directory. Muttrc's are to
150(your e-mail client) can read it. 140be found in many places on the web and in Mutt's documentation. In
151</p> 141<path>/usr/share/doc/mutt-&lt;version&gt;/samples</path> you can find some
152 142muttrc samples that are from the official distribution. We discuss a very
143minimal <path>.muttrc</path> for an IMAP based account with SMTP mail delivery
144below.
153<p> 145</p>
154To use procmail you need to create a <path>.procmailrc</path> file in your home 146
155directory. For our quickstart purposes we will use a very simple 147<pre caption="A .muttrc example file">
156<path>.procmailrc</path> that will filter mail from three gentoo mailing lists 148# character set on messages that we send
157into these mailboxes:<e>gentoo-dev, gentoo-user</e> and <e>gentoo-announce</e> 149set send_charset="utf-8"
150# if there is no character set given on incoming messages, it is probably windows
151set assumed_charset="iso-8859-1"
152
153# make sure Vim knows mutt is a mail client and that we compose an UTF-8 encoded message
154set editor="vim -c 'set syntax=mail ft=mail enc=utf-8'"
155
156# just scroll one line instead of full page
157set menu_scroll=yes
158
159# we want to see some MIME types inline, see below this code listing for explanation
160auto_view application/msword
161auto_view application/pdf
162
163# make default search pattern to search in To, Cc and Subject
164set simple_search="~f %s | ~C %s | ~s %s"
165
166# threading preferences, sort by threads
167set sort=threads
168set strict_threads=yes
169
170# show spam score (from SpamAssassin only) when reading a message
171spam "X-Spam-Score: ([0-9\\.]+).*" "SA: %1"
172set pager_format = " %C - %[%H:%M] %.20v, %s%* %?H? [%H] ?"
173
174# do not show all headers, just a few
175ignore *
176unignore From To Cc Bcc Date Subject
177# and in this order
178unhdr_order *
179hdr_order From: To: Cc: Bcc: Date: Subject:
180
181# brighten up stuff with colours, for more colouring examples see:
182# http://aperiodic.net/phil/configs/mutt/colors
183color normal white black
184color hdrdefault green default
185color quoted green default
186color quoted1 yellow default
187color quoted2 red default
188color signature cyan default
189color indicator brightyellow red
190color error brightred default
191color status brightwhite blue
192color tree brightmagenta black
193color tilde blue default
194color attachment brightyellow default
195color markers brightred default
196color message white black
197color search brightwhite magenta
198color bold brightyellow default
199# if you don't like the black progress bar at the bottom of the screen,
200# comment out the following line
201color progress white black
202
203# personality settings
204set realname = "Andrew Dalziel"
205set from = "andy@mail.server"
206alternates "andrew@mail.server|andrew.dalziel@mail.server"
207# this file must exist, and contains your signature, comment it out if
208# you don't want a signature to be used
209set signature = ~/.signature
210
211# aliases (sort of address book)
212source ~/.aliases
213
214# IMAP connection settings
215set mail_check=60
216set imap_keepalive=300
217
218# IMAP account settings
219set folder=imaps://andy@imap.mail.server/
220set spoolfile=imaps://andy@imap.mail.server/
221set record=imaps://andy@imap.mail.server/Sent
222set postponed=imaps://andy@imap.mail.server/Drafts
223
224# use headercache for IMAP (make sure this is a directory for performance!)
225set header_cache=/var/tmp/.mutt
226
227# mailboxes we want to monitor for new mail
228mailboxes "="
229mailboxes "=Lists"
230
231# mailing lists we are on (these are regexps!)
232subscribe "gentoo-.*@gentoo\\.org"
233
234# SMTP mailing configuration (for sending mail)
235set smtp_url=smtp://mail.server/
158</p> 236</pre>
159 237
160<note> 238<note>
161The procmail filter rules are called recipes, and I have also included recipes 239It is good practice to review all settings from the example above. There are
162to filter out some spam. 240many more, and some preferences may actually not match yours. Keep that in mind
241when you feel that Mutt at first doesn't really work the way you like.
163</note> 242</note>
164 243
244<p>
245The example <path>.muttrc</path> above sets up an IMAP account, uses an SMTP
246server to send mail, stores its cache in <path>/var/tmp/.mutt</path>, reads the
247known address aliases (think of it as an address book) from
248<path>~/.aliases</path> and appends the signature from <path>~/.signature</path>
249when composing new mail. For some IMAP servers it may be necessary to change the
250spool, record and postponed directories, as the folders <path>Sent</path> and
251<path>Drafts</path> may be under a folder called <path>INBOX</path>. Simply
252trying this out with Mutt is the simplest way to figure this out.
253</p>
254
255<p>
256Once your <path>.muttrc</path> is setup, you are ready to launch Mutt by just
257running <c>mutt</c>. If you entered a valid IMAP server url, Mutt will prompt
258you for your password and afterwards load all messages for you. Note that the
259first time entering your mailbox may take a while if you have quite some
260messages, since Mutt's header cache is still empty. If this succeeds you're in
261your IMAP mailbox ready to go.
262</p>
263
264<p>
265Navigation is intuitive, as is reading messages by just pressing the enter key
266or space bar. Mutt is quite Vim alike in that it uses key strokes to perform
267most of its actions. You best read Mutt's manual on the web to get yourself
268known with all existing functions (or press ? in Mutt) and what key they are
269bound to, or better, what key you like it to be bound to. Some essential keys
270are <c>m</c> (for message) to start composing a new message, <c>q</c> for quit,
271<c>r</c> for reply, <c>s</c> for save and <c>p</c> for print.
272</p>
273
274<p>
275One of the features that Mutt has that is still not in today's most savvy email
276clients is the ability to display attachments inline through some viewer. The
277auto_view directive in the .muttrc file tells Mutt which attachments (based on
278their MIME-type) it should view inline. To figure out how to do that, Mutt uses
279mailcap files to lookup how to display a certain MIME-type. Usually the system
280wide mailcap file isn't sufficient here, so you better start a
281<path>~/.mailcap</path> file to put items in there for <c>copiousoutput</c> that
282Mutt can display inline.
283</p>
284
285<p>
286In the example <path>.muttrc</path> above <c>auto_view</c> is enabled for
287<c>application/msword</c> and <c>application/pdf</c> files. These two show
288the extreme usefulness of this capability, because it means meeting notes sent
289as doc file now are perfectly fine readable without having to save the
290attachment and open it in OpenOffice. Instead the text just shows up in the
291message reader, that is, if you have a matching entry in your
292<path>~/.mailcap</path> file.
293</p>
294
165<pre caption="Sample .procmailrc"> 295<pre caption="Example .mailcap file">
166MAILDIR=$HOME/MuttMail ##you better make sure it exists 296application/msword; antiword '%s'; copiousoutput; description=Word Document;
167LOGFILE=$HOME/.procmaillog 297nametemplate=%s.doc
168LOGABSTRACT=no 298application/pdf; pdftotext '%s' -; copiousoutput; description=PDF Document;
169#VERBOSE=on...is only used for debugging 299nametemplate=%s.pdf
170VERBOSE=off
171FORMAIL=/usr/bin/formail
172NL="
173"
174##recipe lines begin with :0
175##dont put comments on recipe lines
176##disable a recipe with the false condition !
177##condition lines begin with * and regex is your friend
178##conditions are anded and everything after * is fed straight into egrep
179##one action line follows the conditions, in this case it is a mailbox name
180
181#catch duplicates using formail
182:0 Whc: .msgid.lock
183| $FORMAIL -D 16384 .msgid.cache
184
185:0 a
186$MAILDIR/duplicates
187
188#people we always allow mail from
189:0
190* ^From:.*(craig\@hotmail|renee\@local.com)
191$MAILDIR/friends
192
193#now flush some spam out
194:0
195* ^Subject:.*(credit|cash|money|debt|sex|sale|loan)
196$MAILDIR/spam
197
198#no more html messages
199:0
200* ^Content-Type:.*html
201$MAILDIR/junk
202
203#now put my mail lists into mailboxes
204:0
205* ^List-Id:.*gentoo-user
206gentoo-user
207
208:0
209* ^List-Id:.*gentoo-dev
210gentoo-dev
211
212:0
213* ^List-Id:.*gentoo-announce
214gentoo-announce
215
216#catch any other gentoo mail
217:0
218* ^From:.*gentoo.org
219gentoo
220
221:0
222* ^From:.*@freshmeat\.net
223freshmeat
224
225################################
226# Last rule: mail that gets #
227# this far goes in default box #
228################################
229:0
230* .*
231default
232
233# End of file
234</pre> 300</pre>
235 301
236<note>
237It is only required to make the MAILDIR <path>$HOME/MuttMail</path> as Procmail
238will create all the mailbox files as needed in this directory using the names
239on the action lines. For some useful links visit
240<uri>http://www.procmail.org/</uri>
241</note>
242
243<p>
244You can now test <path>.procmailrc</path> by re-running the fetchmail command
245we tested in the first step. Remember the -k option to keep all mail on the
246remote server so we have it if we need to rerun it.
247</p> 302<p>
248 303The above <path>.mailcap</path> example tells mutt what to do to "view"
249 304<c>msword</c> and <c>pdf</c> files. For the former it should run a program
250<pre caption="Procmail test #1"> 305called <c>antiword</c> (emerge <c>app-text/antiword</c>), for the latter the
251$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> 306program <c>pdftotext</c> (emerge <c>app-text/poppler</c>). You can go wild with
252</pre> 307these to for example display rendered HTML (give <c>app-text/vilistextum</c> a
253 308try), render vcards, or show ASCII representation of attached images. All you
254<p> 309need to do is define how to call the program in your <path>.mailcap</path>, and
255Now that fetchmail and procmail have run, go to <path>$HOME/MuttMail</path> and 310tell Mutt to try to view it inline using the <c>auto_view</c> directive.
256read your messages with <c>less</c> or your file manager.
257</p> 311</p>
258 312
259</body> 313</body>
260</section> 314</section>
261</chapter> 315</chapter>
262 316
263<chapter> 317<chapter>
264<title>Mutt e-mail client</title> 318<title>Conclusions</title>
265<section> 319<section>
266<body> 320<body>
267 321
268<p> 322<p>
269Mutt is used to read and compose e-mail. It is powerful and highly customizable 323Mutt is a very versatile console email client. If you like the concept, Mutt
270but also small and efficient. 324can be altered to behave in nearly any way through its configuration. Search
271</p> 325the web to find others explaining how they did "it", or find one of the many
272 326patches that exist to make Mutt do even more. Gentoo applies a couple of very
273<p> 327popular patches to Mutt, so make sure to check <c>mutt -v</c> if you want
274Mutt supports reading and writing of four different mailbox formats: mbox, 328something more to make sure it is not yet already at your disposal. While
275MMDF, MH and Maildir. The mailbox type is autodetected. In our case we are 329learning Mutt is not necessarily easy, once it is in your fingers, it can make
276using the mbox format, where all messages of a mailbox are stored in a single 330your mail experience much faster and efficient than with other clients.
277file. 331Searching for example is quite powerful if you know how to hit the right flags
278</p> 332and know which regular expression narrows your search down. Enjoy Mutting!
279
280<p>
281Mutt also has the ability to work with folders located on a remote IMAP server.
282See IMAP Support in section 4.11 of the Mutt manual and the Mutt web site
283<uri>http://www.mutt.org/</uri>
284</p>
285
286<p>
287When you emerged mutt in the first step it installed a configuration file in
288<path>/etc/mutt/Muttrc</path>. You also need to create a <path>.muttrc</path>
289file in your home directory.
290</p>
291
292<pre caption="Sample .muttrc">
293<comment>(Be sure to read the fine Mutt manual in /usr/share/doc/mutt*)
294(Any settings here override the system settings in /etc/mutt/Muttrc)</comment>
295
296# <i>cp /etc/mutt/Muttrc ~/.muttrc</i>
297# <i>nano -w .muttrc</i>
298set pager_context=1
299set pager_index_lines=6 #show a mini-index in pager
300set menu_scroll
301set pgp_verify_sig=no #dont show pgp in pager
302set status_on_top #put status line at top
303set sort=threads #sort by message threads in index
304
305set status_format=" %r %b %f %n Del %d Msgs %m %l %> (%P)"
306set pager_format="%-10.10i %[!%a %b %d %R]"
307set date_format="!%H:%M %a %d %b "
308set index_format="%4C %Z %[%b%d] %-15.15F %s"
309set folder_format="%2C %t %8s %d %N %f"
310
311#set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f yourname@isp.net"
312
313#set from="default-mailaddress" #set to your from address
314#set realname="myname"
315
316set record="$HOME/MuttMail/sent" #sent mail is saved here
317set delete=yes #delete without prompting
318set include=yes #quote msg in reply
319set fast_reply=yes #no prompting on reply
320set beep=no #no noise
321set markers=no #no + on wrapped lines
322set confirmappend=no #no prompt for save to =keep
323set to_chars=" +TCF" #no L for mail_list
324
325set folder = $HOME/MuttMail
326mailboxes =gentoo-user
327mailboxes =gentoo-dev
328mailboxes =gentoo-announce
329mailboxes =gentoo
330mailboxes =freshmeat
331mailboxes =duplicates
332mailboxes =default
333mailboxes =friends
334mailboxes =junk
335mailboxes =spam
336mailboxes =keep
337
338save-hook .* =keep #default mbox to (s)ave mail is =keep
339subscribe gentoo-user gentoo-dev #subscribed to these lists
340
341bind pager h display-toggle-weed #toggle headers with h key
342
343# simulate the old url menu
344macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
345macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'
346
347#run fetchmail by hitting key of G
348macro index G "!fetchmail -a -m 'procmail -d %T'\r"
349macro pager G "!fetchmail -a -m 'procmail -d %T'\r"
350
351#use to edit .muttrc and then source it...no restart necessary
352macro generic ,sm ":source $HOME/.muttrc\r"
353macro generic \cj "!rxvt -bg wheat -e joe $HOME/.muttrc\r"
354
355# default list of header fields to weed out when displaying mail
356#ignore them all and then unignore what you want to see
357ignore *
358unignore Date To From: Subject X-Mailer Organization User-Agent
359hdr_order Date From To Subject X-Mailer User-Agent Organization
360
361##your Mutt has to have some colors
362##these are for four levels of quoted text
363##they override the system settings in /etc/mutt/Muttrc
364
365#color quoted green default
366color quoted1 magenta blue
367#color quoted2 yellow default
368#color quoted3 red default
369#color signature cyan cyan
370
371
372#this color setup is copied from /etc/mutt/Muttrc.color
373#comment it out if you want the default colors in /etc/mutt/Muttrc
374# Je vois la vie en rose :-)
375color hdrdefault brightcyan blue
376color header brightwhite blue "^from:"
377color header brightwhite blue "^subject:"
378
379color quoted brightgreen blue
380color signature brightwhite blue
381
382color indicator blue green
383
384color error red black
385mono error bold
386color status black cyan
387mono status bold
388color tree yellow blue
389
390color tilde brightmagenta blue
391color body brightwhite blue "[-a-z_0-9.]+@[-a-z_0-9.]+"
392mono body bold "[-a-z_0-9.]+@[-a-z_0-9.]+"
393color body brightyellow black "^Good signature"
394mono body bold "^Good signature"
395color body brightwhite red "^Bad signature from.*"
396mono body bold "^Bad signature from.*"
397color normal white blue
398color message green black
399color attachment brightgreen blue
400
401# End of file...but it can go on and on and on....:)
402</pre>
403
404<p>
405For the record, this is just a sample <path>.muttrc</path>. There are many more
406options that you can configure, such as integration with GPG. Have a look at
407<uri>http://www.dotfiles.com/index.php?app_id=27</uri> for more examples and
408help.
409</p>
410
411<p>
412You are now ready to test your <path>.muttrc</path>.
413</p>
414
415<pre caption="Testing .muttrc">
416$ <i>mutt -y</i>
417</pre>
418
419<p>
420This should open Mutt with a menu showing the Mutt mailboxes that you created
421in Test 2 when you ran the fetchmail command.
422</p>
423
424<p>
425Type the ? for help in navigating the Mutt Mailboxes.
426</p>
427
428</body>
429</section>
430</chapter>
431
432<chapter>
433<title>SMTP</title>
434<section>
435<body>
436
437<p>
438The final step is setting up nbsmtp the 'No-Brainer SMTP' used to send mail to
439your SMTP server. This setup is the easiest of all, as it only requires adding
440an entry in your <path>.muttrc</path> file.
441</p>
442
443<p>
444domain: The domain you want nbsmtp to say it belongs to. This will almost
445invariably be the same as the domain in your e-mail address.
446</p>
447
448<p>
449from@addr: This is the address you want nbsmtp to say the message is from. Note
450that this can be different than the "From:" line in your MUA.
451</p>
452
453<p>
454host: This is the smtp server you are sending to.
455</p>
456
457<pre caption="Adding SMTP support">
458$ <i>nano -w .muttrc</i>
459set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f urname@isp.net"
460</pre>
461
462<p>
463You are now ready to send a message. So in the Mutt pager or index hit the
464<c>m</c> key to compose a test message to send to your e-mail address. Mutt
465will use the value of the EDITOR or VISUAL for the composition editor unless
466you set <c>editor=</c> in the <path>.muttrc</path>. When you are done composing
467hit <c>y</c> to send your message. If there are no errors you will see 'sending
468mail' followed by 'Mail sent.'
469</p>
470
471<p>
472Remember in <path>.muttrc</path> we have set where to save sent mail with
473<c>set record="$HOME/MuttMail/sent"</c>
474</p>
475
476<p>
477Now to complete the test, run fetchmail again to get all your mail and verify
478you have received the message you sent to your e-mail address. When you find
479your test message, hit the <c>h</c> key to toggle a view of all the headers and
480see the complete mail transfer path.
481</p>
482
483<note>
484There is one more program you probably want to add called urlview. This
485extracts the urls in message texts and sends them to your browser.
486</note>
487
488<pre caption="Getting urlview">
489# <i>emerge urlview</i>
490</pre>
491
492<p>
493Then create <path>~/.urlview</path> by copying the configuration file from
494<path>/usr/share/doc/urlview*/</path> and setting your browser command.
495</p>
496
497<p>
498You now have a powerful and highly customizable mail system. To take advantage
499of its flexibility, read all the manuals and docs and find the many user
500configuration files available on the web: search for <path>procmailrc</path> and
501<path>muttrc</path>.
502</p>
503
504</body>
505</section>
506</chapter>
507
508<chapter>
509<title>Authenticated SMTP</title>
510<section>
511<title>Using nbSMTP</title>
512<body>
513
514<p>
515If you need to pass a username and password to your SMTP server, you can edit
516the <c>set sendmail</c> command in your <path>.muttrc</path> to include <c>-U
517&lt;username&gt; -P &lt;password&gt;</c>, like this:
518</p>
519
520<pre caption="Setting username and password for SMTP">
521set sendmail="/usr/bin/nbsmtp -U <i>username</i> -P <i>password</i> -d isp.net -h smtp.isp.net -f urname@isp.net"
522</pre>
523
524<p>
525If you do not want this information to be present in your <path>.muttrc</path>
526file, you can also create a <path>.nbsmtprc</path> file in which you include all
527information:
528</p>
529
530<pre caption="~/.nbsmtprc example">
531auth_user = <i>username</i>
532auth_pass = <i>password</i>
533</pre>
534
535</body>
536</section>
537<section>
538<title>Alternative: Using msmtp</title>
539<body>
540
541<p>
542<c>msmtp</c> is a simple alternative to <c>nbsmtp</c> with similar
543possibilities.
544</p>
545
546<pre caption="Installing msmtp">
547# <i>emerge msmtp</i>
548</pre>
549
550<p>
551Now login as a normal user and configure msmtp by creating a
552<path>~/.msmtprc</path> file, filling in your SMTP server's information.
553Remember to set the permissions to a secure value!
554</p>
555
556<pre caption="Configuring msmtp">
557$ <i>nano -w .msmtprc</i>
558account default
559host <i>smtp.your_provider.net</i>
560from <i>your_username@provider1.net</i>
561<comment>#see man page for more auth options</comment>
562auth login
563user <i>your_username</i>
564password <i>your_password</i>
565<comment>#If your SMTP Server supports TLS encryption, uncomment the next line
566#tls</comment>
567</pre>
568
569<p>
570Now set the permissions of the file to a secure value:
571</p>
572
573<pre caption="Setting the permissions for the configuration file">
574$ <i>chmod 600 .msmtprc</i>
575</pre>
576
577<p>
578Finally, edit or add the following line to <path>.muttrc</path>
579</p>
580
581<pre caption="Using msmtp with Mutt">
582$ <i>nano -w .muttrc</i>
583set sendmail="/usr/bin/msmtp"
584</pre>
585
586<p>
587Fire up <c>mutt</c> and send yourself a test email to see if it worked! See
588the msmtp man page for more options and another example.
589</p> 333</p>
590 334
591</body> 335</body>
592</section> 336</section>
593</chapter> 337</chapter>

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20