[ZCM] [ZC] 816/ 4 Resolve "dtml-sendmail corrupts header is message is blank"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Sat, 22 Feb 2003 10:19:14 -0500


Issue #816 Update (Resolve) "dtml-sendmail corrupts header is message is blank"
 Status Resolved, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/816

==============================================================
= Resolve - Entry #4 by ajung on Feb 22, 2003 10:19 am

 Status: Pending => Resolved

Fixed on 2.6 branch and HEAD.

-aj
________________________________________
= Comment - Entry #3 by mjablonski on Feb 22, 2003 10:07 am

The problem is in Zope/lib/python/Products/MailHost/MailHost.py. messageText is stripped, so the last header-line is "stripped of its newline." An lstrip() fixes the problem (only strip whitespace in front of header, leave all unchanged after the header). 
      
173c173
<     mfile=StringIO(messageText.strip())
---
>     mfile=StringIO(messageText.lstrip())

________________________________________
= Comment - Entry #2 by ajung on Feb 21, 2003 1:06 pm

can you provide a patch?
________________________________________
= Request - Entry #1 by Anonymous User on Feb 20, 2003 4:29 pm

When using a dtml-sendmail and specifying To:, From:, and Subject:, if there is no message text after the blank line (or no blank line at all), Zope appends the Date: header to the Subject: header, e.g., 
"Subject: This is a testDate: February 21, 2003..."

Sending emails with only a subject and no message text is commonly used in sending commands to listservers.

==============================================================