< Day Day Up > |
You can send and receive email messages in a variety of ways, depending on the type of mail client you use. Although all electronic mail utilities perform the same basic tasks of receiving and sending messages, they tend to have different interfaces. Some mail clients operate on a desktop, such as KDE or GNOME. Others run on any X Window System managers. Several popular mail clients were designed to use a screen-based interface and can be started from only the command line. Other traditional mail clients were developed for just the command line interface, which requires you to type your commands on a single command line. Most mail clients described here are included in standard Linux distributions and come in a standard RPM package for easy installation. For Web-based Internet mail services, such as Hotmail, Lycos, and Yahoo, you use a Web browser instead of a mail client to access mail accounts provided by those services. Table 13-1 lists several popular Linux mail clients.
Mail is transported to and from destinations using mail transport agents. Sendmail and Smail send and receive mail from destinations on the Internet or at other sites on a network (see Chapter 24). To send mail over the Internet, they use the Simple Mail Transport Protocol (SMTP). Most Linux distributions, including Red Hat, automatically install and locally configure Sendmail for you. On starting up your system, having configured your network connections, you can send and receive messages over the Internet.
You can sign your e-mail message with the same standard signature information, such as your name, Internet address or addresses, or farewell phrase. Having your signature information automatically added to your messages is helpful. To do so, you need to create a signature file in your home directory and enter your signature information in it. A signature file is a standard text file you can edit using any text editor. Mail clients such as KMail enable you to specify a file to function as your signature file. Others, such as Mail, expect the signature file to be named .signature.
Mail Client |
Description |
---|---|
KContact (KMail, KAddressbook, KOrganizer) |
Includes the K Desktop mail client, KMail; integrated mail, address book, and scheduler |
Evolution |
Primary mail client for Red Hat |
Balsa, Mahogany, etc. |
GNOME mail clients (see Table 13-2) |
Mozilla Mail |
Web browser–based mail client |
Netscape |
Web browser–based mail client |
GNUEmacs and XEmacs |
Emacs mail clients |
Mutt |
Screen-based mail client |
Sylpheed |
Gtk mail and news client |
|
Original Unix-based command line mail client |
nmh |
New Message Handler command line mail client |
MIME (the term stands for Multipurpose Internet Mail Extensions) is used to enable mail clients to send and receive multimedia files and files using different character sets such as those for different languages. Multimedia files can be images, sound clips, or even video. Mail clients that support MIME can send binary files automatically as attachments to messages. MIME-capable mail clients maintain a file called mailcap that maps different types of MIME messages to applications on your system that can view or display them. For example, an image file will be mapped to an application that can display images. Your mail clients can then run that program to display the image message. A sound file will be mapped to an application that can play sound files on your speakers. Most mail clients have MIME capabilities built in and use their own version of the mailcap file. Others, like Elm, use a program called metamail that adds MIME support. MIME is not only used in mail clients. As noted in Chapters 6 and 7, both the KDE and GNOME file managers use MIME to map a file to a particular application so that you can launch the application directly from the file.
Applications are associated with binary files by means of the mailcap and mime.types files. The mime.types file defines different MIME types, associating a MIME type with a certain application. The mailcap file then associates each MIME type with a specified application. Your system maintains its own MIME types file, usually /etc/mime.types.
Entries in the MIME types file associate a MIME type and possible subtype of an application with a set of possible file extensions used for files that run on a given kind of application. The MIME type is usually further qualified by a subtype, separated from the major type by a slash. For example, a MIME type image can have several subtypes such as jpeg, gif, or tiff. A sample MIME type entry defining a MIME type for JPEG files is shown here. The MIME type is image/jpeg, and the list of possible file extensions is "jpeg jpg jpe":
image/jpeg jpeg jpg jpe
The applications specified will depend on those available on your particular system. The MIME type is separated from the application with a semicolon. In many cases, X Window System–based programs are specified. Comments are indicated with a #. A * used in a MIME subtype references all subtypes. The entry image/* would be used for an application that can run all types of image files. A formatting code, %s, is used to reference the attachment file that will be run on this application. Sample mailcap entries are shown here. The first entry associates all image files with the xv image viewer. The next two associate video and video MPEG files with the xanim application.
image/*; xv %s video/*; xanim %s video/mpeg; xanim %s
You can also create and edit MIME types on the GNOME and KDE desktops. For GNOME, use the GNOME Control Center's MIME types capplet. This capplet will list the MIME types defined for your system along with their associated filename extensions. Edit an entry to change the application and icon associated with that MIME type, that type of file. On KDE, use the KDE Control Center's File Association entry under KDE Components. This will list MIME types and their associated filename extensions. Select an entry to edit it and change the applications associated with it. KDE saves its MIME type information in a separate file called mimelnk in the KDE configuration directory.
Though you can create your own MIME types, a standard set already is in use. The types text, image, audio, video, application, multipart, and message, along with their subtypes, have already been defined for your system. You will find that commonly used file extensions such as .tif and .jpg for TIFF and JPEG image files are already associated with a MIME type and an application. Though you can easily change the associated application, it is best to keep the MIME types already installed. The current official MIME types are listed at the IANA Web site (www.iana.org) under the name Media Types, provided as part of their Assignment Services. You can access the media types file directly on their site.
Evolution is the primary mail client for Red Hat. It is installed by default along with OpenOffice. Though designed for GNOME, it will work equally well on KDE. Evolution is an integrated mail client, calendar, and address book, currently being developed by Ximian. The Evolution mailer is a powerful tool with support for numerous protocols (SMTP, POP, and IMAP), multiple mail accounts, and encryption. With Evolution, you can create multiple mail accounts on different servers, including those that use different protocols such as POP or IMAP. You can also decrypt PGP- or GPG-encrypted messages.
The Evolution mailer provides a simple GUI interface, with a toolbar for commonly used commands and a sidebar for shortcuts. A menu of Evolution commands allows access to other operations. The main panel is divided into two panes, one for listing the mail headers and the other for displaying the currently selected message. You can click any header title to sort your headers by that category. Evolution also supports the use of virtual folders. These are folders created by the user to hold mail that meets specified criteria. Incoming mail can be automatically distributed to their particular virtual folder.
Several GNOME-based mail clients are under development, many of which you can currently use (see Table 13-2). These include Evolution, Balsa, Mahogany, Althea, MMC, SMAN, Pygmy, Spruce, and Sylpheed (Balsa, Evolution, and Sylpheed are included with Red Hat). Check the GNOME Web site for more mail clients as they come out. Many are based on the GNOME mail client libraries (camel) currently under development, which provides support for standard mail operations. Balsa is a GNOME mail client with extensive features, though it can operate under any window manager, including KDE, as long as GNOME is installed on your system. Evolution is an integrated mail client, calendar, and contact manager from Ximian. The Mahogany mail client is a GNOME mail client that also has versions for other platforms. Althea is a stable IMAP mail client. The SMAN simple mail client is used to access POP3 servers. Pygmy is a simple GNOME mail client written in the Python programming language that supports attachments and MIME message. Sylpheed is a mail and news client with an interface similar to Windows mail clients. Spruce is a GNOME e-mail client with support for multiple accounts. Several support tools are also available like mail checkers and notifiers, include RePopApp and Flink mail checkers, along with Sonicmail and gpostman mail notifiers.
Application |
Description |
---|---|
Balsa |
E-mail client for GNOME that supports POP3, IMAP, local folders, and multithreading |
Evolution |
Ximian integrated mail client, calendar, and contact manager |
Sylpheed |
Mail and news client similar to Windows clients |
Althea |
Stable IMAP mail client |
SQmaiL |
A folder-based e-mail system (using mysql) |
SMAN |
Simple mail user agent that accesses POP3 servers |
RePopApp |
GNOME mail checker with support for multiple accounts |
Mahogany |
Cross-platform e-mail application |
Flink |
GNOME mail checker with IMAP, POP3, and mbox support |
Pygmy |
GNOME mail client written in the Python programming language |
Spruce |
E-mail client with support for multiple accounts |
gpostman |
Basic GNOME mail notifier |
MMC |
GNOME mail client |
Sonicmail |
GNOME POP3 mail notifier applet |
Balsa provides a full-featured GUI interface for composing, sending, and receiving mail messages. The Balsa window displays three panes for folders, headers, and messages. The left pane displays your mail folders. You initially have three folders: an inbox folder for received mail, an outbox folder for mail you have composed but have not sent yet, and a trash folder for messages you have deleted. You can also create your own mail folders in which you can store particular messages. To place a message in a folder you have created, click and drag the message header for that message to the folder.
The K Desktop mail client, KMail, provides a full-featured GUI interface for composing, sending, and receiving mail messages. KMail is now part of the KContact package, which also includes an address book (KAddressBook), an organizer and scheduler (KOrganizer), and a note writer (KNotes). To start up KMail, you start the KContact application. The KMail window displays three panes for folders, headers, and messages. The upper-left pane displays your mail folders. You have an inbox folder for received mail, an outbox folder for mail you have composed but have not sent yet, and a sent-mail folder for messages you have previously sent. You can create your own mail folders and save selected messages in them, if you wish. The top-right pane displays mail headers for the currently selected mail folder. To display a message, click its header. The message is then displayed in the large pane below the header list. You can also send and receive attachments, including binary files. Pictures and movies that are received are displayed using the appropriate K Desktop utility. If you right-click the message, a pop-up menu displays options for actions you may want to perform on it. You can move or copy it to another folder, or simply delete it. You can also compose a reply or forward the message.
To set up KMail for use with your mail accounts, you must enter account information. Select the Configure entry in the Settings menu. Several panels are available on the Settings window, which you can display by clicking their icons in the left column. For accounts, you select the Network panel. You may have more than one mail account on mail servers maintained by your ISP or LAN. A configure window is displayed where you can enter login, password, and host information. For secure access, KMail now supports SSL, provided OpenSSL is installed. Messages can now be encrypted and decoded by users. It also supports IMAP in addition to POP and SMTP protocols.
Although many of the newer mail clients are being designed for either GNOME or the K Desktop, several mail clients were developed for use on the X Window System and operate under any window manager or desktop. They do not require either GNOME or the K Desktop. Mozilla mail and Emacs are two of the more popular mail clients. The Emacs mail clients are integrated into the Emacs environment, of which the Emacs editor is the primary application. They are, however, fully functional mail clients.
Mozilla is an Open Source version of Netscape based on Netscape 5.0. It has replaced Netscape as the primary Web browser on Red Hat distributions. To use the Mozilla mail client, you have simply to select it in the Tasks menu of the Mozilla Web browser or from the Internet menu on the GNOME program menu. When you first start Mozilla, you are prompted to enter new account information. You can add and edit accounts later by selecting the Mail/News Account Settings entry in the Edit menu. This opens a dialog box with a button for adding new accounts if you wish.
Note |
Netscape Communicator includes a mail client called Messenger. Account information, such as your mail server, username, and password, must be entered in the Mail panel in the Preferences window, accessible from the Edit menu. Red Hat no longer includes Netscape in its distribution, though you can download and install it if you wish. |
The GNU version of Emacs includes a mail client along with other components, such as a newsreader and editor. GNU Emacs is included on Red Hat distributions. Check the Emacs Web site at www.gnu.org/software/emacs for more information. When you start up GNU Emacs, menu buttons are displayed across the top of the screen. If you are running Emacs in an X Window System environment, you have full GUI capabilities and can select menus using your mouse. To access the Emacs mail client, select from the mail entries in the Tools menu. To compose and send messages, just select the Send Mail item in the Tools menu. This opens a screen with prompts for To and Subject header entries. You then type the message below them, using any of the Emacs editing capabilities. GNU Emacs is a working environment within which you can perform a variety of tasks, with each task having its own buffer. When you read mail, a buffer is opened to hold the header list, and when you read a message, another buffer will hold the contents. When you compose a message, yet another buffer holds the text you wrote. The buffers you have opened for mail, news, or editing notes or files are listed in the Buffers menu. You can use this menu to switch among them.
XEmacs is another version of Emacs designed to operate solely with a GUI interface. The Internet applications, which you can easily access from the main XEmacs button bar, include a Web browser, a mail utility, and a newsreader. When composing a message, you have full use of the Emacs editor with all its features, including the spell-checker and search/replace.
Several mail clients use a simple command line interface. They can be run without any other kind of support, such as the X Window System, desktops, or cursor support. They are simple and easy to use but include an extensive set of features and options. Three of the more widely used mail clients of this type are Mail and New Message Handler (nmh). Mail is the mailx mail client that was developed for the Unix system. It is considered a kind of default mail client that can be found on all Unix and Linux systems. The nmh is a collection of mail access tools designed to be integrated into your shell easily. Mutt is a cursor-based client that can be run from the command line.
Note |
You can also use the Emacs mail client from the command line, as described in the previous section. |
You can invoke several powerful mail clients on the command line that provide a full-screen, cursor-based interface. Menus are displayed on the screen with entries you can select using your keyboard. Basic cursor movement is supported with arrow keys. Pine and Mutt are mail clients that provide a screen-based interface. Although screen-based, the mail clients are very powerful. Pine, though popular in the past, has been dropped from Red Hat 10.
Mutt incorporates many of the features of Pine. It has an easy-to-use, screen-based interface. Like Pine, Mutt has an extensive set of features, such as MIME support. You can find more information about Mutt from the Mutt Web page at www.mutt.org. Here you can download recent versions of Mutt and access online manuals and help resources. On most distributions, the Mutt manual is located in the /usr/doc directory under Mutt. The Mutt newsgroup is comp.mail.mutt, where you can post queries and discuss recent Mutt developments.
What is known now as the mail utility was originally created for BSD Unix and called, simply, mail. Later versions of Unix System V adopted the BSD mail utility and renamed it mailx. Now, it is simply referred to as Mail. Mail functions as a de facto default mail client on Unix and Linux systems. All systems have the mail client called Mail, whereas they may not have other mail clients.
To send a message with Mail, type mail along with the address of the person to whom you are sending the message. Press ENTER and you are prompted for a subject. Enter the subject of the message and press ENTER again. At this point, you are placed in input mode. Anything typed in is taken as the contents of the message. Pressing ENTER adds a new line to the text. When you finish typing your message, press CTRL-D on a line of its own to end the message. You will then be prompted to enter a user to whom to send a carbon copy of the message (Cc). If you do not want to sent a carbon copy, just press ENTER. You will then see EOT (end-of-transmission) displayed after you press CTRL-D
You can send a message to several users at the same time by listing those users' addresses as arguments on the command line following the mail command. In the next example, the user sends the same message to both chris and aleina.
$ mail chris aleina
To receive mail, you enter only the mail command and press ENTER. This invokes a Mail shell with its own prompt and mail commands. A list of message headers is displayed. Header information is arranged into fields beginning with the status of the message and the message number. The status of a message is indicated by a single uppercase letter, usually N for new or U for unread. A message number, used for easy reference to your messages, follows the status field. The next field is the address of the sender, followed by the date and time the message was received, and then the number of lines and characters in the message. The last field contains the subject the sender gave for the message. After the headers, the Mail shell displays its prompt, an ampersand, &. At the Mail prompt, you enter commands that operate on the messages. An example of a Mail header and prompt follows:
$ mail Mail version 8.1 6/6/93. Type ? for help. "/var/spool/mail/larisa": 3 messages 2 unread 1 chris@turtle.mytrek. Thu Jun 7 14:17 22/554 "trip" >U 2 aleina@turtle.mytrek Thu Jun 7 14:18 22/525 "party" U 3 dylan@turtle.mytrek. Thu Jun 7 14:18 22/528 "newsletter" & q
Mail references messages either through a message list or through the current message marker (>). The greater-than sign (>) is placed before a message considered the current message. The current message is referenced by default when no message number is included with a Mail command. You can also reference messages using a message list consisting of several message numbers. Given the messages in the previous example, you can reference all three messages with 1-3.
You use the R and r commands to reply to a message you have received. The R command entered with a message number generates a header for sending a message and then places you into the input mode to type in the message. The q command quits Mail. When you quit, messages you have already read are placed in a file called mbox in your home directory. Instead of saving messages in the mbox file, you can use the s command to save a message explicitly to a file of your choice.Mail has its own initialization file, called .mailrc, that is executed each time Mail is invoked, for either sending or receiving messages. Within it, you can define Mail options and create Mail aliases. You can set options that add different features to mail, such as changing the prompt or saving copies of messages you send. To define an alias, you enter the keyword alias, followed by the alias you have chosen and then the list of addresses it represents. In the next example, the alias myclass is defined in the .mailrc file.
In the next example, the contents of the file homework are sent to all the users whose addresses are aliased by myclass.
$ mail myclass < homework
The Message Handler mail client, commonly known as nmh, takes a different approach to managing mail than most other mail clients. nmh consists of a set of commands you execute within your user shell, just as you would execute any other Unix command. No special mail shell exists, as there is for Mail. One nmh command sends a message, another displays your incoming messages, and still another saves a message. A set of environment variables provides a context for the nmh commands you execute, such as keeping track of the current messages or mail folders.
Tip |
Instead of working from a command line interface, you can use exmh, which provides an X interface for accessing nmh messages, as well as MH-E, which is an Emacs front end for MH. |
To send a message using nmh, you first need to compose the message using the comp command, and then send the message with the send command. To compose a message, type the word comp on the command line by itself and press ENTER. With nmh, you are placed in an input mode for the default editor used for nmh (usually the Vi editor). Fields at the top of the screen show prompts for the address, carbon copy, and subject. Below the dotted line, you enter your message. You can use your arrow keys to move from one field to another. Once you type the contents of the message, save and quit the editor as you normally would (ESC-SHIFT-ZZ for Vi). At the What now? prompt, you can send the message, edit it, save it to a file, display it again, or quit without sending the message. The send command sends the message. Pressing ENTER at the What now? prompt displays a list of commands you can enter. In the next example, the user composes a message for another user whose address is robert.
$ comp To: robert cc: Subject: Birthday ------------------- Your present is in the mail really. What now? send $
To read your mail with nmh, you first need to store newly received mail into a designated nmh mailbox file with the inc command. The inc command displays a list of headers for each mail message in your incoming mailbox. An nmh message header consists only of the message number, the month and year, the address of the sender, and the beginning of the message text.
$ inc 1+ 06/07 Christopher Peter trip<<Are you ready for the trip? chris >> 2 06/07 Aleina Petersen party<<its on for tomorrow night. Aleina >> 3 06/07 Dylan Petersen newsletter<<Did you write your article yet? Dyla $
If you want to redisplay the headers, you need to use another nmh command called scan.
$ scan 1+ 06/07 Christopher Peter trip<<Are you ready chris >> 2 06/07 Aleina Petersen party<<its on for Aleina >> 3 06/07 Dylan Petersen newsletter<<Did you Dylan >> $
You use the show, next, and prev commands to display a message. The show command displays the current message, the next command displays the message after the current one, and the prev command displays the message before the current one. To print a message, you first output it with show, and then pipe the output to a printer. You save a message to a text file in much the same way. First you output the message using the show command, and then you redirect that output to a file.
$ show | lpr $ show > myfile
As your mail messages are received, they are automatically placed in your mailbox file, but you are not automatically notified when you receive a message. To find out if you have any messages waiting, you can use a mail client to retrieve messages or you can use a mail monitor tool to tell you if you have any mail waiting. There are also a number of mail monitors available for use on GNOME. Several operate as applets on the GNOME panel. On the Red Hat GNOME desktop, there are two mail monitors you can choose from: the Mail Check and Clock and Mail Notify monitors. Both are applets that run inside a GNOME panel. The Mail Check applet will display a mail envelope when mail arrives, and the Clock and Mail Notify applet displays a small envelope and the number of messages received below the time. Other applets like Sonicmail will notify you of any POP3 mail arrivals. PyBiff performs much the same kind of mail monitoring as Korn. gbox_applet will monitor mailboxes, assigning priorities to each. GMailWatch is a mail monitor applet that will display a summary of incoming mail.
The KDE Desktop has a mail monitor utility called Korn that works in much the same way. Korn shows an empty inbox tray when there is no mail and a tray with slanted letters in it when mail arrives. If old mail is still in your mailbox, letters are displayed in a neat square. You can set these icons as any image you want. You can also specify the mail client to use and the polling interval for checking for new mail. If you have several mail accounts, you can set up a Korn profile for each one. Different icons can appear for each account telling you when mail arrives in one of them.
For command line interfaces, you can use the biff utility. The biff utility notifies you immediately when a message is received. This is helpful when you are expecting a message and want to know as soon as it arrives. biff automatically displays the header and beginning lines of messages as they are received. To turn on biff, you enter biff y on the command line. To turn it off, you enter biff n. To find out if biff is turned on, enter biff alone.
You can temporarily block biff by using the mesg n command to prevent any message displays on your screen. mesg n not only stops any Write and Talk messages, it also stops biff and Notify messages. Later, you can unblock biff with a mesg y command. A mesg n command comes in handy if you don't want to be disturbed while working on some project.
Most newer mail clients are equipped to access mail accounts on remote servers. For such mail clients, you can specify a separate mail account with its own mailbox. For example, if you are using an ISP, most likely you will use that ISP's mail server to receive mail. You will have set up a mail account with a username and password for accessing your mail. Your e-mail address is usually your username and the ISP's domain name. For example, a username of larisa for an ISP domain named mynet.com would have the address larisa@mynet.com. The username would be larisa. The address of the actual mail server could be something like mail.mynet.com. The user larisa would log into the mail.mynet.com server using the username larisa and password to access mail sent to the address larisa@mynet.com. Newer mail clients, such as KMail, Balsa, and Mozilla, enable you to set up a mailbox for such an account and access your ISP's mail server to check for and download received mail. You must specify what protocol a mail server uses. This is usually either the Post Office Protocol (POP) or the IMAP protocol (IMAP). This procedure is used for any remote mail server. Using a mail server address, you can access your account with your username and password.
Should you have several remote email accounts, instead of creating separate mailboxes for each in a mail client, you can arrange to have mail from those accounts sent directly to the inbox maintained by your Linux system for your Linux account. All your mail, whether from other users on your Linux system or from remote mail accounts, will appear in your local inbox. Such a feature is helpful if you are using a mail client, such as Elm or Mail, that does not have the capability to access mail on your ISP's mail server. You can implement such a feature with Fetchmail. Fetchmail checks for mail on remote mail servers and downloads it to your local inbox, where it appears as newly received mail (you will have to be connected to the Internet or the remote mail server's network).
To use Fetchmail, you have to know a remote mail server's Internet address and mail protocol. Most remote mail servers use the POP3 protocol, but others may use the IMAP, ETRM, or POP2 protocols. Enter fetchmail on the command line with the mail server address and any needed options. The mail protocol is indicated with the -p option and the mail server type, usually POP3. If your e-mail username is different from your Linux login name, you use the -u option and the e-mail name. Once you execute the fetchmail command, you are prompted for a password. The syntax for the fetchmail command for a POP3 mail server follows:
fetchmail -p POP3 -u username mail-server
To use Fetchmail, connect to your ISP and then enter the fetchmail commands with the options and the POP server name on the command line. You will see messages telling you if mail is there and, if so, how many messages are being downloaded. You can then use a mail client to read the messages from your inbox. You can run Fetchmail in daemon mode to have it automatically check for mail. You have to include an option specifying the interval in seconds for checking mail.
fetchmail -d 1200
You can specify options such as the server type, username, and password in a .fetchmailrc file in your home directory. You can also have entries for other mail servers and accounts you may have. Instead of entering options directly into the .fetchmailrc file, you can use the fetchmailconf program. fetchmailconf provides a GUI interface for selecting Fetchmail options and entering mail account information. fetchmailconf runs only under X and requires that python and Tk be installed. It displays windows for adding news servers, configuring a mail server, and configuring a user account on a particular mail server. The expert version displays the same kind of windows, but with many more options.
Once it is configured, you can enter fetchmail with no arguments; it will read entries from your .fetchmailrc file. You can also make entries directly in the .fetchmailrc file. An entry in the .fetchmailrc file for a particular mail account consists of several fields and their values: poll, protocol, username, and password. Poll is used to specify the mail server name, and protocol, the type of protocol used. Notice you can also specify your password, instead of having to enter it each time Fetchmail accesses the mail server.
< Day Day Up > |
This HTML Help has been published using the chm2web software. |