Skip to content

serialcmd.1

Manvendra Bhangui edited this page Feb 25, 2024 · 3 revisions

NAME

serialcmd - Pipe files through a command

SYNOPSIS

serialcmd prefix command

DESCRIPTION

serialcmd is similar to serialsmtp and serialqmtp, except that it runs command under /bin/sh, with the message as its standard input. serialcmd ensures that the standard input is seekable, so scripts can review the message as often as desired, for example to perform multiple actions on the same message.

At the moment, prefix is ignored. It cannot be omitted, however, and may be used for something in the future.

The standard output of command is assumed to be a one-line, LF-terminated, human-readable status message. This message is printed to the standard output of serialcmd, preceeded by a null-terminated filename and a status byte, as required by maildirserial. Status is determined by the exit status of program.

EXIT CODES

command's exit codes are interpreted as follows: 0 means that the message was successfully processed (and so will be deleted from the maildir); 100 means that processing has failed permanently for the message; 111 means that processing has failed but should be tried again later.

For compatability with sendmail-oriented filters, exit codes 64, 65, 70, 76, 77, 78, and 112 are also considered fatal errors, and other exit codes are considered temporary errors, as in qmail-command(8). New filters should not rely on this behavior.

ENVIRONMENT VARIABLES

The variable AGE is set to the number of seconds elapsed since the message was stored in the maildir. Further, serialcmd tries to set the same environment variables as qmail-local, but some cannot be set since they are not known when invoking serialcmd: NEWSENDER cannot be known; DEFAULT cannot be reliably determined; and EXT, EXT1, EXT2, EXT3, and EXT4 can only be guessed (but are likely to be guessed correctly).

For setting the USER and HOME environment variables, serialcmd uses getpwuid(3) and getpwnam(3) from glibc(7). It can use qgetpwuid(3) and qgetpwnam(3) if the environment variable USE_QPWGR is set.

The remaining variables specified in qmail-command(8) are set identically by serialcmd.

In addition to variables explicitly set by serialcmd, any variables inherited by serialcmd will be passed to command.

SEE ALSO

qmail-command(8), maildircmd(1), serialsmtp(1), env(1)

Clone this wiki locally