[Zope] sendmail host hardcoded ?

Dieter Maurer dieter@handshake.de
Wed, 21 Feb 2001 19:52:13 +0100 (CET)


Gijs Reulen writes:
 > I am trying to pass a variable with the hostname to the smtphost parameter
 > of sendmail:
 > ...
 > <dtml-sendmail
 > smtphost="PARENTS[_.len(PARENTS)-1].getProperty('mail_smtphost')">
 > ...
 > This results in a host not found error. However, when I hardcode the
 > smtphost like:
 > 
 > <dtml-sendmail smtphost="192.168.0.20">
 > 
 > This works.
It take the attribute value (without evaluation) as host name.

If you really need, you may extend "sendmail":

  The usual proceedure would be to provide an additional
  attribute "smtphost_expr" that behaves exactly like
  "smtphost" but expects a Python expression as attribute
  value, evaluates it and the uses it as "smtphost" would
  do, if it got this attribute.

  The attributes of "dtml-mime" have been extended along this
  line. You may look at them on how to implement it.


Dieter