NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/57269: nc(1) manpage includes broken example
>Number: 57269
>Category: bin
>Synopsis: Incorrect example in 9.1 nc(1) manpage
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Tue Mar 14 21:00:01 +0000 2023
>Originator: Mouse
>Release: NetBSD 9.1
>Organization:
Dis-
>Environment:
Probably any; noticed on
System: NetBSD Finch.Rodents-Montreal.ORG 9.1 NetBSD 9.1 (GEN91) #0: Tue Mar 7 18:09:34 EST 2023 mouse%Finch.Rodents-Montreal.ORG@localhost:/home/mouse/kbuild/GEN91 amd64
Architecture: x86_64
Machine: amd64
>Description:
nc(1) gives some examples of its use. One of them is
More complicated examples can be built up when the user knows the format
of requests required by the server. As another example, an email may be
submitted to an SMTP server using:
$ nc localhost 25 << EOF
HELO host.example.com
MAIL FROM:<user%host.example.com@localhost>
RCPT TO:<user2%host.example.com@localhost>
DATA
Body of email.
.
QUIT
EOF
but this is invalid SMTP; it is not valid to send a command
before receiving the response to the previous one unless
pipelining has been negotiated on. (Some SMTP servers may be
willing to let the client get away with this anyway, but I
think that, at the very least, this should be noted with the
example.) As RFC5321 puts it,
The dialog is purposely lock-step, one-at-a-time,
although this can be modified by mutually agreed upon extension
requests such as command pipelining (RFC 2920 [19]).
A PIPELINING-capable SMTP server _probably_ would let this
pass, but it's not clear to me whether it's valid to do
pipelining when using HELO, even if the server would have
advertised PIPELINING if EHLO had been used - and I'm not sure
it's ever valid for the client to do it before receiving the
EHLO response advertising support for it.
>How-To-Repeat:
Read `man nc'. Compare against RFC 5321.
>Fix:
Proposed change (the change consists of new text after the
exmaple):
More complicated examples can be built up when the user knows the format
of requests required by the server. As another example, an email may be
submitted to an SMTP server using:
$ nc localhost 25 << EOF
HELO host.example.com
MAIL FROM:<user%host.example.com@localhost>
RCPT TO:<user2%host.example.com@localhost>
DATA
Body of email.
.
QUIT
EOF
though this particular example depends on the SMTP server
not enforcing the requirement that pipelining be
negotiated before it is used (see RFCs 5321 and 2920).
Home |
Main Index |
Thread Index |
Old Index