/[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.9 Revision 1.10
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.9 2004/06/25 05:43:36 dertobi123 Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v 1.10 2004/06/28 10:40:52 neysx Exp $ -->
3
4 3
5<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
6<guide link="/doc/en/guide-to-mutt.xml"> 5<guide link="/doc/en/guide-to-mutt.xml">
7<title>QuickStart Guide to Mutt E-Mail</title> 6<title>QuickStart Guide to Mutt E-Mail</title>
7<author title="Author">
8<author title="Author"><mail link="mikpolniak@adelphia.net">Mike Polniak</mail></author> 8 <mail link="mikpolniak@adelphia.net">Mike Polniak</mail>
9<author title="Editor"><mail link="antifa@gentoo.org">Ken Nowack</mail></author> 9</author>
10<author title="Editor">
11 <mail link="antifa@gentoo.org">Ken Nowack</mail>
12</author>
10 13
11<abstract>This guide shows you how to begin using the powerful command line tools for e-mail: fetchmail, procmail, mutt, and nbsmtp.</abstract> 14<abstract>
15This guide shows you how to begin using the powerful command line tools for
16e-mail: fetchmail, procmail, mutt, and nbsmtp.
17</abstract>
12 18
13<license/> 19<license/>
14 20
15<version>1.1</version> 21<version>1.1</version>
16<date>Jun 24, 2004</date> 22<date>June 24, 2004</date>
17 23
18<chapter> 24<chapter>
19<title>Introduction to E-Mail</title> 25<title>Introduction to E-Mail</title>
20<section> 26<section>
21<body> 27<body>
22 28
23<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 29<p>
30If you're not a fan of e-mail clients with fancy graphical user interfaces, or
31if you would just like to experiment with other mail clients before deciding
24deciding which is best for you, here is the easy way to begin using these powerful command line tools:</p> 32which is best for you, here is the easy way to begin using these powerful
33command line tools:
34</p>
25 35
36<p>
26<p><b>fetchmail->procmail->mutt->smtp</b></p> 37<b>fetchmail->procmail->mutt->smtp</b>
38</p>
27 39
28<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 40<p>
41These programs are not only powerful and highly customizable but also small and
42efficient. Once you are up and running with this e-mail system you will be
29be amazed at what you can do with it.</p> 43amazed at what you can do with it.
44</p>
30 45
31<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 46<p>
47Because this is a quick start guide, we will eliminate the Mail Transfer Agent
48(MTA) such as sendmail, postfix or exim. This means no complex MTA
32configuration. It also eliminates using port 25 for mail service.</p> 49configuration. It also eliminates using port 25 for mail service.
50</p>
33 51
34<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 52<p>
53We can do this because fetchmail can force the mail it retrieves directly to a
54Mail Delivery Agent (MDA) rather than forwarding to port 25. And we don't need
35need to use a complex MTA for plain old outgoing mail delivery.</p> 55to use a complex MTA for plain old outgoing mail delivery.
56</p>
36 57
58<p>
37<p>These are the programs you will need to get your e-mail running. </p> 59These are the programs you will need to get your e-mail running.
60</p>
38 61
39<pre> 62<pre>
40# <i>emerge fetchmail procmail mutt nbsmtp</i> 63# <i>emerge fetchmail procmail mutt nbsmtp</i>
41</pre> 64</pre>
42 65
66<p>
43<p>Then just four quick steps to configure files and you will be up and running a brand new e-mail system.</p> 67Then just four quick steps to configure files and you will be up and running a
68brand new e-mail system.
69</p>
44 70
45 71
46<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> 72<impo>
73After each step you can run a test to make sure the setup is correct. This
74means you will have a complete working e-mail system when you are done.
75</impo>
47 76
48</body> 77</body>
49</section> 78</section>
50</chapter> 79</chapter>
51 80
52<chapter> 81<chapter>
53<title>Fetchmail</title> 82<title>Fetchmail</title>
54<section> 83<section>
55<body> 84<body>
56 85
57 86<p>
58<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 87Fetchmail fetches mail from remote servers and forwards it to your local
88machines delivery system. To use it you need to set up a
59<path>.fetchmailrc</path> file in your home directory like this example:</p> 89<path>.fetchmailrc</path> file in your home directory like this example:
90</p>
60 91
61<pre caption="Sample .fetchmailrc"> 92<pre caption="Sample .fetchmailrc">
62<i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i> 93<i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i>
63</pre> 94</pre>
64 95
65<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 96<p>
97Once you have created a <path>.fetchmailrc</path> file, you have to change the
98permissions on the file using the chmod command. The file must be readable only
66only by the file owner. Set the permissions with the following command:</p> 99by the file owner. Set the permissions with the following command:
100</p>
67 101
68<pre> 102<pre>
69# <i>chmod 600 .fetchmailrc</i> 103# <i>chmod 600 .fetchmailrc</i>
70</pre> 104</pre>
71 105
72<p>To see it 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.
73</p> 106<p>
107To see it in action use the verbose mode (-v). To fetch all messages use -a.
108And you must use the option -m to tell fetchmail to send the mail to procmail.
109</p>
74 110
75<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 111<warn>
76again.</warn> 112While testing, it's a good idea to tell fetchmail to keep (-k) the mail on the
113remote server in case something goes wrong and you need to fetch it again.
114</warn>
77 115
78 116<p>
79<p>Run it now to see fetchmail in action!</p> 117Run it now to see fetchmail in action!
118</p>
80 119
81<pre caption="Fetchmail test #1"> 120<pre caption="Fetchmail test #1">
82# <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> 121# <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i>
83</pre> 122</pre>
84 123
85<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 124<p>
125Once you have a working mail system you can set this as a cron job or put it in
126a monitor like gkrellm. Fetchmail can also run in a daemon mode for which you
86you specify a polling interval in seconds.</p> 127specify a polling interval in seconds.
128</p>
87 129
88</body> 130</body>
89</section> 131</section>
90</chapter> 132</chapter>
91 133
92<chapter> 134<chapter>
93<title>Procmail</title> 135<title>Procmail</title>
94<section> 136<section>
95<body> 137<body>
96 138
97<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 139<p>
140Procmail is the processor that filters the mail that is forwarded to it by
141fetchmail. It also acts as the MDA to deliver mail to your mailboxes where mutt
98mutt (your e-mail client) can read it.</p> 142(your e-mail client) can read it.
143</p>
99 144
100<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
101<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>
102</p> 145<p>
146To use procmail you need to create a <path>.procmailrc</path> file in your home
147directory. For our quickstart purposes we will use a very simple
148<path>.procmailrc</path> that will filter mail from three gentoo mailing lists
149into these mailboxes:<e>gentoo-dev, gentoo-user</e> and <e>gentoo-announce</e>
150</p>
103 151
152<note>
104<note>The procmail filter rules are called recipies and i have also included recipies to filter out some spam.</note> 153The procmail filter rules are called recipies and i have also included recipies
154to filter out some spam.
155</note>
105 156
106<pre caption="Sample .procmailrc"> 157<pre caption="Sample .procmailrc">
107MAILDIR=$HOME/MuttMail ##you better make sure it exists 158MAILDIR=$HOME/MuttMail ##you better make sure it exists
108LOGFILE=$HOME/.procmaillog 159LOGFILE=$HOME/.procmaillog
109LOGABSTRACT=no 160LOGABSTRACT=no
172default 223default
173 224
174# End of file 225# End of file
175</pre> 226</pre>
176 227
177<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 228<note>
178the action lines. For some useful links visit <uri>http://www.procmail.org/</uri> </note> 229It is only required to make the MAILDIR <path>$HOME/MuttMail</path> as Procmail
230will create all the mailbox files as needed in this directory using the names
231on the action lines. For some useful links visit
232<uri>http://www.procmail.org/</uri>
233</note>
179 234
180<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 235<p>
236You can now test <path>.procmailrc</path> by re-running the fetchmail command
237we tested in the first step. Remember the -k option to keep all mail on the
181server so we have it if we need to rerun it.</p> 238remote server so we have it if we need to rerun it.
239</p>
182 240
183 241
184 <pre caption="Procmail test #1"> 242<pre caption="Procmail test #1">
185# <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> 243# <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i>
186</pre> 244</pre>
187 245
188<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. 246<p>
247Now that fetchmail and procmail have run, go to <path>$HOME/MuttMail</path> and
248read your messages with <c>less</c> or your file manager.
189</p> 249</p>
190 250
191</body> 251</body>
192</section> 252</section>
193</chapter> 253</chapter>
195<chapter> 255<chapter>
196<title>Mutt e-mail client</title> 256<title>Mutt e-mail client</title>
197<section> 257<section>
198<body> 258<body>
199 259
260<p>
200<p>Mutt is used to read and compose e-mail. It is powerful and highly customizable but also small and efficient.</p> 261Mutt is used to read and compose e-mail. It is powerful and highly customizable but also small and efficient.
262</p>
201 263
202<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 264<p>
265Mutt supports reading and writing of four different mailbox formats: mbox,
266MMDF, MH and Maildir. The mailbox type is autodetected. In our case we are
203using the mbox format, where all messages of a mailbox are stored in a single file.</p> 267using the mbox format, where all messages of a mailbox are stored in a single
268file.
269</p>
204 270
205<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 271<p>
272Mutt also has the ability to work with folders located on a remote IMAP server.
273See IMAP Support in section 4.11 of the Mutt manual and the Mutt web site
206site <uri>http://www.mutt.org/</uri></p> 274<uri>http://www.mutt.org/</uri>
275</p>
207 276
208<p>When you emerged mutt in the first step it installed a configurationfile in <path>/etc/mutt/Muttrc</path>. You also need to create a <path>.muttrc</path> file in your 277<p>
209home directory.</p> 278When you emerged mutt in the first step it installed a configurationfile in
279<path>/etc/mutt/Muttrc</path>. You also need to create a <path>.muttrc</path>
280file in your home directory.
281</p>
210 282
211<pre caption="Sample .muttrc"> 283<pre caption="Sample .muttrc">
212<codenote>Be sure to read the fine Mutt manual in /usr/share/doc/mutt*</codenote> 284<codenote>Be sure to read the fine Mutt manual in /usr/share/doc/mutt*</codenote>
213<codenote>Any settings here override the system settings in /etc/mutt/Muttrc</codenote> 285<codenote>Any settings here override the system settings in /etc/mutt/Muttrc</codenote>
214 286
319color attachment brightgreen blue 391color attachment brightgreen blue
320 392
321# End of file...but it can go on and on and on....:) 393# End of file...but it can go on and on and on....:)
322</pre> 394</pre>
323 395
324 396<p>
325<p>For the record, this is just a sample <path>.muttrc</path>. There are many more options that you can configure, 397For the record, this is just a sample <path>.muttrc</path>. There are many more
326gpg settings for instance. Have a look at <uri>http://www.dotfiles.com/index.php3?app_id=27</uri> for more examples and help.</p> 398options that you can configure, gpg settings for instance. Have a look at
399<uri>http://www.dotfiles.com/index.php3?app_id=27</uri> for more examples and
400help.
401</p>
327 402
403<p>
328<p>You are now ready to test your <path>.muttrc</path> </p> 404You are now ready to test your <path>.muttrc</path>
405</p>
329 406
330<pre caption="Testing .muttrc"> 407<pre caption="Testing .muttrc">
331# <i>mutt -y</i> 408# <i>mutt -y</i>
332</pre> 409</pre>
333 410
334<p>This should open Mutt with a menu showing the Mutt mailboxes that you created in Test 2 when you ran the fetchmail command.
335</p> 411<p>
412This should open Mutt with a menu showing the Mutt mailboxes that you created
413in Test 2 when you ran the fetchmail command.
414</p>
336 415
416<p>
337<p>Type the ? for help in navigating the Mutt Mailboxes.</p> 417Type the ? for help in navigating the Mutt Mailboxes.
418</p>
338 419
339</body> 420</body>
340</section> 421</section>
341</chapter> 422</chapter>
342 423
343<chapter> 424<chapter>
344<title>SMTP</title> 425<title>SMTP</title>
345<section> 426<section>
346<body> 427<body>
347 428
348<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 429<p>
430The final step is setting up nbsmtp the 'No-Brainer SMTP' used to send mail to
431your SMTP server. This setup is the easiest of all, as it only requires adding
349adding an entry in your <path>.muttrc</path> file.</p> 432an entry in your <path>.muttrc</path> file.
433</p>
350 434
351<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.
352</p> 435<p>
436domain: The domain you want nbsmtp to say it belongs to. This will almost
437invariably be the same as the domain in your e-mail address.
438</p>
353 439
354<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.
355</p> 440<p>
441from@addr: This is the address you want nbsmtp to say the message is from. Note
442that this can be different than the "From:" line in your MUA.
443</p>
356 444
445<p>
357<p>host: This is the smtp server you are sending to.</p> 446host: This is the smtp server you are sending to.
447</p>
358 448
359<pre caption="Adding smtp support"> 449<pre caption="Adding smtp support">
360# <i>nano -w .muttrc</i> 450# <i>nano -w .muttrc</i>
361set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f urname@isp.net" 451set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f urname@isp.net"
362</pre> 452</pre>
363 453
364<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
365use 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
366message. If there are no errors you will see 'sending mail' followed by 'New mail in =sent'
367</p> 454<p>
455You are now ready to send a message. So in the Mutt pager or index hit the
456<c>m</c> key to compose a test message to send to your e-mail address. Mutt
457will use the value of the EDITOR or VISUAL for the composition editor unless
458you set <c>editor=</c> in the <path>.muttrc</path>. When you are done composing
459hit <c>y</c> to send your message. If there are no errors you will see 'sending
460mail' followed by 'New mail in =sent'
461</p>
368 462
463<p>
369<p>Remember in <path>.muttrc</path> we have set where to save sent mail with <c>set record="$HOME/MuttMail/sent"</c></p> 464Remember in <path>.muttrc</path> we have set where to save sent mail with
465<c>set record="$HOME/MuttMail/sent"</c>
466</p>
370 467
371<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 468<p>
469Now to complete the test, run fetchmail again to get all your mail and verify
470you have received the message you sent to your e-mail address. When you find
372your test message, hit the <c>h</c> key to toggle a view of all the headers and see the complete mail transfer path.</p> 471your test message, hit the <c>h</c> key to toggle a view of all the headers and
472see the complete mail transfer path.
473</p>
373 474
374<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. 475<note>
476There is one more program you probably want to add called urlview. This
477extracts the urls in message texts and sends them to your browser.
375</note> 478</note>
376 479
377<pre> 480<pre>
378# <i>emerge urlview</i> 481# <i>emerge urlview</i>
379</pre> 482</pre>
380 483
381<p>Then create <path>~/.urlview</path> by copying the configuration file from <path>/usr/share/doc/urlview*/</path> and setting your browser command.
382</p> 484<p>
485Then create <path>~/.urlview</path> by copying the configuration file from
486<path>/usr/share/doc/urlview*/</path> and setting your browser command.
487</p>
383 488
384<p>You now have a powerful and highly customizable mail system. So read all the manuals and docs and find the many user configuration files available on the 489<p>
490You now have a powerful and highly customizable mail system. So read all the
491manuals and docs and find the many user configuration files available on the
385web with 'google' <path>procmailrc</path> and <path>muttrc</path>.</p> 492web with 'google' <path>procmailrc</path> and <path>muttrc</path>.
493</p>
386 494
387</body> 495</body>
388</section> 496</section>
389</chapter> 497</chapter>
390</guide> 498</guide>

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20