| 1 | <?xml version='1.0' encoding="UTF-8"?> |
1 | <?xml version='1.0' encoding="UTF-8"?> |
|
|
2 | |
|
|
3 | |
|
|
4 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 2 | <guide link="/doc/en/guide-to-mutt.xml"> |
5 | <guide link="/doc/en/guide-to-mutt.xml"> |
| 3 | <?xml-stylesheet href="xsl/guide-main.xsl" type="text/xsl"?> |
|
|
| 4 | <title>QuickStart Guide to Mutt E-Mail</title> |
6 | <title>QuickStart Guide to Mutt E-Mail</title> |
| 5 | <author title="Author"><mail link="mikpolniak@adelphia.net">Mike Polniak</mail></author> |
7 | <author title="Author"><mail link="mikpolniak@adelphia.net">Mike Polniak</mail></author> |
| 6 | <author title="Editor"><mail link="antifa@gentoo.org">Ken Nowack</mail></author> |
8 | <author title="Editor"><mail link="antifa@gentoo.org">Ken Nowack</mail></author> |
| 7 | |
9 | |
| 8 | <abstract>This guide shows you how to begin using the powerful command line tools for email: fetchmail, procmail, mutt, and nbsmtp.</abstract> |
10 | <abstract>This guide shows you how to begin using the powerful command line tools for e-mail: fetchmail, procmail, mutt, and nbsmtp.</abstract> |
| 9 | |
11 | |
| 10 | <version>1.0</version> |
12 | <version>1.0</version> |
| 11 | <date>19 Feb 2003</date> |
13 | <date>2 May 2003</date> |
| 12 | |
14 | |
| 13 | <chapter> |
15 | <chapter> |
| 14 | <title>Introduction to E-Mail</title> |
16 | <title>Introduction to E-Mail</title> |
| 15 | <section> |
17 | <section> |
| 16 | <body> |
18 | <body> |
| … | |
… | |
| 21 | <p><b>fetchmail->procmail->mutt->smtp</b></p> |
23 | <p><b>fetchmail->procmail->mutt->smtp</b></p> |
| 22 | |
24 | |
| 23 | <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 |
25 | <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 |
| 24 | be amazed at what you can do with it.</p> |
26 | be amazed at what you can do with it.</p> |
| 25 | |
27 | |
| 26 | <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 |
28 | <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 |
| 27 | configuration. It also eliminates using port 25 for mail service.</p> |
29 | configuration. It also eliminates using port 25 for mail service.</p> |
| 28 | |
30 | |
| 29 | <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 |
31 | <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 |
| 30 | need to use a complex MTA for plain old outgoing mail delivery.</p> |
32 | need to use a complex MTA for plain old outgoing mail delivery.</p> |
| 31 | |
33 | |
| 32 | <p>These are the programs you will need to get your e-mail running. </p> |
34 | <p>These are the programs you will need to get your e-mail running. </p> |
| 33 | |
35 | |
| 34 | <pre> |
36 | <pre> |
| … | |
… | |
| 36 | </pre> |
38 | </pre> |
| 37 | |
39 | |
| 38 | <p>Then just four quick steps to configure files and you will be up and running a brand new e-mail system.</p> |
40 | <p>Then just four quick steps to configure files and you will be up and running a brand new e-mail system.</p> |
| 39 | |
41 | |
| 40 | |
42 | |
| 41 | <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> |
43 | <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> |
| 42 | |
44 | |
| 43 | </body> |
45 | </body> |
| 44 | </section> |
46 | </section> |
| 45 | </chapter> |
47 | </chapter> |
| 46 | |
48 | |
| … | |
… | |
| 55 | |
57 | |
| 56 | <pre caption="Sample .fetchmailrc"> |
58 | <pre caption="Sample .fetchmailrc"> |
| 57 | <i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i> |
59 | <i>poll mail.myisp.net protocol pop3 user "myname" password "mypasswd"</i> |
| 58 | </pre> |
60 | </pre> |
| 59 | |
61 | |
| 60 | <p>Once you have created a .fetchmailrc file, you have to change the permissions on the file using the chmod command. The file must be readable |
62 | <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 |
| 61 | only by the file owner. Set the permissions with the following command:</p> |
63 | only by the file owner. Set the permissions with the following command:</p> |
| 62 | |
64 | |
| 63 | <pre> |
65 | <pre> |
| 64 | # <i>chmod 710 .fetchmailrc</i> |
66 | # <i>chmod 710 .fetchmailrc</i> |
| 65 | </pre> |
67 | </pre> |
| 66 | |
68 | |
| 67 | <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. |
69 | <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. |
| 68 | </p> |
70 | </p> |
| 69 | |
71 | |
| 70 | <warn>While testing,its a good idea to tell fetchmail to keep (-k) the mailon the remote server in case something goes wrong and you need to fetch it |
72 | <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 |
| 71 | again.</warn> |
73 | again.</warn> |
| 72 | |
74 | |
| 73 | |
75 | |
| 74 | <p>Run it now to see fetchmail in action!</p> |
76 | <p>Run it now to see fetchmail in action!</p> |
| 75 | |
77 | |
| … | |
… | |
| 90 | <body> |
92 | <body> |
| 91 | |
93 | |
| 92 | <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 |
94 | <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 |
| 93 | mutt (your e-mail client) can read it.</p> |
95 | mutt (your e-mail client) can read it.</p> |
| 94 | |
96 | |
| 95 | <p>To use procmail you need to create a .procmailrc file in your home directory. For our quickstart purposes we will use a very simple |
97 | <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 |
| 96 | .procmailrc that will filter mail from three gentoo mailing lists into these mailboxes:<e>gentoo-dev, gentoo-user and gentoo-announce</e> |
98 | <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> |
| 97 | </p> |
99 | </p> |
| 98 | |
100 | |
| 99 | <note>The procmail filter rules are called recipies and i have also included recipies to filter out some spam.</note> |
101 | <note>The procmail filter rules are called recipies and i have also included recipies to filter out some spam.</note> |
| 100 | |
102 | |
| 101 | <pre caption="Sample .procmailrc"> |
103 | <pre caption="Sample .procmailrc"> |
| … | |
… | |
| 167 | default |
169 | default |
| 168 | |
170 | |
| 169 | # End of file |
171 | # End of file |
| 170 | </pre> |
172 | </pre> |
| 171 | |
173 | |
| 172 | <note>It is only required to make the MAILDIR $HOME/MuttMail as Procmail will create all the mailbox files as needed in this directory using the names on |
174 | <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 |
| 173 | the action lines.For some useful links visit <uri>http://www.procmail.org/</uri> </note> |
175 | the action lines. For some useful links visit <uri>http://www.procmail.org/</uri> </note> |
| 174 | |
176 | |
| 175 | <p>You can now test .procmailrc by re-running the fetchmail command we tested in the first step. Remember the -k option to keep all mail on the remote |
177 | <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 |
| 176 | server so we have it if we need to rerun it.</p> |
178 | server so we have it if we need to rerun it.</p> |
| 177 | |
179 | |
| 178 | |
180 | |
| 179 | <pre caption="Procmail test #1"> |
181 | <pre caption="Procmail test #1"> |
| 180 | # <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> |
182 | # <i>fetchmail -akv -m "/usr/bin/procmail -d %T"</i> |
| 181 | </pre> |
183 | </pre> |
| 182 | |
184 | |
| 183 | <p>Now that fetchmail and procmail have run, go to $HOME/MuttMail and read your messages with <c>less</c> or your file manager. |
185 | <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. |
| 184 | </p> |
186 | </p> |
| 185 | |
187 | |
| 186 | </body> |
188 | </body> |
| 187 | </section> |
189 | </section> |
| 188 | </chapter> |
190 | </chapter> |
| … | |
… | |
| 198 | using the mbox format, where all messages of a mailbox are stored in a single file.</p> |
200 | using the mbox format, where all messages of a mailbox are stored in a single file.</p> |
| 199 | |
201 | |
| 200 | <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 |
202 | <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 |
| 201 | site <uri>http://www.mutt.org/</uri></p> |
203 | site <uri>http://www.mutt.org/</uri></p> |
| 202 | |
204 | |
| 203 | <p>When you emerged mutt in the first step it installed a system configuration. file in <path>/etc/mutt/Muttrc</path> You also need to create a .muttrc file in your |
205 | <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 |
| 204 | home directory.</p> |
206 | home directory.</p> |
| 205 | |
207 | |
| 206 | <pre caption="Sample .muttrc"> |
208 | <pre caption="Sample .muttrc"> |
| 207 | <codenote>Be sure to read the fine Mutt manual in /usr/share/doc/mutt*</codenote> |
209 | <codenote>Be sure to read the fine Mutt manual in /usr/share/doc/mutt*</codenote> |
| 208 | <codenote>Any settings here override the system settings in /etc/mutt/Muttrc</codenote> |
210 | <codenote>Any settings here override the system settings in /etc/mutt/Muttrc</codenote> |
| … | |
… | |
| 315 | |
317 | |
| 316 | # End of file...but it can go on and on and on....:) |
318 | # End of file...but it can go on and on and on....:) |
| 317 | </pre> |
319 | </pre> |
| 318 | |
320 | |
| 319 | |
321 | |
| 320 | <p>For the record, this is just a sample .muttrc. There are many more options that you can configure, |
322 | <p>For the record, this is just a sample <path>.muttrc</path>. There are many more options that you can configure, |
| 321 | gpg settings for instance. Have a look at <uri>http://mutt.netliberte.org/</uri> for more examples and help.</p> |
323 | gpg settings for instance. Have a look at <uri>http://mutt.netliberte.org/</uri> for more examples and help.</p> |
| 322 | |
324 | |
| 323 | <p>You are now ready to test your .muttrc </p> |
325 | <p>You are now ready to test your <path>.muttrc</path> </p> |
| 324 | |
326 | |
| 325 | <pre caption="Testing .muttrc"> |
327 | <pre caption="Testing .muttrc"> |
| 326 | # <i>mutt -y</i> |
328 | # <i>mutt -y</i> |
| 327 | </pre> |
329 | </pre> |
| 328 | |
330 | |
| … | |
… | |
| 339 | <title>SMTP</title> |
341 | <title>SMTP</title> |
| 340 | <section> |
342 | <section> |
| 341 | <body> |
343 | <body> |
| 342 | |
344 | |
| 343 | <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 |
345 | <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 |
| 344 | adding an entry in your .muttrc file.</p> |
346 | adding an entry in your <path>.muttrc</path> file.</p> |
| 345 | |
347 | |
| 346 | <p>domain: The domain you want nbsmtp to say it belongs to. This will almost invariably be the same as the domain in your email address. |
348 | <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. |
| 347 | </p> |
349 | </p> |
| 348 | |
350 | |
| 349 | <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. |
351 | <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. |
| 350 | </p> |
352 | </p> |
| 351 | |
353 | |
| … | |
… | |
| 355 | # <i>nano -w .muttrc</i> |
357 | # <i>nano -w .muttrc</i> |
| 356 | set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f urname@isp.net" |
358 | set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f urname@isp.net" |
| 357 | </pre> |
359 | </pre> |
| 358 | |
360 | |
| 359 | <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 |
361 | <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 |
| 360 | use the value of the EDITOR or VISUAL for the composition editor unless you set editor= in the .muttrc. When you are done composing hit <c>y</c> to send your |
362 | use the value of the EDITOR or VISUAL for the composition editor unless you set <i>editor=</i> in the <path>.muttrc</path>. When you are done composing hit <c>y</c> to send your |
| 361 | message. If there are no errors you will see 'sending mail' followed by 'New mail in =sent' |
363 | message. If there are no errors you will see 'sending mail' followed by 'New mail in =sent' |
| 362 | </p> |
364 | </p> |
| 363 | |
365 | |
| 364 | <p>Remember in .muttrc we have set where to save sent mail with:set record="$HOME/MuttMail/sent"</p> |
366 | <p>Remember in <path>.muttrc</path> we have set where to save sent mail with <i>set record="$HOME/MuttMail/sent"</i></p> |
| 365 | |
367 | |
| 366 | <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 |
368 | <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 |
| 367 | your test message, hit the <c>h</c> key to toggle a view of all the headers and see the complete mail transfer path.</p> |
369 | your test message, hit the <c>h</c> key to toggle a view of all the headers and see the complete mail transfer path.</p> |
| 368 | |
370 | |
| 369 | <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. |
371 | <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. |
| … | |
… | |
| 371 | |
373 | |
| 372 | <pre> |
374 | <pre> |
| 373 | # <i>emerge urlview</i> |
375 | # <i>emerge urlview</i> |
| 374 | </pre> |
376 | </pre> |
| 375 | |
377 | |
| 376 | <p> then create <path>~/.urlview</path> by copying the configuration file from <path>/usr/share/doc/urlview*/</path> and setting your browser command. |
378 | <p>Then create <path>~/.urlview</path> by copying the configuration file from <path>/usr/share/doc/urlview*/</path> and setting your browser command. |
| 377 | </p> |
379 | </p> |
| 378 | |
380 | |
| 379 | <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 |
381 | <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 |
| 380 | web with 'google' procmailrc and muttrc</p> |
382 | web with 'google' <path>procmailrc</path> and <path>muttrc</path>.</p> |
| 381 | |
383 | |
| 382 | </body> |
384 | </body> |
| 383 | </section> |
385 | </section> |
| 384 | </chapter> |
386 | </chapter> |
| 385 | </guide> |
387 | </guide> |