Message254086
It's well known that in quoted-printable encoding the "CRLF" can be encoded to "=CRLF".
For example, in attachment file test.eml, the last line is "test message.=CRLF"
But after the mail is sent via SMTP and received by mail server (e.g. postfix), the last line will become "test message.=",
then after decoding, you will see the unnecessary char "=" shown following "test message.".
The problem is caused by below code:
------------------------------------------------
class SMTP:
...
def data(self, msg):
...
q = quotedata(msg)
if q[-2:] != CRLF:
q = q + CRLF
q = q + "." + CRLF
self.send(q)
...
------------------------------------------------
Before it sends the message q, it will try to append the end-of-data sequence "<CRLF>.<CRLF>".
As the implement, it checks whether there is "<CRLF>" in the message end, if yes then just need to append ".<CRLF>".
It looks rigorous and efficient, but it does not consider how mail server handle it.
As we know mail server will remove end-of-data sequence directly, and the left message is treat as mail data.
Thus the corresponding action should be taken on SMTP client side,
it's to say no need to check and just append end-of-data sequence here:
------------------------------------------------
class SMTP:
...
def data(self, msg):
...
q = quotedata(msg)
q = q + CRLF + "." + CRLF
self.send(q)
...
------------------------------------------------ |
|
Date |
User |
Action |
Args |
2015-11-05 06:51:55 | Deli Zhang | set | recipients:
+ Deli Zhang |
2015-11-05 06:51:55 | Deli Zhang | set | messageid: <1446706315.09.0.659513655808.issue25553@psf.upfronthosting.co.za> |
2015-11-05 06:51:54 | Deli Zhang | link | issue25553 messages |
2015-11-05 06:51:54 | Deli Zhang | create | |
|