[Zope] strange bug with mail&redirection

Joerg Wittenberger Joerg Wittenberger <Joerg.Wittenberger@pobox.com>
Tue, 14 Sep 1999 21:52:25 +0200 (CEST)


Hello folks,

I've got a code snippet, which seems to reveal at least one bug:

I have a dtml method, which receives a form input and either a) tries
to transfers control to another method, if it's there or b) changes
some properties and redirects to another form:

<dtml-try>
 <dtml-var "_['t' + `status` + 'to' + `REQUEST.form['status']`]">
<dtml-except>
 <dtml-call "propertysheets.manage_changeProperties(REQUEST)">
 <dtml-call "RESPONSE.redirect(URL1 + '/edit')">
</dtml-try>

now I have another dtml method "t5to6", which sends some mail and
shares the rest of the operation:

<!--#sendmail smtphost="localhost" -->
To: jerry@localhost
From: Transition
Subject: STATUS: <dtml-var title> <dtml-var number> 5 -> 6

Statusübergang
<!--#/sendmail-->

<dtml-call "propertysheets.manage_changeProperties(REQUEST)">
<dtml-call "RESPONSE.redirect(URL1 + '/edit')">

Problem I (less hard):

Sometimes all I do is edit the "t5to6", after that I get the message
"AttributeError" __call__.  I can solve that by deleting and
recreating the dtml method.

Problem II (real part):

The method sends mail at most one time, but most of the time I see an
error "Invalid Header 0:" from DTMLMethod.py line 398.

I don't get that error when I either don't redirect or don't send
mail.  (Using mailhost instead of smtphost won't help.)

/Jerry

-- 
        You can have it done fast,
        you can have it done cheap,
        and you can have it done well.
        --- But you can only have two of those at once.