Gnus development mailing list
 help / color / mirror / Atom feed
From: "Steven E. Harris" <steven.harris@tenzing.com>
Subject: SMTP question (not quite Gnus-related)
Date: 29 Jan 2001 10:04:06 -0800	[thread overview]
Message-ID: <87y9vujkvd.fsf@torus.tenzing.com> (raw)

I'm not sure if this question is appropriate for this forum, but I
trust that avid Gnus contributors and users may know the answer.

Regarding the SMTP DATA command: must a *completely blank* e-mail
message be submitted as:

  <CRLF>.<CRLF>

or simply as

  .<CRLF>

RFC821 is somewhat ambiguous - or contradictory - about the point. In
section 4.1.1 (Command Semantics), under DATA, we find:

,----[ RFC821 4.1.1 ]
| The mail data is terminated by a line containing only a period, that
| is the character sequence "<CRLF>.<CRLF>" (see Section 4.5.2 on
| Transparency).  This is the end of mail data indication
`----

This suggests that the *first* <CRLF> - the terminator for the line
before - is actually part of the terminating sequence, and hence is
not actually part of the mail body.

We know that the <CRLF> at the end of the DATA command is mandatory,
for section 4.1.2 (Command Syntax) shows it to be so. Therefore, we
can't quite argue that an empty body is specified by

  DATA<CRLF>.<CRLF>

because we'd still be missing a <CRLF>.

Section 4.5.2 (Transparency) contains the contradiction:

,----[ RFC821 4.5.2 ]
| Without some provision for data transparency the character sequence
| "<CRLF>.<CRLF>" ends the mail text and cannot be sent by the user.
| 
| [...]
| 
| 2. When a line of mail text is received by the receiver-SMTP
|    it checks the line.  If the line is composed of a single
|    period it is the end of mail.  If the first character is a
|    period and there are other characters on the line, the first
|    character is deleted
`----

The second point suggests that all it takes is a period and a <CRLF>
on a line of its own to terminate the message. If that's the case,
then an empty, terminated message would be missing the first <CRLF> in
the first paragraph's required termination sequence. The fragment
"When a line of mail text is received" implies that the only way you
know you're at the beginning of a line is if you're just seen a
<CRLF>, or if you're at the start of the data. In the former case,
you'd have the first <CRLF> before the period. In the second case -
the "blank message" case - you wouldn't have the first <CRLF>.

I've tried connecting to two SMTP servers (sendmail and exim) by
telnet and manually submitting a blank message. In each case, the
server accepted a period and newline as an acceptably-terminated
body. That is, I didn't have to hit <return period return>. Existing
implementations therefore seem to to tolerate a terminator that's not
quite what RFC821 requires.

I would like to know both whether the first <CRLF> is required and if
the first <CRLF> is part of the body text or part of the
terminator. The distinction is relevant as I'm writing a state
machine-based stream filter to process input from the DATA
command. (Yes, it's an SMTP server.)

Any insight would be greatly appreciated. (Or, if I should ask
elsewhere, please advise.)

-- 
Steven E. Harris        :: steven.harris@tenzing.com
Tenzing                 :: http://www.tenzing.com



             reply	other threads:[~2001-01-29 18:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-29 18:04 Steven E. Harris [this message]
2001-02-07 17:56 ` Kai Großjohann
2001-02-08  1:00   ` Daniel Pittman
2001-02-08  1:18     ` Steven E. Harris
2001-02-08  2:03       ` Daniel Pittman
2001-02-08 13:24         ` Kai Großjohann
2001-02-08 17:11           ` Steven E. Harris
2001-02-08 17:25             ` Paul Jarc
2001-02-08 17:30               ` Paul Jarc
2001-02-08 18:02               ` Steven E. Harris
2001-02-08 18:20                 ` Paul Jarc
2001-02-09 12:09                 ` Kai Großjohann
2001-02-09 17:33                   ` Steven E. Harris
2001-02-08 17:33             ` Kai Großjohann
2001-02-08 18:07               ` Steven E. Harris
2001-02-09 12:11                 ` Kai Großjohann
2001-02-09 17:26                   ` Steven E. Harris
2001-02-09  0:42           ` Daniel Pittman
2001-02-08 13:22     ` Kai Großjohann
2001-02-08 17:18       ` Steven E. Harris
2001-02-08 17:37         ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y9vujkvd.fsf@torus.tenzing.com \
    --to=steven.harris@tenzing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).