Re: [Zope] Troubleshooting Maildrop Host

2006-11-10 Thread Chris Withers

Nancy Donnelly wrote:

try:
mailhost=getattr(context, context.superValues('Mail Host')[0].id)


'Mail Host' won't find a Maildrop Host...


except:


Bare excepts like this are extremely bad programming practice...


raise AttributeError, Can't find a Mail Host object


Why not just let the original exception get raised?!


Yet, when I go to fire up the script, the email is not sent. What am I doing 
wrong here?


Quite a lot, I'm afraid...

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Troubleshooting Maildrop Host

2006-11-09 Thread Nancy Donnelly
102Hi;I can't get Maildrop Host to work. I have a working SMTP, Python 2.3.5, Zope 2.7.8, and am running FreeBSD. I've edited the config.py file thus:PYTHON="/usr/bin/python"MAILDROP_HOME="/tmp/maildrop"MAILDROP_SPOOL="/tmp/maildrop/spool-1; /tmp/maildrop/spool-2; /tmp/maildrop/spool-3;
 /tmp/maildrop/spool-4"MAILDROP_VAR="/tmp/maildrop/var"MAILDROP_PID_FILE="/var/run/maildrop/maildrop.pid"MAILDROP_LOG_FILE="/var/log/maildrop/maildrop.log"SMTP_HOST="localhost"SMTP_PORT=25MAILDROP_INTERVAL=120DEBUG=0DEBUG_RECEIVER=""MAILDROP_BATCH=0MAILDROP_TLS=0MAILDROP_LOGIN=""MAILDROP_PASSWORD=""WAIT_INTERVAL=0.0ADD_MESSAGEID=1I've fired up ./start_maildrop from the Products/Maildrop/maildrop/bin folder and a ps wax|grep maildrop yields a favorable result.I've added an instance of Maildrop through the ZMI.It appears I can reach the mail host because I use this code in my script:try: mailhost=getattr(context, context.superValues('Mail Host')[0].id)except: raise AttributeError, "Can't find a Mail Host object"and the error is not raised (rather, an error from a following page is raised, although perhaps I'm mistaken here?).Yet, when I
 go to fire up the script, the email is not sent. What am I doing wrong here?TIA,Nancy___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )