Problem with quopri in email

Benjamin Niemann pink at odahoda.de
Sun Sep 5 22:26:28 CEST 2004


Dieter Maurer wrote:

> Benjamin Niemann <b.niemann at betternet.de> writes on Fri, 03 Sep 2004 18:00:50 +0200:
> 
>>I just sent a newsletter (HTML with <img>s) using a Python script.
>>Looking at the error_log of our web server, I'm seeing lots of 404
>>error for files like
>>
>>/images/news/f68f57c1c67dc319d84f7c11c8b71b65jpeg
>>or
>>/images/news/f23a00f8bd912b73b4f63149cc808dbf..jpeg
>>(there should be exactly one dot...)
>>
>>The corresponding parts of the quopri encoded HTML looks like this:
>>....<img=
>>src=3D"http://www.fujinews.de/images/news/f68f57c1c67dc319d84f7c11c8b71b65=
>>..jpeg" alt=3D"E550_seitliche_front_flash low res.jpg" vspace=3D"4" hspace=
>>=3D"4" border=3D"0" align=3D"left" />...
> 
> 
> This is not a "quopri" problem but an SMTP problem.
> 
> The SMTP protocol requires that a dot at the beginning of a line
> is escaped by doubling (because it uses a line consisting of a
> single dot as end of message indicator). Of course, the SMTP reader
> is expected to remove this dublicated dot again.
> Somehow, your SMTL sender or reader got something wrong with
> the handling of a dots at the beginning of a line.
Seems to be rather common, as the dots in the quotation above are 
duplicated, too ;)
Wouldn't it then make sense that the quopri encoder encodes a dot at the 
beginning of a line as =2E ?? In a perfect world not, but obviously we 
have to live with broken software that we cannot control.
At least this pointed me to a possible solution. When I will find the 
time, I'll try to hack the encoder a bit and see if this fixes the problem.




More information about the Python-list mailing list