[Zope] BUG: Nasty dtml-sendmail bug - Zope 2.2.4b1, Zope 2.1.6

Dieter Maurer dieter@handshake.de
Wed, 22 Nov 2000 23:41:28 +0100 (CET)


Today, I spend 3 hours to analyse a nasty dtml-sendmail bug (Zope 2.1.6):

  Zope reported an SMTP exception: "recipient required"

  It turned out that the "messageText" that arrived in
  "Products.MailHost.MailHost.send" started with an
  empty line. Therefore, "decapitate" could not
  find the "To:", "From:" and "Subject:" headers
  and called "smtplib.send" with an empty "to" list.

  What really confused me: my DTML code did not show
  any sign, where this empty line should come from.
  Moreover, an identically locking DTML object
  worked as expected.


Explanation:
  A collegue had edited the DTML object causing the problems
  with a *WINDOWS* editor and then uploaded the file.
  The Windows editor had added a Control-M after the
  "<dtml-sendmail mailhost=...>".
  This Control-M caused the spurious empty line.

  In the edit view, the browser did not show the Control-M.
  Therefore, the faulty and the correct DTML objects
  looked completely identical.


I verified that the same bug is in Zope 2.2.4b1, too.
Furthermore, the check for missing "To" and "From" is
ineffective (as "extractHeader" always adds a "To" and "From"
to header, just empty if it can not find the headers).

I will put this into the collector.


Dieter