|
|
1.1 ! root 1: '\"macro stdmacro ! 2: .if n .pH g1a.mail_pipe %W% of %G% ! 3: .if \nX=0 .ds x} mail_pipe 1M "Essential Utilities" "\&" ! 4: .if \nX=1 .ds x} mail_pipe 1M "Essential Utilities" ! 5: .if \nX=2 .ds x} mail_pipe 1M "" "\&" ! 6: .if \nX=3 .ds x} mail_pipe "" "" "\&" ! 7: .nr X ! 8: .TH \*(x} ! 9: .SH NAME ! 10: \f4mail_pipe\f1 \- invoke recipient command for incoming mail ! 11: .SH SYNOPSIS ! 12: .PP ! 13: \f4mail_pipe\f1 ! 14: [ ! 15: \f4\-x\f1 ! 16: .I debug_level ! 17: ] ! 18: \f4\-r\f1 ! 19: .I recipient ! 20: \f4\-R\f1 ! 21: .I path_to_sender ! 22: \f4\-c\f1 ! 23: .I content_type ! 24: \f4\-S\f1 ! 25: .I subject ! 26: .SH DESCRIPTION ! 27: When a new mail message arrives, ! 28: the \f4mail\fP command first checks if the recipient's mailbox indicates ! 29: that the message is to be forwarded elsewhere (to some other recipient or ! 30: as the input to some command). ! 31: If the message is to be piped into a recipient-specified command, ! 32: \f4mail\fP invokes \f4mail_pipe\fP to do some validation and then execute ! 33: the command in the context of the recipient. ! 34: .PP ! 35: Command-line arguments are: ! 36: .PD 0 ! 37: .TP 18 ! 38: \f4\-x\fP \f2debug_level\fP ! 39: Turn on debugging for this invocation. See the description of the \f4\-x\fP ! 40: option for the \f4mail\fP command for details. ! 41: .TP ! 42: \f4\-r\fP \f2recipient\fP ! 43: The recipient's login id. ! 44: .TP ! 45: \f4\-R\fP \f2path_to_sender\fP ! 46: The return address to the message's originator. ! 47: .TP ! 48: \f4\-c\fP \f2content_type\fP ! 49: The value of the \f4Content-Type:\fP header line in the message. ! 50: .TP ! 51: \f4\-S\fP \f2subject\fP ! 52: The value of the \f4Subject:\fP header line in the message if present. ! 53: .PD ! 54: .PP ! 55: \f4mail_pipe\fP is installed as a setuid-to-root process, ! 56: thus enabling itself to change it's user and group ids to that of the ! 57: recipient as necessary. ! 58: .PP ! 59: When invoked, ! 60: \f4mail_pipe\fP performs the following steps (if a step fails, the exit ! 61: code is noted as [\f2N\f1]): ! 62: .PD 0 ! 63: .TP 3 ! 64: \- ! 65: Validate invocation arguments [\f41\f1]. ! 66: .TP 3 ! 67: \- ! 68: Verify that recipient name is \(<= 14 characters long [\f42\f1]. ! 69: .TP 3 ! 70: \- ! 71: Verify that the setgid flag for the recipient mailbox is set [\f43\f1]. ! 72: .TP 3 ! 73: \- ! 74: Open \f4/var/mail/\fP\f2recipient\fP [\f44\f1]. ! 75: .TP 3 ! 76: \- ! 77: Verify that recipient's mailbox starts with the string \f4Forward to\fP [\f45\f1]. ! 78: .TP 3 ! 79: \- ! 80: Find pipe symbol indicating start of command string in recipient ! 81: mailbox [\f46\f1]. ! 82: .TP 3 ! 83: \- ! 84: Find entry for recipient in \f4/etc/passwd\f1 [\f47\f1]. ! 85: .TP 3 ! 86: \- ! 87: Set gid to recipient's gid [\f48\f1]. ! 88: .TP 3 ! 89: \- ! 90: Set uid to recipient's uid [\f49\f1]. ! 91: .TP 3 ! 92: \- ! 93: Change current directory to recipient's login directory [\f410\f1]. ! 94: .TP 3 ! 95: \- ! 96: Allocate space to hold newly \f4exec\f1'ed environment for ! 97: recipient command [\f411\f1]. ! 98: .TP 3 ! 99: \- ! 100: Parse the recipient command, performing any \f4%\f2keyword\f1 expansions required. ! 101: See the `Forwarding mail' section of \f4mail\fP(1), for more information ! 102: regarding \f4%\f2keyword\f1 substitutions [\f412\f1]. ! 103: .TP 3 ! 104: \- ! 105: Execute recipient command [\f413\f1 if \f4exec\f1 fails, ! 106: otherwise exit code from recipient command itself]. ! 107: .PD ! 108: .SH FILES ! 109: .PD 0 ! 110: .TP 20 ! 111: \f4/etc/passwd\fP ! 112: to identify sender and locate recipients ! 113: .TP ! 114: \f4/var/mail/\f2recipient\f1 ! 115: incoming mail for \f2recipient\fP; ! 116: that is, the mail file ! 117: .TP ! 118: \f4/tmp/MLDBG\(**\fP ! 119: debug trace file ! 120: .TP ! 121: \f4/usr/lib/mail/mail_pipe\fP ! 122: mail_pipe program ! 123: .PD ! 124: .SH SEE ALSO ! 125: \f4mail\fP(1), ! 126: \f4notify\fP(1), ! 127: \f4vacation\fP(1)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.