1 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT H
\bHo
\bow
\bwt
\bto
\bo
3 -------------------------------------------------------------------------------
5 P
\bPu
\bur
\brp
\bpo
\bos
\bse
\be o
\bof
\bf t
\bth
\bhe
\be X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT e
\bex
\bxt
\bte
\ben
\bns
\bsi
\bio
\bon
\bn t
\bto
\bo S
\bSM
\bMT
\bTP
\bP
7 When an SMTP server announces support for the XCLIENT command, an SMTP client
8 may send information that overrides one or more client-related session
9 attributes. The XCLIENT command targets the following problems:
11 1. Access control tests. SMTP server access rules are difficult to verify when
12 decisions can be triggered only by remote clients. In order to facilitate
13 access rule testing, an authorized SMTP client test program needs the
14 ability to override the SMTP server's idea of the SMTP client hostname,
15 network address, and other client information, for the entire duration of
18 2. Client software that downloads mail from an up-stream mail server and
19 injects it into a local MTA via SMTP. In order to take advantage of the
20 local MTA's SMTP server access rules, the client software needs the ability
21 to override the SMTP server's idea of the remote client name, client
22 address and other information. Such information can typically be extracted
23 from the up-stream mail server's Received: message header.
25 3. Post-filter access control and logging. With Internet->filter->MTA style
26 content filter applications, the filter can be simplified if it can
27 delegate decisions concerning mail relay and other access control to the
28 MTA. This is especially useful when the filter acts as a transparent proxy
29 for SMTP commands. This requires that the filter can override the MTA's
30 idea of the SMTP client hostname, network address, and other information.
32 X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT C
\bCo
\bom
\bmm
\bma
\ban
\bnd
\bd s
\bsy
\byn
\bnt
\bta
\bax
\bx
34 An example client-server conversation is given at the end of this document.
36 In SMTP server EHLO replies, the keyword associated with this extension is
37 XCLIENT. It is followed by the names of the attributes that the XCLIENT
38 implementation supports.
40 The XCLIENT command may be sent at any time, except in the middle of a mail
41 delivery transaction (i.e. between MAIL and DOT, or MAIL and RSET). The XCLIENT
42 command may be pipelined when the server supports ESMTP command pipelining. To
43 avoid triggering spamware detectors, the command should be sent at the end of a
46 The syntax of XCLIENT requests is described below. Upper case and quoted
47 strings specify terminals, lowercase strings specify meta terminals, and SP is
48 whitespace. Although command and attribute names are shown in upper case, they
49 are in fact case insensitive.
51 xclient-command = XCLIENT 1*( SP attribute-name"="attribute-value )
53 attribute-name = ( NAME | ADDR | PORT | PROTO | HELO )
55 attribute-value = xtext
57 * Attribute values are xtext encoded as per RFC 1891.
59 * The NAME attribute specifies an SMTP client hostname (not an SMTP client
60 address), [UNAVAILABLE] when client hostname lookup failed due to a
61 permanent error, or [TEMPUNAVAIL] when the lookup error condition was
64 * The ADDR attribute specifies an SMTP client numerical IPv4 network address,
65 an IPv6 address prefixed with IPV6:, or [UNAVAILABLE] when the address
66 information is unavailable. Address information is not enclosed with [].
68 * The PORT attribute specifies the SMTP client TCP port number as a decimal
69 number, or [UNAVAILABLE] when the information is unavailable.
71 * The PROTO attribute specifies either SMTP or ESMTP.
73 * The HELO attribute specifies an SMTP HELO parameter value, or the value
74 [UNAVAILABLE] when the information is unavailable.
76 Note 1: syntactically valid NAME and HELO attribute-value elements can be up to
77 255 characters long. The client must not send XCLIENT commands that exceed the
78 512 character limit for SMTP commands. To avoid exceeding the limit the client
79 should send the information in multiple XCLIENT commands; for example, send
80 NAME and ADDR first, then HELO and PROTO.
82 Note 2: [UNAVAILABLE], [TEMPUNAVAIL] and IPV6: may be specified in upper case,
83 lower case or mixed case.
85 Note 3: Postfix implementations prior to version 2.3 do not xtext encode
86 attribute values. Servers that wish to interoperate with these older
87 implementations should be prepared to receive unencoded information.
89 Note 4: Postfix implementations prior to version 2.5 do not implement the PORT
92 X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT S
\bSe
\ber
\brv
\bve
\ber
\br r
\bre
\bes
\bsp
\bpo
\bon
\bns
\bse
\be
94 Upon receipt of a correctly formatted XCLIENT command, the server resets state
95 to the initial SMTP greeting protocol stage. Depending on the outcome of
96 optional access decisions, the server responds with 220 or with a suitable
99 For practical reasons it is not always possible to reset the complete server
100 state to the initial SMTP greeting protocol stage:
102 * TLS session information may not be reset, because turning off TLS leaves
103 the connection in an undefined state. Consequently, the server may not
104 announce STARTTLS when TLS is already active, and access decisions may be
105 influenced by client certificate information that was received prior to the
108 * The SMTP server must not reset attributes that were received with the last
109 XCLIENT command. This includes HELO or PROTO attributes.
111 NOTE: Postfix implementations prior to version 2.3 do not jump back to the
112 initial SMTP greeting protocol stage. These older implementations will not
113 correctly simulate connection-level access decisions under some conditions.
115 X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT s
\bse
\ber
\brv
\bve
\ber
\br r
\bre
\bep
\bpl
\bly
\by c
\bco
\bod
\bde
\bes
\bs
117 _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b
118 |C
\bCo
\bod
\bde
\be |M
\bMe
\bea
\ban
\bni
\bin
\bng
\bg |
119 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
121 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
122 |421 |unable to proceed, disconnecting |
123 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
124 |501 |bad command parameter syntax |
125 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
126 |503 |mail transaction in progress |
127 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
128 |550 |insufficient authorization |
129 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
130 |other|connection rejected by connection-level access decision|
131 |_
\b _
\b _
\b _
\b _
\b _
\b|_
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b _
\b |
133 X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT E
\bEx
\bxa
\bam
\bmp
\bpl
\ble
\be
135 In the example, the client impersonates a mail originating system by passing
136 all SMTP client information via the XCLIENT command. Information sent by the
137 client is shown in bold font.
139 220 server.example.com ESMTP Postfix
140 E
\bEH
\bHL
\bLO
\bO c
\bcl
\bli
\bie
\ben
\bnt
\bt.
\b.e
\bex
\bxa
\bam
\bmp
\bpl
\ble
\be.
\b.c
\bco
\bom
\bm
141 250-server.example.com
146 250-XCLIENT NAME ADDR PROTO HELO
148 X
\bXC
\bCL
\bLI
\bIE
\bEN
\bNT
\bT N
\bNA
\bAM
\bME
\bE=
\b=s
\bsp
\bpi
\bik
\bke
\be.
\b.p
\bpo
\bor
\brc
\bcu
\bup
\bpi
\bin
\bne
\be.
\b.o
\bor
\brg
\bg A
\bAD
\bDD
\bDR
\bR=
\b=1
\b16
\b68
\b8.
\b.1
\b10
\b00
\b0.
\b.1
\b18
\b89
\b9.
\b.2
\b2
149 220 server.example.com ESMTP Postfix
150 E
\bEH
\bHL
\bLO
\bO s
\bsp
\bpi
\bik
\bke
\be.
\b.p
\bpo
\bor
\brc
\bcu
\bup
\bpi
\bin
\bne
\be.
\b.o
\bor
\brg
\bg
151 250-server.example.com
156 250-XCLIENT NAME ADDR PROTO HELO
158 M
\bMA
\bAI
\bIL
\bL F
\bFR
\bRO
\bOM
\bM:
\b:<
\b<w
\bwi
\bie
\bet
\bts
\bse
\be@
\b@p
\bpo
\bor
\brc
\bcu
\bup
\bpi
\bin
\bne
\be.
\b.o
\bor
\brg
\bg>
\b>
160 R
\bRC
\bCP
\bPT
\bT T
\bTO
\bO:
\b:<
\b<u
\bus
\bse
\ber
\br@
\b@e
\bex
\bxa
\bam
\bmp
\bpl
\ble
\be.
\b.c
\bco
\bom
\bm>
\b>
163 354 End data with <CR><LF>.<CR><LF>
164 .
\b. .
\b. .
\b.m
\bme
\bes
\bss
\bsa
\bag
\bge
\be c
\bco
\bon
\bnt
\bte
\ben
\bnt
\bt.
\b. .
\b. .
\b.
166 250 Ok: queued as 763402AAE6
170 S
\bSe
\bec
\bcu
\bur
\bri
\bit
\bty
\by
172 The XCLIENT command changes audit trails and/or SMTP client access permissions.
173 Use of this command must be restricted to authorized SMTP clients.
175 S
\bSM
\bMT
\bTP
\bP c
\bco
\bon
\bnn
\bne
\bec
\bct
\bti
\bio
\bon
\bn c
\bca
\bac
\bch
\bhi
\bin
\bng
\bg
177 XCLIENT attributes persist until the end of an SMTP session. If one session is
178 used to deliver mail on behalf of different SMTP clients, the XCLIENT
179 attributes need to be reset as appropriate before each MAIL FROM command.
181 R
\bRe
\bef
\bfe
\ber
\bre
\ben
\bnc
\bce
\bes
\bs
183 Moore, K, "SMTP Service Extension for Delivery Status Notifications", RFC 1891,