Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

email

smtp

rfc

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)
  2. stuff a dot to every line stat starts with a dot
  3. stuff a dot to (1) and to every line part of a quoted-printable message part only

Can anyone clarify?

like image 574
transilvlad Avatar asked Mar 05 '13 12:03

transilvlad


People also ask

How SMTP works step by step?

The functioning of an SMTP server can be broken down into two steps. The first step includes verification of the computer configuration through which an email is sent and granting permission for the process. In the second step, it sends out the message and follows the successful delivery of the email.

What are the two dots in a URL?

Relative paths refer to file locations based on the current directory. That is, they often refer to locations in the form of “up one directory level” and often begin with one or two dots (“.”). An example would be “../index. html” which would refer to the file “index.

What role does SMTP play in the delivery of email?

Like all servers, an SMTP server is an application that provides a service to other applications within a network, called clients. Specifically, an SMTP server handles the sending, receiving, and relaying of email. You can think of servers as your real-life post offices.


2 Answers

According to the SMTP standard RFC 5321, section 4.5.2:

https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2

To allow all user composed text to be transmitted transparently, the following procedures are used:

  • Before sending a line of mail text, the SMTP client checks the first character of the line. If it is a period, one additional period is inserted at the beginning of the line.
  • When a line of mail text is received by the SMTP server, it checks the line. If the line is composed of a single period, it is treated as the end of mail indicator. If the first character is a period and there are other characters on the line, the first character is deleted.

So, from the three points of your question, the second one is right.

like image 148
chus Avatar answered Sep 27 '22 16:09

chus


The practical answer: If you're using quoted printable format then always translate a dot to =2E. You can't rely on all smtp servers doing the dot removal correctly.

If you want to assume the whole world is standards compliant then go with answer 2 above.

like image 45
billm Avatar answered Sep 27 '22 17:09

billm