Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mail_pipe(1M) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mail(1)

notify(1)

vacation(1)

mail_pipe(1M)                                                 mail_pipe(1M)

NAME
     mailpipe - invoke recipient command for incoming mail

SYNOPSIS
     mailpipe [-x debuglevel] -r recipient -R pathtosender
               -c contenttype -S subject

DESCRIPTION
     When a new mail message arrives, the mail command first checks if the
     recipient's mailbox indicates that 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 mailpipe to do some validation and then execute the command
     in the context of the recipient.

OPTIONS
     -x debuglevel    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 pathtosender The return address to the message's originator.

     -c contenttype   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.

     mailpipe is installed as a setuid-to-root program, thus enabling
     itself to change its user and group ids to that of the recipient as
     necessary.

     When invoked, mailpipe 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].

     -  Verify that the setgid flag for the recipient mailbox is set [3].

     -  Open /var/mail/recipient [4].

     -  Verify that recipient's mailbox starts with the string Forward to
        [5].

     -  Find pipe symbol indicating start of command string in recipient
        mailbox [6].

     -  Find entry for recipient in /etc/passwd [7].



Page 1                       Reliant UNIX 5.44                Printed 11/98

mail_pipe(1M)                                                 mail_pipe(1M)

     -  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 com-
        mand [11].

     -  Parse the recipient command, performing any %keyword expansions
        required. See the "Forwarding mail" section of mail(1), for more
        information regarding %keyword substitutions [12].

     -  Execute recipient command (13 if exec fails, otherwise exit code
        from recipient command itself).

FILES
     /etc/passwd
          to identify sender and locate recipients

     /var/mail/recipient
          incoming mail for recipient; that is, the mail file

     /tmp/MLDBG*
          debug trace file

     /usr/lib/mail/mailpipe
          mail_pipe program

SEE ALSO
     mail(1), notify(1), vacation(1).























Page 2                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026