/*++ /* NAME /* pipe_command 3 /* SUMMARY /* deliver message to external command /* SYNOPSIS /* #include <pipe_command.h> /* /* int pipe_command(src, why, key, value, ...) /* VSTREAM *src; /* DSN_BUF *why; /* int key; /* DESCRIPTION /* pipe_command() runs a command with a message as standard /* input. A limited amount of standard output and standard error /* output is captured for diagnostics purposes. /* /* If the command invokes exit() with a non-zero status, /* the delivery status is taken from an RFC 3463-style code /* at the beginning of command output. If that information is /* unavailable, the delivery status is taken from the command /* exit status as per <sysexits.h>. /* /* Arguments: /* .IP src /* An open message queue file, positioned at the start of the actual /* message content. /* .IP why /* Delivery status information. The reason attribute may contain /* a limited portion of command output, among other free text. /* .IP key /* Specifies what value will follow. pipe_command() takes a list /* of macros with arguments, terminated by CA_PIPE_CMD_END which /* has no argument. The following is a listing of macros and /* expected argument types. /* .RS /* .IP "CA_PIPE_CMD_COMMAND(const char *)" /* Specifies the command to execute as a string. The string is /* passed to the shell when it contains shell meta characters /* or when it appears to be a shell built-in command, otherwise /* the command is executed without invoking a shell. /* One of CA_PIPE_CMD_COMMAND or CA_PIPE_CMD_ARGV must be specified. /* See also the CA_PIPE_CMD_SHELL attribute below. /* .IP "CA_PIPE_CMD_ARGV(char **)" /* The command is specified as an argument vector. This vector is /* passed without further inspection to the \fIexecvp\fR() routine. /* One of CA_PIPE_CMD_COMMAND or CA_PIPE_CMD_ARGV must be specified. /* .IP "CA_PIPE_CMD_CHROOT(const char *)" /* Root and working directory for command execution. This takes /* effect before CA_PIPE_CMD_CWD. A null pointer means don't /* change root and working directory anyway. Failure to change /* directory causes mail delivery to be deferred. /* .IP "CA_PIPE_CMD_CWD(const char *)" /* Working directory for command execution, after changing process /* privileges to CA_PIPE_CMD_UID and CA_PIPE_CMD_GID. A null pointer means /* don't change directory anyway. Failure to change directory /* causes mail delivery to be deferred. /* .IP "CA_PIPE_CMD_ENV(char **)" /* Additional environment information, in the form of a null-terminated /* list of name, value, name, value, ... elements. By default only the /* command search path is initialized to _PATH_DEFPATH. /* .IP "CA_PIPE_CMD_EXPORT(char **)" /* Null-terminated array with names of environment parameters /* that can be exported. By default, everything is exported. /* .IP "CA_PIPE_CMD_COPY_FLAGS(int)" /* Flags that are passed on to the \fImail_copy\fR() routine. /* The default flags value is 0 (zero). /* .IP "CA_PIPE_CMD_SENDER(const char *)" /* The envelope sender address, which is passed on to the /* \fImail_copy\fR() routine. /* .IP "CA_PIPE_CMD_ORIG_RCPT(const char *)" /* The original recipient envelope address, which is passed on /* to the \fImail_copy\fR() routine. /* .IP "CA_PIPE_CMD_DELIVERED(const char *)" /* The recipient envelope address, which is passed on to the /* \fImail_copy\fR() routine. /* .IP "CA_PIPE_CMD_EOL(const char *)" /* End-of-line delimiter. The default is to use the newline character. /* .IP "CA_PIPE_CMD_UID(uid_t)" /* The user ID to execute the command as. The default is /* the user ID corresponding to the \fIdefault_privs\fR /* configuration parameter. The user ID must be non-zero. /* .IP "CA_PIPE_CMD_GID(gid_t)" /* The group ID to execute the command as. The default is /* the group ID corresponding to the \fIdefault_privs\fR /* configuration parameter. The group ID must be non-zero. /* .IP "CA_PIPE_CMD_TIME_LIMIT(int)" /* The amount of time the command is allowed to run before it /* is terminated with SIGKILL. A non-negative CA_PIPE_CMD_TIME_LIMIT /* value must be specified. /* .IP "CA_PIPE_CMD_SHELL(const char *)" /* The shell to use when executing the command specified with /* CA_PIPE_CMD_COMMAND. This shell is invoked regardless of the /* command content. /* .RE /* DIAGNOSTICS /* Panic: interface violations (for example, a zero-valued /* user ID or group ID, or a missing command). /* /* pipe_command() returns one of the following status codes: /* .IP PIPE_STAT_OK /* The command has taken responsibility for further delivery of /* the message. /* .IP PIPE_STAT_DEFER /* The command failed with a "try again" type error. /* The reason is given via the \fIwhy\fR argument. /* .IP PIPE_STAT_BOUNCE /* The command indicated that the message was not acceptable, /* or the command did not finish within the time limit. /* The reason is given via the \fIwhy\fR argument. /* .IP PIPE_STAT_CORRUPT /* The queue file is corrupted. /* SEE ALSO /* mail_copy(3) deliver to any. /* mark_corrupt(3) mark queue file as corrupt. /* sys_exits(3) sendmail-compatible exit status codes. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.19Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.