[ Pobierz całość w formacie PDF ]
.1 0 Configuring Internet Mail 173PARTIIIHour 11Configuring Internet1 1EmailThis hour shows you how to set up your Linux system to handle electronic mail.You ll also explore various programs you can use to read and send mail.First you ll learn to set up your system to send and receive mail, building on yourexperience in setting up and connecting with your ISP using PPP.Setting Up and Getting Your EmailThere s not really much to do to set up your system to send and receive mail,although configuring the main mail daemon, sendmail, is complex enough tobe considered a black art, suitable only for UNIX wizards.You shouldn t beintimidated though, because you can use email right after you install Linux andcreate other users.I can t discuss all of the details about UNIX mail in this hour, but you shouldunderstand how electronic mail works in general.The main programs involvedin email are, in technical terms, transport agents and user agents.A transportagent is a program, usually a daemon, which sends mail files from one computer 174 Hour 11to the next automatically.A user agent is a program, also called a mail reader, which you useto manage messages.After you install Linux, you ll find all of the programs you need to compose, send, and receivemail.The transport agent used in Linux is sendmail, and it is configured and runautomatically when you boot the operating system.As far as user agents go, you have yourchoice, and they are discussed later in the hour.Because you re connecting to the Internet with a PPP connection, the general approach tohandling mail outlined in this hour is to log in and connect, retrieve mail, and then disconnect(or stay connected for a few quick replies).If you ve experimented with free email accountprograms for other operating systems, you know the general approach is to minimize connecttime by composing and replying to mail offline, then connecting, sending and retrievingmail, followed by logging off.If you want the details about Linux mail handling, along with pointers to other sources ofinformation, read Vince Skahan s Mail-HOWTO under the /usr/doc/HOWTO directory.Retrieving Your Email with popclientBy now you re probably wondering how to get your email from your ISP.If you recall fromthe last hour, you should have the IP address or name of your ISP s mail server.To get yourmail, you ll need the popclient program, found in the /usr/bin directory.You ll also needto know what Post Office Protocol, or POP, your ISP uses, along with your username andpassword.Most ISPs support either POP2 or POP3, which are simple protocols for retrievingyour messages.Put all this information together, connect to your ISP, and then grab all your waiting emailwith one command line:# /etc/ppp/ppp-on# popclient -3 -u username -p password mailserver.yourisp.comYou can also put this command line into a text file, use chmod +x, and call it as follows:# domailQUALCOMM Pop server derived from UCB (version 2.1.4-R3) at megan starting.3 messages in folderreading message 1.reading message 2.reading message 3.The popclient program is designed to work only one way; it retrieves your mail from yourISP s mail server, then tells your ISP s mail server to delete your mail after it is received.Youcan also use other options, such as telling your ISP s mail server to keep copies of your maileven after you retrieve, or to put your retrieved mail into an optional directory on your system.1 1 Configuring Internet Mail 175By default, your mail will go into a single file with your username under the /var/spool/maildirectory.See the popclient manual page for more options.Using fetchmail as an AlternativeIf you d like to try an another program instead of popclient to retrieve your mail, you maywant to try fetchmail.This program offers a few more features, and can run in daemon mode,checking to see if you have mail while you re connected to your ISP.Using fetchmail is easy,for example:# fetchmail -p POP3 staffnet.comEnter password for bball@staffnet.com:1 message from bball@staffnet.com.reading message 1 (581 bytes) flushedfetchmail will prompt for your password (so you can gain access to your ISP s mail server),then retrieves your mail and flushes (or deletes) your mail from your ISP s mail server.fetchmail also has a nifty option, -c, which unlike popclient s -c option, will merely checkto see if you have mail waiting, and report the number of messages.See fetchmail s manualpage for more information.Now that you ve retrieved your mail, how do you read it, or reply to messages? This is whereuser agents, or mail-reading programs, come in.1 1Sending Mail with Mail ProgramsThis section introduces you to three basic mail programs you can use under Linux.Theexplanations start with one of the oldest, the mail program, then follow with two screen-oriented programs, pine and elm.Using the mail ProgramThemail program, found under the /bin directory, is the simplest mail program you can use,but it is not screen-oriented.mail can send and receive mail, but you re limited to workingon a line-by-line basis.This program is handy for quick messages and is easy to use.Forexample, to create a quick message, call mail with an address on the command line:# mail bball@staffnet.comSubject: Using the mail ProgramThis is how to use the mail program!Have fun, and enjoy.EOTThe mail program will respond by asking for a Subject: line.Enter your text, and then pressthe Enter key.Then, type each line of text, and when you re done, put a period (.) on a line 176 Hour 11by itself.The mail program will then send the message.Retrieving your messages is easy.Afteryou connect to your ISP, and retrieve your mail using either popclient or fetchmail, you cansimply type mail on the command line, for example:# mailMail version 5.5-kw 5/30/95.Type ? for help. /var/spool/mail/bball : 2 messages> 1 mwc@savoynet.com Tue Nov 18 10:43 38/2126  Save on Inkjet /Laser2 bball@staffnet.com Tue Nov 18 11:27 24/701  test&The mail program will retrieve your mail from the /var/spool/mail directory, print itsversion, then list each message, and present the ampersand (&) as a prompt.Note that thecurrent message is preceded by a right angle bracket (greater-than sign).The basic mailcommands aret Type, or list, the current messagen Go to the next message and list it+ Move to next message and list it- Move backward to previous message and list ith Reprint list of messages (after listing a message)d Delete current messageR Reply to senderr Reply to sender and all recipientsq Quit, saving messages in the default mailbox, mboxx Quit, don t save messages in mboxOne handy way to send a long message quickly is to use the command-line redirectionoperator of your shell.For example, if you have composed a long message in your favorite texteditor, you can send the message with# mail -s  How is it going? myfriend@somewhere.com cd.close Close the current connection [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • swpc.opx.pl
  •