1<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3<html> <head> 4<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5<link rel='stylesheet' type='text/css' href='postfix-doc.css'> 6<title> Postfix manual - smtp-sink(1) </title> 7</head> <body> <pre> 8SMTP-SINK(1) SMTP-SINK(1) 9 10<b>NAME</b> 11 smtp-sink - parallelized SMTP/LMTP test server 12 13<b>SYNOPSIS</b> 14 <b>smtp-sink</b> [<i>options</i>] [<b>inet:</b>][<i>host</i>]:<i>port backlog</i> 15 16 <b>smtp-sink</b> [<i>options</i>] <b>unix:</b><i>pathname backlog</i> 17 18<b>DESCRIPTION</b> 19 <b>smtp-sink</b> listens on the named host (or address) and port. It takes 20 SMTP messages from the network and throws them away. The purpose is to 21 measure client performance, not protocol compliance. 22 23 <b>smtp-sink</b> may also be configured to capture each mail delivery transac- 24 tion to file. Since disk latencies are large compared to network 25 delays, this mode of operation can reduce the maximal performance by 26 several orders of magnitude. 27 28 Connections can be accepted on IPv4 or IPv6 endpoints, or on 29 UNIX-domain sockets. IPv4 and IPv6 are the default. This program is 30 the complement of the <a href="smtp-source.1.html"><b>smtp-source</b>(1)</a> program. 31 32 Note: this is an unsupported test program. No attempt is made to main- 33 tain compatibility between successive versions. 34 35 Arguments: 36 37 <b>-4</b> Support IPv4 only. This option has no effect when Postfix is 38 built without IPv6 support. 39 40 <b>-6</b> Support IPv6 only. This option is not available when Postfix is 41 built without IPv6 support. 42 43 <b>-8</b> Do not announce 8BITMIME support. 44 45 <b>-a</b> Do not announce SASL authentication support. 46 47 <b>-A</b> <i>delay</i> 48 Wait <i>delay</i> seconds after responding to DATA, then abort prema- 49 turely with a 550 reply status. Do not read further input from 50 the client; this is an attempt to block the client before it 51 sends ".". Specify a zero delay value to abort immediately. 52 53 <b>-b</b> <i>soft-bounce-reply</i> 54 Use <i>soft-bounce-reply</i> for soft reject responses. The default 55 reply is "450 4.3.0 Error: command failed". 56 57 <b>-B</b> <i>hard-bounce-reply</i> 58 Use <i>hard-bounce-reply</i> for hard reject responses. The default 59 reply is "500 5.3.0 Error: command failed". 60 61 <b>-c</b> Display running counters that are updated whenever an SMTP ses- 62 sion ends, a QUIT command is executed, or when "." is received. 63 64 <b>-C</b> Disable XCLIENT support. 65 66 <b>-d</b> <i>dump-template</i> 67 Dump each mail transaction to a single-message file whose name 68 is created by expanding the <i>dump-template</i> via strftime(3) and 69 appending a pseudo-random hexadecimal number (example: 70 "%Y%m%d%H/%M." expands into "2006081203/05.809a62e3"). If the 71 template contains "/" characters, missing directories are cre- 72 ated automatically. The message dump format is described below. 73 74 Note: this option keeps one capture file open for every mail 75 transaction in progress. 76 77 <b>-D</b> <i>dump-template</i> 78 Append mail transactions to a multi-message dump file whose name 79 is created by expanding the <i>dump-template</i> via strftime(3). If 80 the template contains "/" characters, missing directories are 81 created automatically. The message dump format is described 82 below. 83 84 Note: this option keeps one capture file open for every mail 85 transaction in progress. 86 87 <b>-e</b> Do not announce ESMTP support. 88 89 <b>-E</b> Do not announce ENHANCEDSTATUSCODES support. 90 91 <b>-f</b> <i>command,command,...</i> 92 Reject the specified commands with a hard (5xx) error code. 93 This option implies <b>-p</b>. 94 95 Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, 96 VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by 97 white space or commas, and use quotes to protect white space 98 from the shell. Command names are case-insensitive. 99 100 <b>-F</b> Disable XFORWARD support. 101 102 <b>-h</b> <i>hostname</i> 103 Use <i>hostname</i> in the SMTP greeting, in the HELO response, and in 104 the EHLO response. The default hostname is "smtp-sink". 105 106 <b>-H</b> <i>delay</i> 107 Delay the first read operation after receiving DATA (time in 108 seconds). Combine with a large test message and a small TCP win- 109 dow size (see the <b>-T</b> option) to test the Postfix client 110 write_wait() implementation. 111 112 <b>-L</b> Enable LMTP instead of SMTP. 113 114 <b>-m</b> <i>count</i> (default: 256) 115 An upper bound on the maximal number of simultaneous connections 116 that <b>smtp-sink</b> will handle. This prevents the process from run- 117 ning out of file descriptors. Excess connections will stay 118 queued in the TCP/IP stack. 119 120 <b>-M</b> <i>count</i> 121 Terminate after receiving <i>count</i> messages. 122 123 <b>-n</b> <i>count</i> 124 Terminate after <i>count</i> sessions. 125 126 <b>-N</b> Do not announce support for DSN. 127 128 <b>-p</b> Do not announce support for ESMTP command pipelining. 129 130 <b>-P</b> Change the server greeting so that it appears to come through a 131 CISCO PIX system. Implies <b>-e</b>. 132 133 <b>-q</b> <i>command,command,...</i> 134 Disconnect (without replying) after receiving one of the speci- 135 fied commands. 136 137 Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, 138 VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by 139 white space or commas, and use quotes to protect white space 140 from the shell. Command names are case-insensitive. 141 142 <b>-Q</b> <i>command,command,...</i> 143 Send a 421 reply and disconnect after receiving one of the spec- 144 ified commands. 145 146 Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, 147 VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by 148 white space or commas, and use quotes to protect white space 149 from the shell. Command names are case-insensitive. 150 151 <b>-r</b> <i>command,command,...</i> 152 Reject the specified commands with a soft (4xx) error code. 153 This option implies <b>-p</b>. 154 155 Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, 156 VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by 157 white space or commas, and use quotes to protect white space 158 from the shell. Command names are case-insensitive. 159 160 <b>-R</b> <i>root-directory</i> 161 Change the process root directory to the specified location. 162 This option requires super-user privileges. See also the <b>-u</b> 163 option. 164 165 <b>-s</b> <i>command,command,...</i> 166 Log the named commands to syslogd. 167 168 Examples of commands are CONNECT, HELO, EHLO, LHLO, MAIL, RCPT, 169 VRFY, DATA, ., RSET, NOOP, and QUIT. Separate command names by 170 white space or commas, and use quotes to protect white space 171 from the shell. Command names are case-insensitive. 172 173 <b>-S start-string</b> 174 An optional string that is prepended to each message that is 175 written to a dump file (see the dump file format description 176 below). The following C escape sequences are supported: \a 177 (bell), \b (backspace), \f (formfeed), \n (newline), \r (car- 178 riage return), \t (horizontal tab), \v (vertical tab), \<i>ddd</i> (up 179 to three octal digits) and \\ (the backslash character). 180 181 <b>-t</b> <i>timeout</i> (default: 100) 182 Limit the time for receiving a command or sending a response. 183 The time limit is specified in seconds. 184 185 <b>-T</b> <i>windowsize</i> 186 Override the default TCP window size. To work around broken TCP 187 window scaling implementations, specify a value > 0 and < 65536. 188 189 <b>-u</b> <i>username</i> 190 Switch to the specified user privileges after opening the net- 191 work socket and optionally changing the process root directory. 192 This option is required when the process runs with super-user 193 privileges. See also the <b>-R</b> option. 194 195 <b>-v</b> Show the SMTP conversations. 196 197 <b>-w</b> <i>delay</i> 198 Wait <i>delay</i> seconds before responding to a DATA command. 199 200 <b>-W</b> <i>command:delay[:odds]</i> 201 Wait <i>delay</i> seconds before responding to <i>command</i>. If <i>odds</i> is 202 also specified (a number between 1-99 inclusive), wait for a 203 random multiple of <i>delay</i>. The random multiplier is equal to the 204 number of times the program needs to roll a dice with a range of 205 0..99 inclusive, before the dice produces a result greater than 206 or equal to <i>odds</i>. 207 208 [<b>inet:</b>][<i>host</i>]:<i>port</i> 209 Listen on network interface <i>host</i> (default: any interface) TCP 210 port <i>port</i>. Both <i>host</i> and <i>port</i> may be specified in numeric or 211 symbolic form. 212 213 <b>unix:</b><i>pathname</i> 214 Listen on the UNIX-domain socket at <i>pathname</i>. 215 216 <i>backlog</i> 217 The maximum length of the queue of pending connections, as 218 defined by the <b>listen</b>(2) system call. 219 220<b>DUMP FILE FORMAT</b> 221 Each dumped message contains a sequence of text lines, terminated with 222 the newline character. The sequence of information is as follows: 223 224 <b>o</b> The optional string specified with the <b>-S</b> option. 225 226 <b>o</b> The <b>smtp-sink</b> generated headers as documented below. 227 228 <b>o</b> The message header and body as received from the SMTP client. 229 230 <b>o</b> An empty line. 231 232 The format of the <b>smtp-sink</b> generated headers is as follows: 233 234 <b>X-Client-Addr:</b> <i>text</i> 235 The client IP address without enclosing []. An IPv6 address is 236 prefixed with "ipv6:". This record is always present. 237 238 <b>X-Client-Proto:</b> <i>text</i> 239 The client protocol: SMTP, ESMTP or LMTP. This record is always 240 present. 241 242 <b>X-Helo-Args:</b> <i>text</i> 243 The arguments of the last HELO or EHLO command before this mail 244 delivery transaction. This record is present only if the client 245 sent a recognizable HELO or EHLO command before the DATA com- 246 mand. 247 248 <b>X-Mail-Args:</b> <i>text</i> 249 The arguments of the MAIL command that started this mail deliv- 250 ery transaction. This record is present exactly once. 251 252 <b>X-Rcpt-Args:</b> <i>text</i> 253 The arguments of an RCPT command within this mail delivery 254 transaction. There is one record for each RCPT command, and they 255 are in the order as sent by the client. 256 257 <b>Received:</b> <i>text</i> 258 A message header for compatibility with mail processing soft- 259 ware. This three-line header marks the end of the headers pro- 260 vided by <b>smtp-sink</b>, and is formatted as follows: 261 262 <b>from</b> <i>helo</i> ([<i>addr</i>]) 263 The HELO or EHLO command argument and client IP address. 264 If the client did not send HELO or EHLO, the client IP 265 address is used instead. 266 267 <b>by</b> <i>host</i> <b>(smtp-sink) with</b> <i>proto</i> <b>id</b> <i>random</i><b>;</b> 268 The hostname specified with the <b>-h</b> option, the client 269 protocol (see <b>X-Client-Proto</b> above), and the pseudo-ran- 270 dom portion of the per-message capture file name. 271 272 <i>time-stamp</i> 273 A time stamp as defined in <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a>. 274 275<b>SEE ALSO</b> 276 <a href="smtp-source.1.html">smtp-source(1)</a>, SMTP/LMTP message generator 277 278<b>LICENSE</b> 279 The Secure Mailer license must be distributed with this software. 280 281<b>AUTHOR(S)</b> 282 Wietse Venema 283 IBM T.J. Watson Research 284 P.O. Box 704 285 Yorktown Heights, NY 10598, USA 286 287 Wietse Venema 288 Google, Inc. 289 111 8th Avenue 290 New York, NY 10011, USA 291 292 SMTP-SINK(1) 293</pre> </body> </html> 294