BELLMAIL(1,C) AIX Commands Reference BELLMAIL(1,C) ------------------------------------------------------------------------------- bellmail PURPOSE Sends messages to system users and displays messages to system users. SYNTAX +--------+ +- -f $HOME/mbox -+ +-| +----+ |---| |-+ | +-| -q |-+ +- -f file -------+ | | ^| -r || | bellmail ---| || -p || |---| | |+----+| | | +------+ | +---- -e --------------------------+ one of +----------+ +----- -I ------+ | bellmail |---| +-----------+ |-- user --| | rmail | +-| -t |-+ ^ | +----------+ ^| -S || +------+ || -Dhomedir || || -Tlogfile || || -Llogfile || || -Mmsgid || |+-----------+| +-------------+ DESCRIPTION The bellmail command with no flags writes to all stored mail addressed to your login name, one message at a time, to standard output. 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 subcommands that control the disposition of the message (see "Subcommands"). When sending mail, you specify one or more users, and the bellmail command reads a message from standard input until you press the END OF FILE (Ctrl-D) key or enter a line containing only a . (period). The bellmail command prefixes the message with the sender's name and the date and time of the message (its postmark) and adds the message to the file $HOME/.newmail for each user specified on the command line. The action of bellmail can be modified in two ways by manipulating the file Processed July 12, 1991 BELLMAIL(1,C) 1 BELLMAIL(1,C) AIX Commands Reference BELLMAIL(1,C) $HOME/.newmail: o By default, the permissions on system mailbox files are read/write for the owner only (see the chmod command). You may change the permissions on the $HOME/.newmail file to allow access by others and bellmail will preserve your chosen permissions. o You can edit the file to contain as its first line: Forward to person This string causes all messages sent to user to be sent to person instead. The "Forward to" feature is especially useful for sending all of a person's mail to a particular machine in a network environment. Note: If sendmail is installed, modifying $HOME/.newmail to forward messages does not work. In this case, you must add a $HOME/.forward file, as described in "mail, Mail." To specify a recipient on a remote system which is available for uucp file transfer, prefix the system name and add an "!" (exclamation mark) before or after user. See "uucp" for details on addressing remote systems. Usually, user is a name recognized by the login command. It can also be the ASCII synonym that is automatically defined for any name that contains NLS code points. If the system does not recognize one or more of the specified users or if the bellmail command is interrupted during input, the command saves messages in the file $HOME/dead.letter to allow for editing and resending, unless the sendmail program is installed. In that case, mail to unknown users will be returned. If your login session is cut off while you are entering a message, and before you have completed sending, it will be saved in $HOME/dead.letter. By default, the sendmail.cf file invokes bellmail for local mail delivery. The -S, -D, -T, -L, and -M flags are primarily intended for use by mail agents such as sendmail. When sendmail invokes bellmail, mailer flag E should be set in /usr/adm/sendmail/sendmail.cf to escape lines beginning with "From" in the message. FLAGS -e Does not display any messages. This flag causes bellmail to return an exit value of 0 if the user has mail or an exit value of 1 if the user has no mail. -f file Reads mail from the named file instead of from the default system mailbox, $HOME/.newmail. Processed July 12, 1991 BELLMAIL(1,C) 2 BELLMAIL(1,C) AIX Commands Reference BELLMAIL(1,C) -p Displays mail, without prompting for a disposition code. This flag does not delete, copy, or forward any messages. (For disposition codes, see "Subcommands.") -q Causes the bellmail command to exit when you press the INTERRUPT (Ctrl-C) key. Normally, pressing this key stops only the message being displayed. (In this case, the next message sometimes does not display until you enter the p subcommand.) -r Displays mail in first-in, first-out order. -t Prefixes each message with the names of all recipients of the mail. (Normally, only the individual recipient's name appears as addressee.) -I Uses the INmail program for mail delivery. See the AIX PS/2 INmail/INnet/FTP User's Guide for more information about INmail. The -S, -D, -T, -L, and -M flags may not be used with the -I flag. -Dhomedir The user's home directory is homedir. Path must be absolute (start with /). When -D is specified, you may only give one user. -Llogfile -Tlogfile Logs activity to logfile. Problems accessing the logfile are ignored. The logfile should be mode 660 so unauthorized users cannot read it. -T means log trouble only (not success). It is recommended that you use /usr/adm/bellmail_log as the log file. -Mmsgid Message ID for logging. -S Does not reset user's uid. This option should be used if another program, such as sendmail, is invoking bellmail, and has already set the user's uid. If -S is not specified, bellmail looks up user in /etc/password and assumes the user's uid. SUBCOMMANDS The following subcommands control message disposition: + Displays the next mail message (the same result as pressing the Enter key). - Displays the previous message. d Deletes the current message and displays the next message. p Displays the current message again. s [file] Saves the message in the named file instead of in the default mail file, $HOME/mbox. Processed July 12, 1991 BELLMAIL(1,C) 3 BELLMAIL(1,C) AIX Commands Reference BELLMAIL(1,C) w [file] Saves the message, without its postmark, in the specified file instead of in the default mail file $HOME/mbox. m user Forwards the message to the named user. q Writes any mail not yet deleted to the file $HOME/.newmail and exits. Pressing the END OF FILE (Ctrl-D) key has the same effect. x Exits without changing $HOME/.newmail. Any changes or deletions you make during this use of bellmail will be rescinded. !AIX-cmd Runs the specified AIX command. * Displays a subcommand summary. EXAMPLES 1. To display mail: bellmail After the most recent message is displayed, a "?" (question mark) indicates that the bellmail command is waiting for you to enter one of the subcommands listed previously (for example, +, -, d, and p). Enter help or "*" (asterisk) to list the subcommands available. 2. To send mail to other users: bellmail tom rachel Don't forget the meeting tomorrow at 9:30. Ctrl-D In this example the system mails the message "Don't forget the meeting tomorrow at 9:30" to the users "tom" and "rachel". The Ctrl-D indicates the end of the message but is not sent with the text. 3. To send a file to another user: bellmail fran