Sends messages to system users and displays messages from system users.
To Display Messages
bellmail [ -e ] [ -fFile ] [ -p ] [ -q ] [ -r ]
To Send Messages
bellmail [ -t ] User ...
The bellmail command with no flags writes to standard output, one message at a time, all stored mail addressed to your login name. Following each message, the bellmail command prompts you with a ? (question mark). Press the Enter key to display the next mail message, or enter one of the bellmail subcommands to control the disposition of the message.
Use the User parameter to attach a prefix to messages you send. The bellmail command prefaces each message with the sender's name, date and time of the message (its postmark), and adds the message to the user's mailbox. Specify the User parameter by pressing End Of File (the Ctrl-D key sequence) or entering a line containing only a . (period) after your message.
The action of the bellmail command can be modified by manipulating the /var/spool/mail/UserID mailbox file in two ways:
Forward to person
This instruction causes all messages sent to the User parameter
to be sent to the Person parameter instead. The Forward to feature is useful for sending all of a person's mail to a particular
machine in a network environment.To specify a recipient on a remote system accessible through Unix-to-Unix Copy Program (UUCP), preface the User parameter with the system name and an ! (exclamation mark). The [ -t ] User. . .uucp command contains additional information about addressing remote systems.
Note: In order to use the remote mail function, UUCP must be completely configured.
If you are interested in writing your own third-party mail program, you may need to know the following locking mechanisms used by the bellmail command.
Item | Description |
---|---|
-e | Does not display any messages. This flag causes the bellmail command to return an exit value of 0 if the user has mail, or an exit value of 1 if there is no mail. |
-fFile | Reads mail from the named File parameter instead of the default mail file, /var/spool/mail/UserID. |
-p | Displays mail without prompting for a disposition code. This flag does not delete, copy, or forward any messages. |
-q | Causes the bellmail command to exit when you press Interrupt (the Ctrl-C key sequence). Pressing Interrupt (Ctrl-C) alone stops only the message being displayed. (In this case, the next message sometimes is not displayed until you enter the p subcommand.) |
-r | Displays mail in first-in, first-out order. |
-t | Prefaces each message with the names of all recipients of the mail. (Without this flag, only the individual recipient's name displays as addressee.) |
The User parameter is a name normally recognized by the login command. If the system does not recognize one or more of the specified User parameters or if the bellmail command is interrupted during input, the bellmail command tries to save the message in the dead.letter file in the current directory. If the bellmail command cannot save the message to the dead.letter file, it saves the message in the $HOME/dead.letter file. Once in this file, the message can be edited and sent again.
Note: The bellmail command uses the $MAIL environment variable to find the user's mailbox.
The following subcommands control message disposition:
Item | Description |
---|---|
+ | Displays the next mail message (the same as pressing the Enter key). |
- | Displays the previous message. |
!Command | Runs the specified workstation command. |
* | Displays a subcommand summary. |
d | Deletes the current message and displays the next message. |
m User | Forwards the message to the specified User parameter. |
p | Displays the current message again. |
q | Writes any mail not yet deleted to the /var/spool/mail/UserID file and exits. Pressing End Of File (Ctrl-D) has the same effect. |
s [File] | Saves the message in the named File parameter instead of in the default mail file, $HOME/mbox. |
w [File] | Saves the message, without its postmark, in the specified File parameter instead of in the default mail file, $HOME/mbox. |
x | Writes all mail unchanged to /var/spool/mail/UserID and exits. |
Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.
bellmail tom rachel
Don't forget the meeting tomorrow at 9:30 a.m.
Press Ctrl-D
at the end of the message. In this example, the system mails the message
to users tom and rachel. bellmail lance <proposal
In this example, the file proposal is sent to user lance. bellmail
After the
most recent message is displayed, a ? (question mark) indicates the bellmail command is waiting for one of the bellmail subcommands.
Enter help or an * (asterisk) to list the subcommands available.bellmail
This command displays each message mailed to
you. Press the Enter key after the ? prompt until the desired file
is displayed. When the appropriate file is displayed, enter:
In this example, the file is saved in the default mail file, $HOME/mbox.bellmail
This command displays each message mailed to you. Press the Enter
key after the ? prompt until the desired file is displayed. When the
appropriate file is displayed, enter: s mycopy
In this example, the file is saved in a file named mycopy, instead of in the default mail file.Item | Description |
---|---|
$HOME/dead.letter | Unmailable text. |
$HOME/mbox | Your personal mailbox. |
/usr/mail/*.lock | Lock for mail directory. |
/var/spool/mail/UserID | Default system mailbox for UserID. |
/usr/bin/bellmail | Bellmail program. |