3 ms·
net/textproto has readers and writers that deal with crlf, and status codes, and dot encoding even.
by tedunangst 5y ago
net/textproto has readers and writers that deal with crlf, and status codes, and dot encoding even.
- jeffbee 5y agoI guess it's "from scratch" though! Which I applaud for educational purposes. If you wanted more or less scratch-ness there are standard libraries for dot stuffing and for handling RFC 822 header parsing which is actually obscenely complicated. This program responds 250 OK to absolutely every command other than data which doesn't exactly make sense, so I assume it's a toy example. You don't send 250 to QUIT, for example. Nor to STARTTLS.