/[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.17 Revision 1.18
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.17 2006/08/28 16:10:53 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-to-mutt.xml,v 1.18 2006/09/01 10:57:57 neysx Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5
5<guide link="/doc/en/guide-to-mutt.xml"> 6<guide link="/doc/en/guide-to-mutt.xml">
7
6<title>QuickStart Guide to Mutt E-Mail</title> 8<title>QuickStart Guide to Mutt E-Mail</title>
9
7<author title="Author"> 10<author title="Author">
8 <mail link="mikpolniak@adelphia.net">Mike Polniak</mail> 11 <mail link="mikpolniak@adelphia.net">Mike Polniak</mail>
9</author> 12</author>
10<author title="Editor"> 13<author title="Editor">
11 <mail link="antifa@gentoo.org">Ken Nowack</mail> 14 <mail link="antifa@gentoo.org">Ken Nowack</mail>
64These are the programs you will need to get your e-mail running. 67These are the programs you will need to get your e-mail running.
65</p> 68</p>
66 69
67<pre caption="Getting needed programs"> 70<pre caption="Getting needed programs">
68# <i>emerge fetchmail procmail mutt nbsmtp</i> 71# <i>emerge fetchmail procmail mutt nbsmtp</i>
69</pre> 72</pre>
70 73
71<p> 74<p>
72Then just four quick steps to configure files and you will be up and running a 75Then just four quick steps to configure files and you will be up and running a
73brand new e-mail system. 76brand new e-mail system.
74</p> 77</p>
75
76 78
77<impo> 79<impo>
78After each step you can run a test to make sure the setup is correct. This 80After each step you can run a test to make sure the setup is correct. This
79means you will have a complete working e-mail system when you are done. 81means you will have a complete working e-mail system when you are done.
80</impo> 82</impo>
82</body> 84</body>
83</section> 85</section>
84</chapter> 86</chapter>
85 87
86<chapter> 88<chapter>
87<title>Fetchmail</title> 89<title>Fetchmail</title>
88<section> 90<section>
89<body> 91<body>
90 92
91<p> 93<p>
92Fetchmail fetches mail from remote servers and forwards it to your local 94Fetchmail fetches mail from remote servers and forwards it to your local
93machines delivery system. To use it you need to set up a 95machines delivery system. To use it you need to set up a
94<path>.fetchmailrc</path> file in your home directory like this example: 96<path>.fetchmailrc</path> file in your home directory like this example:
95</p> 97</p>
96 98
97<pre caption="Sample .fetchmailrc"> 99<pre caption="Sample .fetchmailrc">
98<i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i> 100<i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i>
99</pre> 101</pre>
100 102
101<p> 103<p>
102Once you have created a <path>.fetchmailrc</path> file, you have to change the 104Once you have created a <path>.fetchmailrc</path> file, you have to change the
103permissions on the file using the chmod command. The file must be readable only 105permissions on the file using the chmod command. The file must be readable only
107<pre caption="Changing Permissions"> 109<pre caption="Changing Permissions">
108$ <i>chmod 600 .fetchmailrc</i> 110$ <i>chmod 600 .fetchmailrc</i>
109</pre> 111</pre>
110 112
111<p> 113<p>
112To see fetchmail in action, use the verbose mode (-v). To fetch all messages use -a. 114To see fetchmail in action, use the verbose mode (-v). To fetch all messages
113And you must use the option -m to tell fetchmail to send the mail to procmail. 115use -a. And you must use the option -m to tell fetchmail to send the mail to
116procmail.
114</p> 117</p>
115 118
116<warn> 119<warn>
117While testing, it's a good idea to tell fetchmail to keep (-k) the mail on the 120While testing, it's a good idea to tell fetchmail to keep (-k) the mail on the
118remote server in case something goes wrong and you need to fetch it again. 121remote server in case something goes wrong and you need to fetch it again.
119</warn> 122</warn>
120 123
121<p> 124<p>
122Run it now to see fetchmail in action! 125Run it now to see fetchmail in action!
123</p> 126</p>
124 127
125<pre caption="Fetchmail test #1"> 128<pre caption="Fetchmail test #1">
126$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> 129$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i>
127</pre> 130</pre>
128 131
129<p> 132<p>
130Once you have a working mail system you can set this as a cron job or put it in 133Once you have a working mail system you can set this as a cron job or put it in
131a monitor like gkrellm. Fetchmail can also run in a daemon mode for which you 134a monitor like gkrellm. Fetchmail can also run in a daemon mode for which you
136</section> 139</section>
137</chapter> 140</chapter>
138 141
139<chapter> 142<chapter>
140<title>Procmail</title> 143<title>Procmail</title>
141<section> 144<section>
142<body> 145<body>
143 146
144<p> 147<p>
145Procmail is the processor that filters the mail that is forwarded to it by 148Procmail is the processor that filters the mail that is forwarded to it by
146fetchmail. It also acts as the MDA to deliver mail to your mailboxes where mutt 149fetchmail. It also acts as the MDA to deliver mail to your mailboxes where mutt
147(your e-mail client) can read it. 150(your e-mail client) can read it.
148</p> 151</p>
149 152
150<p> 153<p>
151To use procmail you need to create a <path>.procmailrc</path> file in your home 154To use procmail you need to create a <path>.procmailrc</path> file in your home
152directory. For our quickstart purposes we will use a very simple 155directory. For our quickstart purposes we will use a very simple
153<path>.procmailrc</path> that will filter mail from three gentoo mailing lists 156<path>.procmailrc</path> that will filter mail from three gentoo mailing lists
154into these mailboxes:<e>gentoo-dev, gentoo-user</e> and <e>gentoo-announce</e> 157into these mailboxes:<e>gentoo-dev, gentoo-user</e> and <e>gentoo-announce</e>
155</p> 158</p>
156 159
157<note> 160<note>
181 184
182:0 a 185:0 a
183$MAILDIR/duplicates 186$MAILDIR/duplicates
184 187
185#people we always allow mail from 188#people we always allow mail from
186:0 189:0
187* ^From:.*(craig\@hotmail|renee\@local.com) 190* ^From:.*(craig\@hotmail|renee\@local.com)
188$MAILDIR/friends 191$MAILDIR/friends
189 192
190#now flush some spam out 193#now flush some spam out
191:0 194:0
192* ^Subject:.*(credit|cash|money|debt|sex|sale|loan) 195* ^Subject:.*(credit|cash|money|debt|sex|sale|loan)
193$MAILDIR/spam 196$MAILDIR/spam
194 197
195#no more html messages 198#no more html messages
196:0 199:0
197* ^Content-Type:.*html 200* ^Content-Type:.*html
198$MAILDIR/junk 201$MAILDIR/junk
199 202
200#now put my mail lists into mailboxes 203#now put my mail lists into mailboxes
201:0 204:0
202* ^List-Id:.*gentoo-user 205* ^List-Id:.*gentoo-user
203gentoo-user 206gentoo-user
204 207
205:0 208:0
206* ^List-Id:.*gentoo-dev 209* ^List-Id:.*gentoo-dev
207gentoo-dev 210gentoo-dev
208 211
209:0 212:0
210* ^List-Id:.*gentoo-announce 213* ^List-Id:.*gentoo-announce
211gentoo-announce 214gentoo-announce
212 215
213#catch any other gentoo mail 216#catch any other gentoo mail
214:0 217:0
215* ^From:.*gentoo.org 218* ^From:.*gentoo.org
216gentoo 219gentoo
217 220
218:0 221:0
219* ^From:.*@freshmeat\.net 222* ^From:.*@freshmeat\.net
220freshmeat 223freshmeat
221 224
222################################ 225################################
223# Last rule: mail that gets # 226# Last rule: mail that gets #
224# this far goes in default box # 227# this far goes in default box #
225################################ 228################################
226:0 229:0
227* .* 230* .*
228default 231default
229 232
230# End of file 233# End of file
231</pre> 234</pre>
243remote server so we have it if we need to rerun it. 246remote server so we have it if we need to rerun it.
244</p> 247</p>
245 248
246 249
247<pre caption="Procmail test #1"> 250<pre caption="Procmail test #1">
248$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> 251$ <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i>
249</pre> 252</pre>
250 253
251<p> 254<p>
252Now that fetchmail and procmail have run, go to <path>$HOME/MuttMail</path> and 255Now that fetchmail and procmail have run, go to <path>$HOME/MuttMail</path> and
253read your messages with <c>less</c> or your file manager. 256read your messages with <c>less</c> or your file manager.
261<title>Mutt e-mail client</title> 264<title>Mutt e-mail client</title>
262<section> 265<section>
263<body> 266<body>
264 267
265<p> 268<p>
266Mutt is used to read and compose e-mail. It is powerful and highly customizable but also small and efficient. 269Mutt is used to read and compose e-mail. It is powerful and highly customizable
270but also small and efficient.
267</p> 271</p>
268 272
269<p> 273<p>
270Mutt supports reading and writing of four different mailbox formats: mbox, 274Mutt supports reading and writing of four different mailbox formats: mbox,
271MMDF, MH and Maildir. The mailbox type is autodetected. In our case we are 275MMDF, MH and Maildir. The mailbox type is autodetected. In our case we are
284<path>/etc/mutt/Muttrc</path>. You also need to create a <path>.muttrc</path> 288<path>/etc/mutt/Muttrc</path>. You also need to create a <path>.muttrc</path>
285file in your home directory. 289file in your home directory.
286</p> 290</p>
287 291
288<pre caption="Sample .muttrc"> 292<pre caption="Sample .muttrc">
289<comment>(Be sure to read the fine Mutt manual in /usr/share/doc/mutt*)</comment> 293<comment>(Be sure to read the fine Mutt manual in /usr/share/doc/mutt*)
290<comment>(Any settings here override the system settings in /etc/mutt/Muttrc)</comment> 294(Any settings here override the system settings in /etc/mutt/Muttrc)</comment>
291 295
292# <i>cp /etc/mutt/Muttrc ~/.muttrc</i> 296# <i>cp /etc/mutt/Muttrc ~/.muttrc</i>
293# <i>nano -w .muttrc</i> 297# <i>nano -w .muttrc</i>
294set pager_context=1 298set pager_context=1
295set pager_index_lines=6 #show a mini-index in pager 299set pager_index_lines=6 #show a mini-index in pager
296set menu_scroll 300set menu_scroll
297set pgp_verify_sig=no #dont show pgp in pager 301set pgp_verify_sig=no #dont show pgp in pager
298set status_on_top #put status line at top 302set status_on_top #put status line at top
299set sort=threads #sort by message threads in index 303set sort=threads #sort by message threads in index
300 304
301set status_format=" %r %b %f %n Del %d Msgs %m %l %> (%P)" 305set status_format=" %r %b %f %n Del %d Msgs %m %l %> (%P)"
309#set from="default-mailaddress" #set to your from address 313#set from="default-mailaddress" #set to your from address
310#set realname="myname" 314#set realname="myname"
311 315
312set record="$HOME/MuttMail/sent" #sent mail is saved here 316set record="$HOME/MuttMail/sent" #sent mail is saved here
313set delete=yes #delete without prompting 317set delete=yes #delete without prompting
314set include=yes #quote msg in reply 318set include=yes #quote msg in reply
315set fast_reply=yes #no prompting on reply 319set fast_reply=yes #no prompting on reply
316set beep=no #no noise 320set beep=no #no noise
317set markers=no #no + on wrapped lines 321set markers=no #no + on wrapped lines
318set confirmappend=no #no prompt for save to =keep 322set confirmappend=no #no prompt for save to =keep
319set to_chars=" +TCF" #no L for mail_list 323set to_chars=" +TCF" #no L for mail_list
320 324
321set folder = $HOME/MuttMail 325set folder = $HOME/MuttMail
322mailboxes =gentoo-user 326mailboxes =gentoo-user
323mailboxes =gentoo-dev 327mailboxes =gentoo-dev
324mailboxes =gentoo-announce 328mailboxes =gentoo-announce
325mailboxes =gentoo 329mailboxes =gentoo
326mailboxes =freshmeat 330mailboxes =freshmeat
327mailboxes =duplicates 331mailboxes =duplicates
328mailboxes =default 332mailboxes =default
329mailboxes =friends 333mailboxes =friends
330mailboxes =junk 334mailboxes =junk
331mailboxes =spam 335mailboxes =spam
332mailboxes =keep 336mailboxes =keep
333 337
334save-hook .* =keep #default mbox to (s)ave mail is =keep 338save-hook .* =keep #default mbox to (s)ave mail is =keep
335subscribe gentoo-user gentoo-dev #subscribed to these lists 339subscribe gentoo-user gentoo-dev #subscribed to these lists
336 340
337bind pager h display-toggle-weed #toggle headers with h key 341bind pager h display-toggle-weed #toggle headers with h key
338 342
339# simulate the old url menu 343# simulate the old url menu
340macro index \cb |urlview\n 'call urlview to extract URLs out of a message' 344macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
341macro pager \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'
342 346
343#run fetchmail by hitting key of G 347#run fetchmail by hitting key of G
344macro index G "!fetchmail -a -m 'procmail -d %T'\r" 348macro index G "!fetchmail -a -m 'procmail -d %T'\r"
345macro pager G "!fetchmail -a -m 'procmail -d %T'\r" 349macro pager G "!fetchmail -a -m 'procmail -d %T'\r"
346 350
347#use to edit .muttrc and then source it...no restart necessary 351#use to edit .muttrc and then source it...no restart necessary
348macro generic ,sm ":source $HOME/.muttrc\r" 352macro generic ,sm ":source $HOME/.muttrc\r"
349macro generic \cj "!rxvt -bg wheat -e joe $HOME/.muttrc\r" 353macro generic \cj "!rxvt -bg wheat -e joe $HOME/.muttrc\r"
350 354
351# default list of header fields to weed out when displaying mail 355# default list of header fields to weed out when displaying mail
352#ignore them all and then unignore what you want to see 356#ignore them all and then unignore what you want to see
353ignore * 357ignore *
354unignore Date To From: Subject X-Mailer Organization User-Agent 358unignore Date To From: Subject X-Mailer Organization User-Agent
355hdr_order Date From To Subject X-Mailer User-Agent Organization 359hdr_order Date From To Subject X-Mailer User-Agent Organization
356 360
357##your Mutt has to have some colors 361##your Mutt has to have some colors
358##these are for four levels of quoted text 362##these are for four levels of quoted text
359##they override the system settings in /etc/mutt/Muttrc 363##they override the system settings in /etc/mutt/Muttrc
360 364
361#color quoted green default 365#color quoted green default
362color quoted1 magenta blue 366color quoted1 magenta blue
363#color quoted2 yellow default 367#color quoted2 yellow default
364#color quoted3 red default 368#color quoted3 red default
365#color signature cyan cyan 369#color signature cyan cyan
366 370
367 371
368#this color setup is copied from /etc/mutt/Muttrc.color 372#this color setup is copied from /etc/mutt/Muttrc.color
369#comment it out if you want the default colors in /etc/mutt/Muttrc 373#comment it out if you want the default colors in /etc/mutt/Muttrc
370# Je vois la vie en rose :-) 374# Je vois la vie en rose :-)
371color hdrdefault brightcyan blue 375color hdrdefault brightcyan blue
372color header brightwhite blue "^from:" 376color header brightwhite blue "^from:"
373color header brightwhite blue "^subject:" 377color header brightwhite blue "^subject:"
374 378
375color quoted brightgreen blue 379color quoted brightgreen blue
376color signature brightwhite blue 380color signature brightwhite blue
377 381
378color indicator blue green 382color indicator blue green
379 383
380color error red black 384color error red black
381mono error bold 385mono error bold
382color status black cyan 386color status black cyan
383mono status bold 387mono status bold
384color tree yellow blue 388color tree yellow blue
385 389
386color tilde brightmagenta blue 390color tilde brightmagenta blue
387color body brightwhite blue "[-a-z_0-9.]+@[-a-z_0-9.]+" 391color body brightwhite blue "[-a-z_0-9.]+@[-a-z_0-9.]+"
388mono body bold "[-a-z_0-9.]+@[-a-z_0-9.]+" 392mono body bold "[-a-z_0-9.]+@[-a-z_0-9.]+"
389color body brightyellow black "^Good signature" 393color body brightyellow black "^Good signature"
390mono body bold "^Good signature" 394mono body bold "^Good signature"
391color body brightwhite red "^Bad signature from.*" 395color body brightwhite red "^Bad signature from.*"
392mono body bold "^Bad signature from.*" 396mono body bold "^Bad signature from.*"
393color normal white blue 397color normal white blue
394color message green black 398color message green black
395color attachment brightgreen blue 399color attachment brightgreen blue
396 400
397# End of file...but it can go on and on and on....:) 401# End of file...but it can go on and on and on....:)
398</pre> 402</pre>
399 403
400<p> 404<p>
412$ <i>mutt -y</i> 416$ <i>mutt -y</i>
413</pre> 417</pre>
414 418
415<p> 419<p>
416This should open Mutt with a menu showing the Mutt mailboxes that you created 420This should open Mutt with a menu showing the Mutt mailboxes that you created
417in Test 2 when you ran the fetchmail command. 421in Test 2 when you ran the fetchmail command.
418</p> 422</p>
419 423
420<p> 424<p>
421Type the ? for help in navigating the Mutt Mailboxes. 425Type the ? for help in navigating the Mutt Mailboxes.
422</p> 426</p>
480There is one more program you probably want to add called urlview. This 484There is one more program you probably want to add called urlview. This
481extracts the urls in message texts and sends them to your browser. 485extracts the urls in message texts and sends them to your browser.
482</note> 486</note>
483 487
484<pre caption="Getting urlview"> 488<pre caption="Getting urlview">
485# <i>emerge urlview</i> 489# <i>emerge urlview</i>
486</pre> 490</pre>
487 491
488<p> 492<p>
489Then create <path>~/.urlview</path> by copying the configuration file from 493Then create <path>~/.urlview</path> by copying the configuration file from
490<path>/usr/share/doc/urlview*/</path> and setting your browser command. 494<path>/usr/share/doc/urlview*/</path> and setting your browser command.
553$ <i>nano -w .msmtprc</i> 557$ <i>nano -w .msmtprc</i>
554account default 558account default
555host <i>smtp.your_provider.net</i> 559host <i>smtp.your_provider.net</i>
556from <i>your_username@provider1.net</i> 560from <i>your_username@provider1.net</i>
557<comment>#see man page for more auth options</comment> 561<comment>#see man page for more auth options</comment>
558auth login 562auth login
559user <i>your_username</i> 563user <i>your_username</i>
560password <i>your_password</i> 564password <i>your_password</i>
561<comment>#If your SMTP Server supports TLS encryption, uncomment the next line 565<comment>#If your SMTP Server supports TLS encryption, uncomment the next line
562#tls</comment> 566#tls</comment>
563</pre> 567</pre>
578$ <i>nano -w .muttrc</i> 582$ <i>nano -w .muttrc</i>
579set sendmail="/usr/bin/msmtp" 583set sendmail="/usr/bin/msmtp"
580</pre> 584</pre>
581 585
582<p> 586<p>
583Fire up <c>mutt</c> and send yourself a test email to see if it worked! See 587Fire up <c>mutt</c> and send yourself a test email to see if it worked! See
584the msmtp man page for more options and another example. 588the msmtp man page for more options and another example.
585</p> 589</p>
586 590
587</body> 591</body>
588</section> 592</section>

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20