Note the following about setting up mail aliases in .mailrc:
Mail aliases in .mailrc are private. That is, only you can use them. For example, if you set up a mail alias called amigos in .mailrc and another user tries to send mail to amigos, he receives an unknown user error message.
When the mail is sent, .mailrc aliases are automatically expanded to show everyone on the mail alias. For example, if you send mail to amigos, your mail arrives as though you had typed everyone's names as recipients. The recipients do not know that you used a mail alias to send the mail.
.mailrc is located in your home directory. This file contains several settings that control the behavior of mailx and Mail Tool.
To add a mail alias to .mailrc, type:
$ vi ~/.mailrc |
You can use any text editor to edit the .mailrc file. The previous example shows the method for using the vi editor to edit the file. If you are not already familiar with vi, refer to Chapter 6, Using the vi Editor for instructions.
Each mail alias is contained on one line of the file. That is, the line can visually “wrap around” to another line, but it cannot contain carriage returns. Each mail alias should contain the following, separated by spaces:
The word “alias”
The name of the mail alias (must be one word)
The recipients (logins and machine names) in the mail alias, separated by spaces
The following example shows two mail aliases. The first alias (amigos) contains three people. The second alias (softball) contains eight. Notice in softball how the names are visually wrapped around on the screen. This is fine, as long as no carriage returns are used.
alias amigos hank@fretful george@lonesome sally@dakota alias softball earl@woofer tex@twister elmer@farmhouse jane@freeway hank@fretful jj@walker sally@dakota steve@hardway |
To send mail to people on a .mailrc alias, address the mail to the mail alias name. Do not include your machine name. Suppose that you sent the following message:
$ mail amigos Subject: Let's eat Hey Compadres. How about getting together for lunch on Friday? Anyone interested? |
The recipients would see the following (note the expanded To: line):
To: hank@fretful george@lonesome sally@dakota Subject: Let's eat Hey Compadres. How about getting together for lunch on Friday? Anyone interested? |