summaryrefslogtreecommitdiffstats
path: root/html/smtp-sink.1.html
blob: 4fcac7a5b7bbfd0f10efb9860dd406f4aa93440b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel='stylesheet' type='text/css' href='postfix-doc.css'>
<title> Postfix manual - smtp-sink(1) </title>
</head> <body> <pre>
SMTP-SINK(1)                                                      SMTP-SINK(1)

<b>NAME</b>
       smtp-sink - parallelized SMTP/LMTP test server

<b>SYNOPSIS</b>
       <b>smtp-sink</b> [<i>options</i>] [<b>inet:</b>][<i>host</i>]:<i>port backlog</i>

       <b>smtp-sink</b> [<i>options</i>] <b>unix:</b><i>pathname backlog</i>

<b>DESCRIPTION</b>
       <b>smtp-sink</b>  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.

       <b>smtp-sink</b> may also be configured to capture each mail delivery transac-
       tion 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 <a href="smtp-source.1.html"><b>smtp-source</b>(1)</a> program.

       Note: this is an unsupported test program. No attempt is made to  main-
       tain compatibility between successive versions.

       Arguments:

       <b>-4</b>     Support  IPv4  only.  This  option has no effect when Postfix is
              built without IPv6 support.

       <b>-6</b>     Support IPv6 only. This option is not available when Postfix  is
              built without IPv6 support.

       <b>-8</b>     Do not announce 8BITMIME support.

       <b>-a</b>     Do not announce SASL authentication support.

       <b>-A</b> <i>delay</i>
              Wait  <i>delay</i>  seconds after responding to DATA, then abort prema-
              turely 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>-b</b> <i>soft-bounce-reply</i>
              Use <i>soft-bounce-reply</i> for soft reject  responses.   The  default
              reply is "450 4.3.0 Error: command failed".

       <b>-B</b> <i>hard-bounce-reply</i>
              Use  <i>hard-bounce-reply</i>  for  hard reject responses.  The default
              reply is "500 5.3.0 Error: command failed".

       <b>-c</b>     Display running counters that are updated whenever an SMTP  ses-
              sion  ends, a QUIT command is executed, or when "." is received.

       <b>-C</b>     Disable XCLIENT support.

       <b>-d</b> <i>dump-template</i>
              Dump each mail transaction to a single-message file  whose  name
              is  created  by  expanding the <i>dump-template</i> via strftime(3) and
              appending   a   pseudo-random   hexadecimal   number   (example:
              "%Y%m%d%H/%M."  expands  into "2006081203/05.809a62e3").  If the
              template contains "/" characters, missing directories  are  cre-
              ated automatically.  The message dump format is described below.

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

       <b>-D</b> <i>dump-template</i>
              Append mail transactions to a multi-message dump file whose name
              is created by expanding the <i>dump-template</i> via  strftime(3).   If
              the  template  contains  "/" 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.

       <b>-e</b>     Do not announce ESMTP support.

       <b>-E</b>     Do not announce ENHANCEDSTATUSCODES support.

       <b>-f</b> <i>command,command,...</i>
              Reject the specified commands with  a  hard  (5xx)  error  code.
              This option implies <b>-p</b>.

              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.

       <b>-F</b>     Disable XFORWARD support.

       <b>-h</b> <i>hostname</i>
              Use <i>hostname</i> in the SMTP greeting, in the HELO response, and  in
              the EHLO response. The default hostname is "smtp-sink".

       <b>-H</b> <i>delay</i>
              Delay  the  first  read  operation after receiving DATA (time in
              seconds). Combine with a large test message and a small TCP win-
              dow  size  (see  the  <b>-T</b>  option)  to  test  the  Postfix client
              write_wait() implementation.

       <b>-L</b>     Enable LMTP instead of SMTP.

       <b>-m</b> <i>count</i> (default: 256)
              An upper bound on the maximal number of simultaneous connections
              that  <b>smtp-sink</b> will handle. This prevents the process from run-
              ning out of  file  descriptors.  Excess  connections  will  stay
              queued in the TCP/IP stack.

       <b>-M</b> <i>count</i>
              Terminate after receiving <i>count</i> messages.

       <b>-n</b> <i>count</i>
              Terminate after <i>count</i> sessions.

       <b>-N</b>     Do not announce support for DSN.

       <b>-p</b>     Do not announce support for ESMTP command pipelining.

       <b>-P</b>     Change  the server greeting so that it appears to come through a
              CISCO PIX system. Implies <b>-e</b>.

       <b>-q</b> <i>command,command,...</i>
              Disconnect (without replying) after receiving one of the  speci-
              fied 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.

       <b>-Q</b> <i>command,command,...</i>
              Send a 421 reply and disconnect after receiving one of the spec-
              ified 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.

       <b>-r</b> <i>command,command,...</i>
              Reject the specified commands with  a  soft  (4xx)  error  code.
              This option implies <b>-p</b>.

              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.

       <b>-R</b> <i>root-directory</i>
              Change the process root directory  to  the  specified  location.
              This  option  requires  super-user  privileges.  See also the <b>-u</b>
              option.

       <b>-s</b> <i>command,command,...</i>
              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.

       <b>-S start-string</b>
              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  (car-
              riage  return), \t (horizontal tab), \v (vertical tab), \<i>ddd</i> (up
              to three octal digits) and \\ (the backslash character).

       <b>-t</b> <i>timeout</i> (default: 100)
              Limit the time for receiving a command or  sending  a  response.
              The time limit is specified in seconds.

       <b>-T</b> <i>windowsize</i>
              Override  the default TCP window size. To work around broken TCP
              window scaling implementations, specify a value &gt; 0 and &lt; 65536.

       <b>-u</b> <i>username</i>
              Switch  to  the specified user privileges after opening the net-
              work socket and optionally changing the process root  directory.
              This  option  is  required when the process runs with super-user
              privileges. See also the <b>-R</b> option.

       <b>-v</b>     Show the SMTP conversations.

       <b>-w</b> <i>delay</i>
              Wait <i>delay</i> seconds before responding to a DATA command.

       <b>-W</b> <i>command:delay[:odds]</i>
              Wait <i>delay</i> seconds before responding to  <i>command</i>.   If  <i>odds</i>  is
              also  specified  (a  number  between 1-99 inclusive), wait for a
              random multiple of <i>delay</i>. 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 <i>odds</i>.

       [<b>inet:</b>][<i>host</i>]:<i>port</i>
              Listen  on  network  interface <i>host</i> (default: any interface) TCP
              port <i>port</i>. Both <i>host</i> and <i>port</i> may be  specified  in  numeric  or
              symbolic form.

       <b>unix:</b><i>pathname</i>
              Listen on the UNIX-domain socket at <i>pathname</i>.

       <i>backlog</i>
              The  maximum  length  of  the  queue  of pending connections, as
              defined by the <b>listen</b>(2) system call.

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

       <b>o</b>      The optional string specified with the <b>-S</b> option.

       <b>o</b>      The <b>smtp-sink</b> generated headers as documented below.

       <b>o</b>      The message header and body as received from the SMTP client.

       <b>o</b>      An empty line.

       The format of the <b>smtp-sink</b> generated headers is as follows:

       <b>X-Client-Addr:</b> <i>text</i>
              The  client  IP address without enclosing []. An IPv6 address is
              prefixed with "ipv6:". This record is always present.

       <b>X-Client-Proto:</b> <i>text</i>
              The client protocol: SMTP, ESMTP or LMTP. This record is  always
              present.

       <b>X-Helo-Args:</b> <i>text</i>
              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 before the DATA com-
              mand.

       <b>X-Mail-Args:</b> <i>text</i>
              The arguments of the MAIL command that started this mail  deliv-
              ery transaction. This record is present exactly once.

       <b>X-Rcpt-Args:</b> <i>text</i>
              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.

       <b>Received:</b> <i>text</i>
              A  message  header  for compatibility with mail processing soft-
              ware. This three-line header marks the end of the  headers  pro-
              vided by <b>smtp-sink</b>, and is formatted as follows:

              <b>from</b> <i>helo</i> ([<i>addr</i>])
                     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.

              <b>by</b> <i>host</i> <b>(smtp-sink) with</b> <i>proto</i> <b>id</b> <i>random</i><b>;</b>
                     The  hostname  specified  with  the <b>-h</b> option, the client
                     protocol (see <b>X-Client-Proto</b> above), and the  pseudo-ran-
                     dom portion of the per-message capture file name.

              <i>time-stamp</i>
                     A time stamp as defined in <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a>.

<b>SEE ALSO</b>
       <a href="smtp-source.1.html">smtp-source(1)</a>, SMTP/LMTP message generator

<b>LICENSE</b>
       The Secure Mailer license must be distributed with this software.

<b>AUTHOR(S)</b>
       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)
</pre> </body> </html>