# smtp-sink(1) - man - phpMan

[SMTP-SINK(1)](https://www.chedong.com/phpMan.php/man/SMTP-SINK/1/markdown)                           General Commands Manual                          [SMTP-SINK(1)](https://www.chedong.com/phpMan.php/man/SMTP-SINK/1/markdown)



## NAME
       smtp-sink - parallelized SMTP/LMTP test server

## SYNOPSIS
       **smtp-sink** [_options_] [**inet:**][_host_]:_port_ _backlog_

       **smtp-sink** [_options_] **unix:**_pathname_ _backlog_

## DESCRIPTION
       **smtp-sink**  listens  on the named host (or address) and port.  It takes SMTP messages from the
       network and throws them away.  The purpose is to measure  client  performance,  not  protocol
       compliance.

       **smtp-sink**  may  also  be  configured to capture each mail delivery transaction to file. Since
       disk latencies are large compared to network delays, this mode of operation  can  reduce  the
       maximal performance by several orders of magnitude.

       Connections  can  be accepted on IPv4 or IPv6 endpoints, or on UNIX-domain sockets.  IPv4 and
       IPv6 are the default.  This program is the complement of the [**smtp-source**(1)](https://www.chedong.com/phpMan.php/man/smtp-source/1/markdown) program.

       Note: this is an unsupported test program. No attempt is made to maintain  compatibility  be‐
       tween successive versions.

       Arguments:

### -4
              port.

### -6
              support.

### -8

### -a

### -A
              Wait  _delay_  seconds after responding to DATA, then abort prematurely with a 550 reply
              status.  Do not read further input from the client; this is an attempt  to  block  the
              client before it sends ".".  Specify a zero delay value to abort immediately.

### -b
              Use  _soft-bounce-reply_ for soft reject responses.  The default reply is "450 4.3.0 Er‐
              ror: command failed".

### -B
              Use _hard-bounce-reply_ for hard reject responses.  The default reply is "500 5.3.0  Er‐
              ror: command failed".

### -c
              mand is executed, or when "." is received.

### -C

### -d
              Dump each mail transaction to a single-message file whose name is created by expanding
              the  _dump-template_  via  [strftime(3)](https://www.chedong.com/phpMan.php/man/strftime/3/markdown)  and appending a pseudo-random hexadecimal number
              (example: "%Y%m%d%H/%M." expands into "2006081203/05.809a62e3").  If the template con‐
              tains "/" characters, missing directories are created automatically.  The message dump
              format is described below.

              Note: this option keeps one capture file open for every mail transaction in progress.

### -D
              Append mail transactions to a multi-message dump file whose name is created by expand‐
              ing the _dump-template_ via [strftime(3)](https://www.chedong.com/phpMan.php/man/strftime/3/markdown).  If the template contains "/" characters, miss‐
              ing directories are created automatically.  The message dump format is  described  be‐
              low.

              Note: this option keeps one capture file open for every mail transaction in progress.

### -e

### -E

### -f
              Reject the specified commands with a hard (5xx) error code.  This option implies **-p**.

              Examples  of  commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, VRFY, DATA, ., RSET,
              NOOP, and QUIT. Separate command names by white space or commas,  and  use  quotes  to
              protect white space from the shell. Command names are case-insensitive.

### -F

### -h
              Use _hostname_ in the SMTP greeting, in the HELO response, and in the EHLO response. The
              default hostname is "smtp-sink".

### -H
              Delay the first read operation after receiving DATA (time in seconds). Combine with  a
              large test message and a small TCP window size (see the **-T** option) to test the Postfix
              client write_wait() implementation.

### -L

### -m
              An upper bound on the maximal number of simultaneous connections that  **smtp-sink**  will
              handle. This prevents the process from running out of file descriptors. Excess connec‐
              tions will stay queued in the TCP/IP stack.

### -M
              Terminate after receiving _count_ messages.

### -n
              Terminate after _count_ sessions.

### -N

### -p

### -P
              plies **-e**.

### -q
              Disconnect (without replying) after receiving one of the specified commands.

              Examples  of  commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, VRFY, DATA, ., RSET,
              NOOP, and QUIT. Separate command names by white space or commas,  and  use  quotes  to
              protect white space from the shell. Command names are case-insensitive.

### -Q
              Send a 421 reply and disconnect after receiving one of the specified commands.

              Examples  of  commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, VRFY, DATA, ., RSET,
              NOOP, and QUIT. Separate command names by white space or commas,  and  use  quotes  to
              protect white space from the shell. Command names are case-insensitive.

### -r
              Reject the specified commands with a soft (4xx) error code.  This option implies **-p**.

              Examples  of  commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, VRFY, DATA, ., RSET,
              NOOP, and QUIT. Separate command names by white space or commas,  and  use  quotes  to
              protect white space from the shell. Command names are case-insensitive.

### -R
              Change the process root directory to the specified location.  This option requires su‐
              per-user privileges. See also the **-u** option.

### -s
              Log the named commands to syslogd.

              Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, VRFY, DATA,  .,  RSET,
              NOOP,  and  QUIT.  Separate  command names by white space or commas, and use quotes to
              protect white space from the shell. Command names are case-insensitive.

### -S start-string
              An optional string that is prepended to each message that is written to  a  dump  file
              (see  the  dump  file  format description below). The following C escape sequences are
              supported: \a (bell), \b (backspace), \f (formfeed), \n (newline),  \r  (carriage  re‐
              turn),  \t (horizontal tab), \v (vertical tab), \_ddd_ (up to three octal digits) and \\
              (the backslash character).

### -t
              Limit the time for receiving a command or sending a response.  The time limit is spec‐
              ified in seconds.

### -T
              Override  the default TCP window size. To work around broken TCP window scaling imple‐
              mentations, specify a value > 0 and < 65536.

### -u
              Switch to the specified user privileges after opening the network socket  and  option‐
              ally  changing  the  process  root directory. This option is required when the process
              runs with super-user privileges. See also the **-R** option.

### -v

### -w
              Wait _delay_ seconds before responding to a DATA command.

### -W
              Wait _delay_ seconds before responding to _command_.  If _odds_ is also specified (a  number
              between 1-99 inclusive), wait for a random multiple of _delay_. The random multiplier is
              equal to the number of times the program needs to roll a dice with a  range  of  0..99
              inclusive, before the dice produces a result greater than or equal to _odds_.

       [**inet:**][_host_]:_port_
              Listen on network interface _host_ (default: any interface) TCP port _port_. Both _host_ and
              _port_ may be specified in numeric or symbolic form.

       **unix:**_pathname_
              Listen on the UNIX-domain socket at _pathname_.

       _backlog_
              The maximum length the queue of pending connections, as defined by the [**listen**(2)](https://www.chedong.com/phpMan.php/man/listen/2/markdown)  sys‐
              tem call.

## DUMP FILE FORMAT
       Each dumped message contains a sequence of text lines, terminated with the newline character.
       The sequence of information is as follows:

       •      The optional string specified with the **-S** option.

       •      The **smtp-sink** generated headers as documented below.

       •      The message header and body as received from the SMTP client.

       •      An empty line.

       The format of the **smtp-sink** generated headers is as follows:

       **X-Client-Addr:** _text_
              The client IP address without enclosing []. An IPv6 address is prefixed with  "ipv6:".
              This record is always present.

       **X-Client-Proto:** _text_
              The client protocol: SMTP, ESMTP or LMTP. This record is always present.

       **X-Helo-Args:** _text_
              The  arguments of the last HELO or EHLO command before this mail delivery transaction.
              This record is present only if the client sent a recognizable HELO or EHLO command be‐
              fore the DATA command.

       **X-Mail-Args:** _text_
              The  arguments  of  the MAIL command that started this mail delivery transaction. This
              record is present exactly once.

       **X-Rcpt-Args:** _text_
              The arguments of an RCPT command within this mail delivery transaction. There  is  one
              record for each RCPT command, and they are in the order as sent by the client.

       **Received:** _text_
              A  message  header  for  compatibility  with mail processing software. This three-line
              header marks the end of the headers provided by **smtp-sink**, and is  formatted  as  fol‐
              lows:

              **from** _helo_ ([_addr_])
                     The HELO or EHLO command argument and client IP address.  If the client did not
                     send HELO or EHLO, the client IP address is used instead.

              **by** _host_ **(smtp-sink)** **with** _proto_ **id** _random_**;**
                     The  hostname  specified  with  the  **-h**  option,  the  client   protocol   (see
                     **X-Client-Proto** above), and the pseudo-random portion of the per-message capture
                     file name.

              _time-stamp_
                     A time stamp as defined in RFC 2822.

## SEE ALSO
       [smtp-source(1)](https://www.chedong.com/phpMan.php/man/smtp-source/1/markdown), SMTP/LMTP message generator

## LICENSE
       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

       Wietse Venema
       Google, Inc.
       111 8th Avenue
       New York, NY 10011, USA



                                                                                        [SMTP-SINK(1)](https://www.chedong.com/phpMan.php/man/SMTP-SINK/1/markdown)
