[Zope-Checkins]
SVN: Zope/trunk/lib/python/Products/MailHost/MailHost.py
catching exception in queueLength() if the configured
Andreas Jung
andreas at andreas-jung.com
Sun Sep 9 10:01:33 EDT 2007
Log message for revision 79540:
catching exception in queueLength() if the configured
queue directory causes an error
Changed:
U Zope/trunk/lib/python/Products/MailHost/MailHost.py
-=-
Modified: Zope/trunk/lib/python/Products/MailHost/MailHost.py
===================================================================
--- Zope/trunk/lib/python/Products/MailHost/MailHost.py 2007-09-09 13:55:37 UTC (rev 79539)
+++ Zope/trunk/lib/python/Products/MailHost/MailHost.py 2007-09-09 14:01:32 UTC (rev 79540)
@@ -95,7 +95,10 @@
+OFS.SimpleItem.Item.manage_options
)
+ def __setstate__(self, state):
+ import pdb; pdb.set_trace()
+
def __init__(self, id='', title='', smtp_host='localhost', smtp_port=25,
force_tls=False,
smtp_uid='', smtp_pwd='', smtp_queue=False, smtp_queue_directory='/tmp'):
@@ -232,8 +235,12 @@
def queueLength(self):
""" return length of mail queue """
- maildir = Maildir(self.smtp_queue_directory)
- return len([item for item in maildir])
+ try:
+ maildir = Maildir(self.smtp_queue_directory)
+ return len([item for item in maildir])
+ except ValueError:
+ return 'n/a - %s is not a maildir - please verify your ' \
+ 'configuration' % self.smtp_queue_directory
security.declareProtected(view, 'queueThreadAlive')
More information about the Zope-Checkins
mailing list