mail_pipe(1M) mail_pipe(1M)
NAME
mail_pipe - invoke recipient command for incoming mail
SYNOPSIS
mail_pipe [-x debug_level] -r recipient -R path_to_sender -c content_type
-S subject
DESCRIPTION
When a new mail message arrives, the mail command first checks
the recipient's forwarding file, /var/mail/:forward/user, to
see if the message is to be forwarded elsewhere (to some other
recipient or as the input to some command). If the message is
to be piped into a recipient-specified command, mail invokes
mail_pipe to do some validation and then execute the command
in the context of the recipient.
Command-line arguments are:
-x debug_level Turn on debugging for this invocation. See
the description of the -x option for the
mail command for details.
-r recipient The recipient's login id.
-R path_to_sender The return address to the message's
originator.
-c content_type The value of the Content-Type: header line
in the message.
-S subject The value of the Subject: header line in the
message if present.
mail_pipe is installed as a privileged process thus enabling
itself to change it's user and group ids to that of the
recipient as necessary.
When invoked, mail_pipe performs the following steps (if a
step fails, the exit code is noted as [N]):
Validate invocation arguments [1].
Verify that recipient name is < 14 characters long [2].
Copyright 1994 Novell, Inc. Page 1
mail_pipe(1M) mail_pipe(1M)
Verify that the setuid flag for the recipient mailbox is
set and that the file is owned by the recipient [3].
Open /var/mail/recipient [4].
Verify that recipient's mailbox starts with the string
Forward to [5].
Find command string (prefaced with either `|' or `>|')
in the forwarding file [6].
Find entry for recipient in /etc/passwd [7].
Set gid to recipient's gid [8].
Set uid to recipient's uid [9].
Change current directory to recipient's login directory
[10].
Allocate space to hold newly exec'ed environment for
recipient command [11].
Parse the recipient command, performing any %keyletter
expansions required. See the `Forwarding mail' section
of mail(1), for more information regarding %keyletter
substitutions [12].
Execute recipient command [13 if exec fails, otherwise
exit code from recipient command itself].
ENVIRONMENT
The command is executed with an environment of
PATH=/usr/bin:/usr/lbin:, SHELL=/usr/bin/sh, LOGNAME, HOME,
and TZ. The value of LOGNAME and HOME are set according to
the information found within /etc/passwd. The value of TZ is
passed through from the mail command.
FILES
/etc/passwd to identify sender and locate recipients
/var/mail/:forward/recipient
forwarding information for recipient
/var/mail/recipient
incoming mail for recipient; that is, the
mail file
Copyright 1994 Novell, Inc. Page 2
mail_pipe(1M) mail_pipe(1M)
/tmp/MLDBG* debug trace file
/usr/lib/mail/mail_pipe
mail_pipe program
REFERENCES
mail(1), notify(1), vacation(1)
Copyright 1994 Novell, Inc. Page 3