[Zope] dtml-sendmail and envelop sender [Q]

Bruno Mattarollo bruno@dynamic.greenpeace.org
Mon, 19 Mar 2001 18:21:13 +0100


Thank you Stefan,

    I was just writing an external method that would do what you recommen=
d.
Great! Thanks to everybody!!! It works as expected!

Cheers!

/B
----- Original Message -----
From: "Stefan H. Holek" <stefan@epy.co.at>
To: <zope@zope.org>
Cc: "Bruno Mattarollo" <bruno@dynamic.greenpeace.org>
Sent: Monday, March 19, 2001 5:58 PM
Subject: Re: [Zope] dtml-sendmail and envelop sender [Q]


--On Montag, 19. M=E4rz 2001 17:10 +0100 Frank Tegtmeyer
<frank.tegtmeyer@cia-mediahaus.de> wrote:

>> So according to the spec I should use "Sender: <dtml-var
>> OurBounceProcessingAccount>" in our DTML-Method that uses
>> dtml-sendmail, no?
>
> To handle autoresponders etc. that's ok. It doesn't handle delivery
> failures. You HAVE TO set the envelope sender accordingly (I think for
> Postfix it's the -f switch like for sendmail). To do that you have to
> generate a new method - possibly as external Python method.

After we all agreed that "Errors-To:" is bad ;)
your external method could look like this:

import os

sendcommand  =3D '/usr/sbin/sendmail -t -oi -f%s'
mailtemplate =3D 'From: %s\nTo: %s\nSubject: %s\n%s\n'

def sendMail( bounceto, mailfrom, mailto, subject, body ):
  p =3D os.popen( sendcommand % (bounceto), 'w', 1 )
  p.write( mailtemplate % (mailfrom, mailto, subject, body) )
  p.close()


HTH,
Stefan

--
Things work better when plugged in.