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 tried to send mail to amigos, he would receive 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 sent mail to amigos, your mail arrives as though you had typed everyone's names as recipients. It is not apparent to the recipients that you used a mail alias to send the mail.
.mailrc is located in your home directory. This file contains a number of 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 example above 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 Editorfor instructions.
Each mail alias is contained on one line of the file; that is, it 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 example below shows two mail aliases. The first (amigos) contains three people. The second (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, just address it to the mail alias name. Do not include your machine name. For example, if you sent the following:
$ 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? |