Solaris 9 For Dummies

Sample: Chapter 5

Doin' That E-Mail Thing

E-mail enables users to instantaneously communicate with family and friends throughout the world. E-mail is the so-called killer app of the Internet.

From its humble beginnings in the 1970s in the Unix community, e-mail has become the main reason many folks are connected to the Internet. Because Sun has always believed the network is the computer, it's no surprise that Solaris includes a number of different e-mail applications.
You may also want to check out some wonderful graphical and command- line-based mail programs that aren't included in the standard Solaris 9 distribution. If you're interested, ask your system administrator to download these free alternative applications that are ready to go on Solaris 9.
Regardless of which mail program you choose, sending and receiving e-mail is a "killer skill" for anyone using the computer. This chapter offers an introduction to working with e-mail from all three major environments: the command line, the Common Desktop Environment, and GNOME.

Getting to Know Mailer

Within the Common Desktop Environment, Mailer is the only mail program. Easily accessible from the Control Panel (click the inbox icon), it's likely that the program will launch the first time without any inbox or configuration, as shown in Figure 5-1.
[figure 1]
Figure 5-1: Mailer with no messages

Configuring the program

To configure the program, choose Mailbox -> New Mailbox. This opens the dialog box shown in Figure 5-2.

You can set up a local mailbox, as discussed in this section, but Mailer will probably automatically recognize a local mailbox without any additional effort.
[figure 2]
Figure 5-2: The Mailer configuration dialog box.

An IMAP connection

Many Solaris users have their mail centrally stored on an IMAP server. To configure an IMAP connection, click the IMAP Server button near the top of the configuration dialog box. This opens the IMAP configuration dialog box, shown in Figure 5-3.
[figure 3]
Figure 5-3: The IMAP configuration dialog box.
  • Password: If you're concerned about security, you don't have to enter your password in this dialog box. Mailer will prompt you for a password each time it checks your incoming mailbox.
  • Retrieve Attachments: You have the option to retrieve attachments automatically, or leave these potentially large additions on the server until you determine whether they're worth downloading.
On most systems, your connection to the mail server is sufficiently speedy that there's rarely any visible slowdown for retrieving all attachments. You can configure this option either way without a problem.
E-mail within Solaris is less susceptible to viruses than Windows programs -- a reason to cheer, and a reason to be less paranoid about the possible dangers lurking in e-mail attachments.

Using a Local Mailbox Instead

If you don't have an IMAP account, you can specify your mailbox by clicking Local in the configuration dialog box and then searching for the specific mailbox in question, as shown in Figure 5-4.
[figure 4]
Figure 5-4: Finding a local mailbox.

Viewing the mailbox

After the mailbox is identified, the program
  • opens the mailbox,
  • scans through all the messages,
  • presents an attractive and easy to navigate view of all the messages, as shown in Figure 5-5.
[figure 5]
Figure 5-5: Viewing a mailbox in Mailer.
In this default mailbox view, here's what you see:
  • The top pane is a table of contents of all messages.
  • The middle area shows a summary of the mailbox and a set of control elements.
The mailbox in Figure 5-5 contains 575 messages and message 568 is currently shown.

From left to right, the Mailer toolbar contains these controls:
  • Delete
  • Move down the list to the next message
  • Move up the list to the previous message
  • Reply
  • Forward
  • Compose a new e-mail message
  • Print message
  • The bottom pane of the window is the specific message in question, formatted in an attractive manner.
In the top pane, each message lists the sender, subject, date and time sent, and size listed in the top pane, and an optional status indicator of a diamond or N for new messages. (By default, the message list pane sorts the messages by date sent, oldest to newest.)

The message view window shows almost all headers in an e-mail message, screening out a few by default. If you want to hide more of the headers (such as X-UIDL and MIME-Version), search for message view preferences in the Help system (see the top-right corner of the Mailer menu bar).

Mailer doesn't understand how to display messages using fancy formatting (typically HTML). If you receive lots of newsletters from Web sites, some messages may be unreadable in Mailer. Mailer recognizes and activates all Web site addresses it encounters in messages: In Figure 5-5, the URL for the Frontier Airlines Web site is in a different color. Click that, and the site opens in the Web browser.

If the message has an attachment, the bottom pane shows the attachment in icon form, indicating the file's name and type. In Figure 5-5, Mailer recognizes an HTML format attachment and displays it. Right-click on the attachment to see a variety of options for saving, opening, or editing the file.

Changing the sorting order

The default setting of sorting messages from oldest to newest is usually a good choice. If you want to sort the messages by sender, subject, and so on, click the View menu, as shown in Figure 5-6.
[figure 6]
Figure 5-6: Mailbox sorting options for Mailer.
If your mailbox contains a ton of messages, it may be useful to sort the messages by sender and then select all of those messages and save them in a new mailbox for that sender. Right-click the set of selected messages and choose the option to save to a new mailbox.

Sending mail

Sending mail and responding to messages from others are the two most common Mailer tasks.

Responding to a message

To respond to a message, follow these steps:
  1. Select the original message.


    For example, I selected a Frontier Airlines message. I want to reply to thank the airline for its lovely holiday wishes.
  2. Click the reply icon (the one with the letter and the blue arrow pointing to the person) or choose Compose --> Reply.

    A message window opens, as shown in Figure 5-7.
    [figure 7]
    Figure 5-7: Responding to an e-mail message.
  3. By default, the Reply button includes the text: If you don't want to include the original text with your reply, choose Reply from the Compose menu.

    The original message text is included at the top of the new message. The original text is prefaced by a > on each line, by convention.

    As a matter of good form and netiquette, I deleted the extraneous material in my response, as shown in Figure 5-7, before typing in a response.
  4. Fill in the appropriate fields as desired.

    The compose window has five input areas:
    • To
    • Subject
    • Cc
    • The message body
    • An attachment area for dragging and dropping attachment files or pictures
    When you reply to an existing message, the To and Subject fields are automatically filled in. Both the message body and attachment windows have useful pop-up menus; just right-click in the appropriate space. This is also an easy way to add attachments.
  5. When the message is ready to send, click the Send button, and away it goes.

Creating a new message

Creating a new e-mail message is just about as simple as replying to one:
  1. Click the Compose icon on the toolbar. (It's the icon that looks like a blank piece of paper with a pencil laying on top.)

    A blank New Message window opens.
  2. Type in an address, subject, message, and so on.

    Figure 5-8 shows an example message.
  3. When you've finished composing the message, click Send.
[figure 8]
Figure 5-8: Composing a new message in Mailer.
Mailer is a good, simple e-mail program that lets you manage a simple flow of incoming and outgoing e-mail. However, its inability to render HTML messages and lack of sophisticated filtering and other modern amenities make it feel dated compared to many of the other choices available.

Using Netscape Messenger

The alternative mail application for GNOME users (and CDE users, if desired) is a part of Netscape Navigator, as included with Solaris 9.

Configuring an e-mail account

Follow these steps to configure an e-mail account:
  1. Launch Netscape 7.
  2. Click the Window menu.

    This menu offers a variety of options, as shown in Figure 5-9.
    If you don't have Netscape 7 on your Solaris system, it's an extremely worthwhile download. Go to [dead link] sun.com/netscape to get started.
    [figure 9]
    Figure 5-9: The many faces of Netscape 7.
  3. Choose Mail & Newsgroups.

    A window opens, indicating that you haven't configured the e-mail preferences yet, as shown in Figure 5-10.
    [figure 10]
    Figure 5-10: No e-mail accounts have been added to Netscape.
  4. Choose Create a New Account.

    A window asks what type of account you want to create.
  5. Select the default value, Email Account. Click Next to proceed.
  6. In a manner similar to Windows task wizards, Netscape prompts you, window by window, for the information needed to create the new e-mail account. Follow the prompts.

    Figure 5-11 shows the first window, asking for your name and e-mail address.
    [figure 11]
    Figure 5-11: Personal identity settings in Netscape.
  7. Once you've entered the appropriate information, click Next again to configure your POP or IMAP server and your outbound mail server information.

    In Figure 5-12, the wizard recognized that I configured my outbound mail server when I first set up the Web browser. It shows me that the outbound mail server is set to mail.attbi.com instead of prompting me to specify a new server.
    [figure 12]
    Figure 5-12: Specifying incoming mail server settings.
  8. To configure an incoming mail server, enter the server name as supplied by your ISP or system administrator.
  9. Specify the type of server you'll be accessing (POP or IMAP) and click Next to somewhat redundantly enter your e-mail account name.
  10. Label this account, if you want.

    Netscape 7 supports multiple e-mail accounts, but you'll probably leave the default user@host value shown.

    After you deal with the label, a summary of all values is shown.
  11. Click Finish to set up the account.
I also set up an account that allows easy access to an America Online mailbox. Figure 5-13 shows how the mailbox is displayed.

Examining the Netscape window

Netscape 7 has an attractive display, as shown in Figure 5-13. The main window consists of four main areas by default:
[figure 13]
Figure 5-13: Netscape 7 displaying new e-mail in the Inbox.
  • A list of folders and accounts in the upper-left pane
  • A sidebar (which you can remove by clicking the X button) in the lower- left pane
  • A list of messages in the current folder or mailbox in the upper-right pane
  • The current message in the lower-right pane
Netscape can render complex HTML e-mail messages, as shown in the message at the bottom of Figure 5-13. This display of portable fishing scales, while perhaps a bit lame, is more attractive than the primitive display of the Frontier Airlines message in the CDE Mailer program (see "Working with incoming mail," earlier in this chapter).

These are some of the folders in the upper-left pane:
  • Sent Mail: By default, a copy of all messages you send are saved in the Sent Mail folder.
  • Mail: Messages you've read but haven't filed or otherwise disposed can later be found in the Old Mail folder.
  • Deleted Mail folder: This folder stores messages that you have marked for deletion. You can retrieve them if you change your mind.
Similar to Mailer, the main Netscape 7 toolbar offers quick access to the main functions of the mail program, as shown in Figure 5-14. Most of these buttons should be familiar if you've sent e-mail and used a Web browser. Netscape checks for new mail every ten minutes by default. (You can change that setting in your Preferences.) You can force a quick check by clicking the Get Msgs button.
[figure 14]
Figure 5-14: The Netscape toolbar.

Menu options and sorting

The available menus in Netscape are File, Edit, View, Go, Message, Tools, Window, and Help.

Sorting is one of the many options available on the View menu, as shown in Figure 5-15. If you thought Mailer had a lot of mailbox sorting options, you'll be even more impressed with Netscape, which has 22 ways to organize your view. As with Mailer, the default sorting order in Netscape is likely to keep you happy for years of e-mail activity.
[figure 15]
Figure 5-15: Sorting options and the View menu.
The Message menu, shown in Figure 5-16, offers options for creating a message. The most interesting and unusual option on this menu is Edit Message as New, which lets you edit messages you've received. This sounds kind of wacky, but I find it quite useful to improve subject lines on messages before I save them to an archive folder: "Skylight Bid from Outlook Renovation, without painting" is a much better subject than "Re: Remodeling" when you're later digging around the folder.

You can access your Address Book by using the Tools menu (refer to Figure 5-9). The Address Book is a handy feature that enables you to manage a list of everyone with whom you send and receive e-mail.
[figure 16]
Figure 5-16: The Message menu.

Sending and responding to e-mail

To respond to an e-mail message, click the Reply button on the navigation bar, or choose Message --> Reply (refer to Figure 5-16). Figure 5-17 shows the beginning of my response to the note about the fishing scale.
[figure 17]
Figure 5-17: Responding to an e-mail message.
A remarkable number of options are available to customize your e-mail message. The most important thing to notice about the composition window is that, by default, messages are composed and sent in HTML format. If your recipient is using Mailer, well, there's a mismatch. For many user communities, HTML-friendly e-mail programs are quite common, and the most popular Windows and Mac e-mail applications all support rich, colorful HTML.

An important capability in Navigator is the spell checker. Click the Spell button on the navigation bar, and the program helps you avoid looking foolish with spelling hiccups. It can't help with grammar and word choice, but it is a terrific addition to the mail program.

In the panel with the To address, the To button is actually a pull-down menu. You can specify that an address should actually be a Cc or Bcc address instead.

Choose the Options menu, and you'll see a number of useful message options, as shown in Figure 5-18. You can encrypt and digitally sign messages, request a return receipt, and assign various priorities.

If you're sending attachments, you can specify how the attachments should be packaged to ensure that they arrive at their destination in a useable format. You can safely leave the default configuration unless you're getting complaints from colleagues, in which case I recommend working with your system administrator to determine the ideal settings.

[figure 18]
Figure 5-18: Message Options menu.
The Format submenu lets you choose HTML-only messages (the default), text only messages (no different typefaces, no colors, and so on), or a hybrid of both plain text and fancy HTML. Recipients are shown one or the other based on the sophistication of their mail program.

The hybrid option might sound ideal, but remember this means that two copies of every message are sent to each recipient, a fancy HTML version and a plain text version. If your messages are a half-dozen lines, that's no big deal. But if you regularly send friends or colleagues 10 to 20 page messages, they might get testy about the waste of bandwidth and disk space.

To write a new message, you just follow a simple process:
  1. Create a new document with one of these steps:
    • Click the Compose icon on the toolbar
    • Choose Message -> New Message.
  2. Add the information to the document:
    • Address
    • Subject
    • Message text.
Figure 5-19 shows an example message.
[figure 19]
Figure 5-19: A new message, partially composed.
The Netscape mail program is very sophisticated and has many more options than I have room to cover in this chapter. If you opt to use this e-mail program, I suggest using the Help menu to explore the program's capabilities. You may also want to go through the different panels of the Preferences area to customize the program to your liking.

Command Line Communication

I stick with Berkeley mail, mailx, because it is included with Solaris 9 and has long been a part of the Sun operating system. It's not sexy but offers a surprisingly efficient mechanism for working with electronic mail.
Without additional software, mailx cannot interact with POP or IMAP mailboxes. If you're using Solaris to process mail that comes via an ISP or is sequestered on a central mail server until you grab it, you need to move up to a graphical mail application, as profiled a bit later in this chapter.

Freeware POP and IMAP applications, most notably fetchmail, are available for Solaris, but you need to have your system administrator install them from the Internet. To find out more about fetchmail, Google it!

Sending mail with mailx

Whether or not you can receive your e-mail at the command line, it's likely you can send a quick message using mailx. By default, Solaris 9 is configured properly to send out messages if your system is on the Internet.

To send a message, follow these steps:
  1. Type mailx followed by the email address of the intended recipient or recipients.

    It'll then prompt for a subject.
  2. Enter as much text as you'd like, ending with a Ctrl-D:
    $ mailx taylor@test-site.com
    Subject: Thanks for all the fish!

    Just wanted to send a quick note saying "thanks" for ...
    This is part of a sample message.
    • The mailx program lets you type in as much material as you'd like.
    • You can even cut and paste other text.
When you're done entering the message, press Ctrl+D (press the Control key down and, while it's depressed, press D) on its own line to complete the message:
... all the fish.

Dave

EOT
$
The EOT (end of text) is output when you press Ctrl+D. That's it. The message is now on its way to the recipient somewhere on the Internet.

The mailx program offers some additional message capabilities, and you can generate a list of them with the sequence ~? on its own line. Rather than list them all, however, here are the most useful of the escape commands:
~?
-------------------- ~ ESCAPES ----------------------------
~b users Add users to Bcc list
~c users Add users to Cc list
~e Edit the message buffer
~f messages Read in messages, do not right-shift
~h Prompt for Subject and To, Cc and Bcc lists
~m messages Read in messages, right-shifted by a tab
~p Print the message buffer
~q,~Q Quit, save letter in $HOME/dead.letter
~r,~< file Read a file into the message buffer
~r,~< !command Read output from command into message
~R Mark message for return receipt
~s subject Set subject
~t users Add users to To list
~v Invoke (vi) display editor on message
~w file Write message onto file (no header)
~x Quit, do not save letter
~!command Run a shell command
~|,~^ command Pipe the message through the command
~? print this help message
-----------------------------------------------------------
To include the file gullivers.travels.txt at the end of a message, for example, type ~r gullivers.travels.txt on its own line. The commands ~e and ~v are useful for editing the message. (One uses your default editor, and the other uses the vi editor, as discussed in Chapter 12.)

Working with incoming mail

If your system is configured so that your e-mail lives in a local mailbox, you can read and respond to your e-mail from the command line and never have to take your hands off the keyboard.

To check your e-mail, use the mailx command but don't specify any arguments:
$ mailx
mailx version 5.0 Sat Apr 6 14:57:29 PST 2002 Type ? for help.
"/var/mail/taylor": 14 messages
>O 1 Midwifery Today Thu Dec 12 02:19 1038/41234 E-News 4:38 - Obstetric I
O 2 Robbie Dunlap Thu Dec 12 11:08 28/1210 <no subject>
O 3 Lori Kats Thu Dec 12 12:16 72/4086 Donna Eden Suggests: Ask
O 4 james@emissaryofli Fri Dec 13 02:20 41/3427 GREAT EXPERIMENT III
O 5 Figureskater Fri Dec 13 10:25 107/3967 Re: S-Mart Order
O 6 Lester, Emily Sat Dec 14 12:12 81/3511 RE: Hello!
O 7 Colette Donahue Sun Dec 15 10:00 73/2806 RE: chicken pox
O 8 Roy R. Dunlap Sun Dec 15 15:11 241/9813 Fwd: Fw: Re: one dollar
O 9 news@606shot.com Mon Dec 16 11:49 122/5160 [NVIC] 5 in 1 vaccine liv
O 10 Don Taylor Mon Dec 16 16:46 201/6620 (no subject)
O 11 FrontierAirlines@f Tue Dec 17 04:38 80/4614 Happy Holidays!
O 12 A Feehan Tue Dec 17 11:22 1113/82036 Hi
O 13 james@emissaryofli Tue Dec 17 15:04 42/4034 Washington Mobilizes For
O 14 Melissa Cohen Insu Tue Dec 17 15:56 51/1725 Re: cancellation of home
?
In the preceding example, 14 messages are in the mailbox /var/mail/taylor; they're listed from oldest to newest.

The fields from left to right are
  • The message status (O is old)
  • A unique message number
  • The sender
  • The date and time the message was sent
  • The size in lines/characters
  • The subject
For example, the first message is from Midwifery Today. It was sent Thursday, December 12th at 2:19, and is 1038 lines (41,234 characters) long. The subject of the message is E-News 4:38 - Obstetric I.

To read a message, type its index number at the ? prompt. For example, to read the message from Frontier Airlines (#11), type 11 at the prompt and then press Enter:

? 11
Message 11:
From FrontierAirlines@flyfrontier.com Tue Dec 17 04:38:04 2002
X-UIDL: b-;!!77K!!V\7"!\#k"!
X-Sender: FrontierAirlines@flyfrontier.com
Date: Tue, 17 Dec 2002 01:00:08 -0700
X-Sybari-Trust: b53a39e6 f6624f78 c4b24ea6 00000109
From: <FrontierAirlines@flyfrontier.com>
To: "taylor@test-site.com" <taylor@test-site.com>
Subject: Happy Holidays!
MIME-Version: 1.0

--MWZAlternativeMessage
Content-Type: text/plain

Happy Holidays from Frontier Airlines!
The employees of Frontier Airlines wish you a safe and happy holiday season.
We hope the new year brings you joyous travels and much prosperity!

Cancun and Mazatlan Sale Fares!!
For all the exciting sale details and to make reservations, visit
<http://www.frontierairlines.com>.

Spirit of the Web
Due to the high volume of air travelers expected over the weekend, Spirit
of the Web fares will not be offered this week. Thank you for your
continued support and look for a Spirit of the Web update on Tuesday,
December 24, 2002.
?
It's certainly not the most attractive e-mail message, but mailx does offer a crude, functional interface. To respond to the message, type reply at the ? prompt, or to ensure you're responding to the correct message, you can also type reply 11:
? reply
To: sow@flyfrontier.com
Subject: Re: Happy Holidays!

Thanks for your lovely note. Happy Holidays to you too!

Best,

DT

EOT
?

Again, the EOT is displayed when you press Ctrl+D to denote the end of message input. With a reply, the program automatically grabs the recipient's address and subject from the original message.

You can do more with mailx, and additional, more sophisticated e-mail programs are available for hard-core shell users, but you'll probably use a graphical mail program.

To find out more about mailx, check the extensive man page. To learn about Elm, Pine, Mutt, and other alternative e-mail programs, check out www.sunfreeware.com.


Note that this is but a sample chapter of the book Solaris 9 for Dummies. The book contains twenty chapters just as jam-packed with useful information for everyone seeking to become productive with Solaris.
Explore Solaris 9 for Dummies!
[book cover]
Book Home
Table of Contents
Read a sample chapter
Book errata
Cool Web Links
Talk about it!
About the author
Buy the book


Other books by author Dave Taylor
Wicked Cool Shell Scripts (NoStarch Press)
Creating Cool Web Sites with HTML, XHTML and CSS (J. Wiley)
Learning Unix for Mac OS X (O'Reilly & Associates)
Teach Yourself Unix in 24 Hours (Sams/Macmillan)
Teach Yourself Unix System Administration in 24 Hours (Sams/Macmillan)
Dynamic HTML Weekend Crash Course (Wiley)
Creating Cool HTML 4 Web Pages (Wiley)


Design © 2003 and beyond, Dave Taylor.
For Dummies, the Dummies Man logo and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates and may not be used without written permission.