qmail-banner

Section: User Commands (1)
Index Return to Main Contents
 

NAME

qmail-banner - present a banner to an SMTP client  

SYNOPSIS

Invoked from tcpserver:

tcpserver ... qmail-banner [ arg ... ] prog  

DESCRIPTION

qmail-banner can send an SMTP banner to a client, with delays before and after the banner, and then executes prog. If a client sends commands or closes the connection before the banner is finished, qmail-banner can set environment variables for use by prog.

If the variable BANNERPRESLEEP is set and non-null, qmail-banner will wait for the indicated number of seconds before sending the banner to the client.

If the variable BANNER is set and non-null, the content is used as the banner.

If the variable BANNERFILE is set and non-null, the content of the indicated file will be used as the banner.

BANNER is used in preference to BANNERFILE.

Each line sent to the client will be prefixed with "220-" and terminated with "\r\n". If the text does not end with a newline character, one will be added. Backslash substitution is performed for the following strings:

\r \a \n \t \xHH \d \dd \ddd

where HH are hex digits and d/dd/ddd are octal digits.

Variable substitution is performed where a $ is followed by a variable name. A variable name is composed of up to 32 uppercase alphabetic characters and is optionally enclosed in curly braces.

If not overridden by an environment variable, the following variables names are handled internally:

ME
The contents of the file control/me

DATE
The current date. If the variable DATEFMT is found in the environment, the value will be used by strftime(1) in formatting the value of DATE, otherwise the RFC2822 date format will be used.

PID
The current process ID.

RANDOM
A random number.

SECONDS
Unix epoch.

If a variable is not found, the variable is not substituted.

If the variable BANNERPOSTSLEEP is set and non-null, qmail-banner will wait for the indicated number of seconds after sending the banner to the client before executing the prog specified on the command line.

If the client interrupts the banner, qmail-banner will examine the environment for variables whose names start with the string "BANNER", excluding the variables listed above. Any variables found will have "BANNER" removed from the start of the name.

 

OPTIONS

qmail-banner accepts additional arguments of the form

-x file.cdb

where file.cdb is a CDB file in the same format as used by tcpserver. qmail-banner uses the value of the variable TCPREMOTEIP or shorter and shorter prefixes ending with a dot when looking for rules. Multiple arguments may be supplied; qmail-banner will stop searching on the first match. It is not an error to provide a file name that doesn't exist.

Any variables in the rule match will be exported to the environment.

 

ENVIRONMENT

BANNER
Text to be sent as banner to client

BANNERFILE
Contents of file to be sent as banner to client

BANNERPRESLEEP
Number of seconds to wait before sending banner

BANNERPOSTSLEEP
Number of seconds to wait after sending banner

 

EXAMPLE

69.112-119:allow,BANNER="Dyn optonline clients wait",BANNERPOSTSLEEP="20"
:allow,BANNER="${ME} ESMTP NO-UCE\nHi, [$TCPREMOTEIP], logged at $DATE"
:allow,BANNERPOSTSLEEP="2",BANNERRBLSMTPD="-Impatience rejected"
:allow,BANNERPRESLEEP="2",BANNERLOG="/usr/local/bin/recordio"

 

SEE ALSO

tcpserver, tcprules


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
ENVIRONMENT
EXAMPLE
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 09:21:51 GMT, May 04, 2005