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

Stefan H. Holek stefan@epy.co.at
Mon, 19 Mar 2001 17:58:25 +0100


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