Problem with quopri in email

  • Thread starter Benjamin Niemann
  • Start date
B

Benjamin Niemann

Hi,

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" />...

The dropped/duplicated dot is at the beginning of the line - other images are
not affected.

Mailreaders with IE6 as HTML renderer make both mistakes (dropping and
duplicating the dot), others like Lotus Notes 5 or various webmailers only
duplicate the dot.

I'm using Python 2.2.1 on Debian 3.0
The version of email module is 2.5.3 (not the one from the Python2.2 package).

Whose fault is it?
I found nothing in RFC 1521 that disallows lines starting with a dot (unless
it's the only character on the line) - the fragment above seems to be valid
quoted-printable, as far as I can tell. Am I right?
If it is not a bug in the email module, has anyone ideas for a workaround?
(except forcing our client not to use Notes 5 anymore ;)


Greetings from Heidelberg,
Benjamin Niemann
 
D

Dieter Maurer

Benjamin Niemann said:
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.


Dieter
 
B

Benjamin Niemann

Dieter said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,109
Latest member
JanieMalco
Top