Search code examples
emailsmtpprotocols

Why is the DATA in SMTP not null terminated?


I was reading the original RPC about the SMTP Protocol and came across this section:

SMTP indicates the end of the mail data by sending a line containing only a period.

Why did Postel decide to use the period as the terminator? Would it not be easier to use the already existing null terminator?

I see, that he would not want the users content to interfere with the protocol, but I would naively assume, that a user is more likely to use a period in one line than a null terminator? Added to that, would the implementation of the mail client not just cut of the text if the user came to use the null terminator his mail contents?


Solution

  • IMHO: SMTP has be designed long time ago to be human readable/writable.
    It is pretty simple to test (send simple SMTP messages) typing them by hand via telnet program.
    "Human readable" makes null terminator a suboptimal choice.

    EMSMTP design is a fossil of pre-spam era. It is bad (by current standards) but it is so widely implemented and sufficiently good (after fixes) to make any quick revolution "not sufficiently urgent".

    Extra info: Seen RFC 3030 for BDAT alternative to DATA command.