SMTP dot stuffing.. when and where to do it?

前端 未结 3 1612
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 09:12

I have found conflicting information about dot stuffing when transmitting an email.

  1. stuff a dot if the line contains a single dot (to avoid premature termination)<
3条回答
  •  执笔经年
    2021-02-19 09:39

    In SMTP protocol the mail is terminated by a single dot and a newline character(s)

    In simple terms something like:

    \r\n.\r\n

    The characters:

    CR LF DOT CR LF

    Which corresponds to a single dot at the beginning of a line.

    In case the mail data contains a single . At the beginning of line and is followed by a new line character then the SMTP protocol will consider it as mail termination and hence only a part of mail would be delivered.

    So the whole idea is to avoid these type of situation by padding an extra dot.

提交回复
热议问题