zope.sendmail unnecessarily errors out when checking async directories
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Plone |
Confirmed
|
Unknown
|
|||
Zope 2 |
Invalid
|
Low
|
Unassigned | ||
zope.sendmail |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Noticed when testing plone 4 beta 5, which uses zope 2.12.7, which looks to be zope.sendmail 3.5.1. Reviewing the changeset it doesn't look like this bug has been addressed but if so I apologize for double reporting.
For async queuing, if you select a default directory that already exists, i.e. /tmp (which is the default), and try to save the changes in the ZMI, the following error throws:
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module Products.
Module Products.
Module Products.
Module zope.sendmail.
Module zope.sendmail.
ValueError: /tmp is not a Maildir folder
Digging in maildir.py, this looks like a simple fix on logic - if the base directory already exists it doesn't create the required subfolders, however it errors on the check for them:
def __init__(self, path, create=False):
...
if create and not access(path):
maildir = True
else:
maildir = (os.path.
if not maildir:
raise ValueError('%s is not a Maildir folder' % path)
....
On a somewhat related note, the names of those subfolders are extra generic and there is a potential that if people were to put that in /tmp as suggested, they would either get clobbered or accidentally deleted. This could be easily fixed with the fix + a better default.
Changed in plone: | |
status: | Unknown → Confirmed |
Changed in zope2: | |
importance: | Undecided → Low |
status: | New → Confirmed |
The zope.sendmail project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope. sendmail.