SMTP dot stuffing - who does it and who removes it

↘锁芯ラ 提交于 2019-12-22 08:23:00

问题


I have written an email client and have from time to time noticed that links in some received mails fail because of two dots in a URL where there should be one.

By Investigating, I found that in all such cases the two dots are at the start of a line of quoted-printable HTML.

On reading RFC 2821, I see this is probably happening because of dot-stuffing. My question basically is, who should do the dot-stuffing and who should remove it?

If we take a simple sequence we have as follows:

  A ----> B ----> C ----> D

where A is the sending client, B is the SMTP server to which A sends the mail, C is the recipient's SMTP server, and D is the receiving client.

RFC 2821 appears to say that A should add an extra dot if a line starts with a dot, and B should remove it (which makes sense to me). However, what I observe in practice is that B adds a dot if A forgets to, but otherwise does nothing. Mails arriving at D have not had the extra dot removed. Have I misunderstood the RFC and is it therefore D's job to remove the extra dot?


回答1:


Please refer to the SMTP standard RFC2821 section 4.5.2:

http://tools.ietf.org/html/rfc2821#section-4.5.2

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.



来源:https://stackoverflow.com/questions/8971703/smtp-dot-stuffing-who-does-it-and-who-removes-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!