nothing is impossible!!!!

nothing is impossible!!!!

Friday, July 25, 2008

Unix Command - mail


Mail is an intelligent mail processing system, which has a command syntax reminiscent of ed1 with lines replaced by messages.

Verbose mode. The details of delivery are displayed on the user's terminal.
Ignore tty interrupt signals. This is particularly useful when using mail on noisy phone lines.
Forces mail to run in interactive mode even when input isn't a terminal. In particular, the `~ ' special character when sending mail is only active in interactive mode.
Inhibits reading /etc/mail.rc upon startup.
Inhibits the initial display of message headers when reading mail or editing a mail folder.
Specify subject on command line (only the first argument after the -s flag is used as a subject; be careful to quote subjects containing spaces.)
Send carbon copies to list of users.
Send blind carbon copies to list List should be a comma-separated list of names.
Read in the contents of your mbox (or the specified file) for processing; when you quit mail writes undeleted messages back to this file.
Is equivalent to:

mail -f /var/spool/mail/user

Sending mail

To send a message to one or more people, mail can be invoked with arguments which are the names of people to whom the mail will be sent. You are then expected to type in your message, followed by an `control-D ' at the beginning of a line. The section below Replying to or originating mail describes some features of mail available to help you compose your letter.

Reading mail

In normal usage mail is given no arguments and checks your mail out of the post office, then prints out a one line header of each message found. The current message is initially the first message (numbered 1) and can be printed using the print command (which can be abbreviated `p ' ) . You can move among the messages much as you move between lines in ed1, with the commands `+ ' and `- ' moving backwards and forwards, and simple numbers.

Disposing of mail.

After examining a message you can delete `d ' ) the message or reply `r ' ) to it. Deletion causes the mail program to forget about the message. This is not irreversible; the message can be undeleted `u ' ) by giving its number, or the mail session can be aborted by giving the exit `x ' ) command. Deleted messages will, however, usually disappear never to be seen again.

Specifying messages

Commands such as print and delete can be given a list of message numbers as arguments to apply to a number of messages at once. Thus ``delete 1 2 '' deletes messages 1 and 2, while ``delete 1-5 '' deletes messages 1 through 5. The special name `* ' addresses all messages, and `$ ' addresses the last message; thus the command top which prints the first few lines of a message could be used in ``top * '' to print the first few lines of all messages.

Replying to or originating mail.

You can use the reply command to set up a response to a message, sending it back to the person who it was from. Text you then type in, up to an end-of-file, defines the contents of the message. While you are composing a message, mail treats lines beginning with the character `~ ' specially. For instance, typing `~m ' (alone on a line) will place a copy of the current message into the response right shifting it by a tabstop (see indentprefix variable, below). Other escapes will set up subject fields, add and delete recipients to the message and allow you to escape to an editor to revise the message or to a shell to run some commands. (These options are given in the summary below.)

Ending a mail processing session.

You can end a mail session with the quit `q ' ) command. Messages which have been examined go to your mbox file unless they have been deleted in which case they are discarded. Unexamined messages go back to the post office. (See the -f option above).