Sets defaults for the mail command.
The .mailrc file can be placed in your $HOME directory to personalize the Mail program. You can create the .mailrc file with any ASCII editor. Once the file is created, the Mail program reads the file when you send or read mail, and applies the options you have set. In the file, you can define aliases for other users' mail addresses. You can also change the way mail is displayed and stored on your system.
The Mail program uses a master file in the same format, /usr/share/lib/Mail.rc. Options you set in your $HOME/.mailrc file override comparable options in the Mail.rc file.
A line that begins with a # (pound sign) followed by a space is treated as a comment. The Mail program ignores the entire line and any entries or options it contains.
Use the following mail subcommands as entries in the .mailrc file:
alias NewAlias { Address... | PreviousAlias... } | |
Defines an alias or distribution list. The alias can be defined as an actual mail address, or as another alias defined in a previous entry in the .mailrc file. To define a group, enter multiple addresses or previous aliases separated by spaces. | |
ignore FieldList | Adds the header fields in the FieldList parameter to the list of fields to be ignored. Ignored fields are not displayed when you look at a message with the type or print subcommand. Use this subcommand to suppress machine-generated header fields. Use the Type or Print subcommand to print a message in its entirety, including ignored fields. |
set [OptionList | Option=Value...] | |
Sets an option. The argument following the set option can be either an OptionList giving the name of a binary option (an option that is either set or unset) or an Option=Value entry used to assign a value to an option. | |
unset OptionList | Disables the values of the options specified in OptionList. This action is the inverse of the set OptionList entry. |
Use the set entry to enable options and the unset entry to disable options. Add the options you want to set or unset to the $HOME/.mailrc file. The options and the actions they generate are as follows:
You can use a set entry to assign values to the following options. For example, enter set screen=20 to limit headers to 20 lines per screen.
crt=Lines | Defines the number of lines of a mail message the Mail program displays before pausing for input (this option starts the pg command to control the scrolling). |
EDITOR=Editor | Gives the full path name of the editor to be started with the e mailbox subcommand or the ~e mail editor subcommand. The default editor is /usr/bin/e. |
escape=Character | Changes the escape character used for mail editor subcommands. The default character is ~ (tilde). |
folder=PathName | Gives the path name of a directory in which to store mail folders. Once the directory is defined, you can use the + (plus sign) notation to refer to it when using the FileName parameter with mailbox subcommands. |
record=FileName | Defines a file in which to record outgoing mail. The path name must be
absolute (that is, a full path name), or be
given relative to the
current
directory.
Note: If you set up a file to record outgoing messages, read the file periodically with the mail -f command and delete unnecessary messages. Otherwise, the file will grow and eventually use all of your storage space. |
screen=Lines | Defines the number of lines of message headers displayed (for example, in response to the h mailbox subcommand) before pausing for input. |
toplines=Lines | Defines the number of lines displayed by the top mailbox subcommand. |
VISUAL=Editor | Gives the full path name of the editor to be started with the v mailbox subcommand or the ~v mail editor subcommand. The default editor is /usr/bin/vi. |
ignore message-id receivedWhen messages are displayed in the mailbox, the machine message ID number and the date your system received the message are not displayed.
set folder=/home/kaye/notesTo save message 1 from the mailbox in the folder procedures, enter the following at the mailbox prompt (&):
s 1 +procedureMessage 1 is saved in the /home/kaye/notes/procedures file (if the file already exists, the message is appended to the file).
set record=/home/pierre/letters/mailout set folder=/home/pierre/lettersOutgoing mail is placed in the /home/pierre/letters/mailout file, and can be read with the following command:
mail -f +mailout
set autoprint metooThe autoprint option causes the next message to be displayed whenever you delete a message. The metoo option causes the Mail program to send a copy of messages to you when it expands mail aliases. By default, the Mail program discards your user address when it expands an alias, so that you do not get a copy of mail you send.
unset askccThis entry prevents the mail editor from requesting a carbon copy list when you create messages, even if the askcc option is set in the Mail.rc file.
alias george george@thor.valhalla.dbm.comm alias bill @odin.UUCP:@depta.UCCP:@deptb:bill@deptc alias mygroup amy@cleo george billTo send mail to user bill using his alias, enter:
mail billTo send mail to everyone in the mygroup list, enter:
mail mygroupWhen you complete and send the message, the mail command actually addresses it as follows:
amy@cleo george@thor.valhalla.dbm.comm @odin.UUCP:@depta.UCCP: @deptb:bill@deptc
This file is part of the Base Operating System.
/usr/share/lib/Mail.rc | Contains systemwide defaults for the Mail program. |
$HOME/.mailrc | Contains user-specific defaults for the Mail program. |
Mail Editor Subcommands for the mail, Mail Command.
Mailbox Subcommands for the mail, Mail Command.
Creating and Sending Mail, Customizing the Mail Program, Mail Overview, Receiving and Handling Mail in AIX Version 4.3 System User's Guide: Communications and Networks.