[Zope-dev] What to do when one mail recipient fails out of several?

Lennart Regebro lennart@regebro.nu
Thu, 15 Nov 2001 12:34:57 +0100


There is currently a poposal to make MailHost transactional, so you can be
sure that you sent the mail. However, when you have multiple recipients,
that doesn't solve the problem, because then you actually get "half done"
transactions.
Smtplib.SMTP.sendmail is nice enough to send back a list of which mails
failed, but Zope can't really do much with that list. If it returns an
error, the user will resend the mail to all recipients, if it ignores it (as
today) the user will think all mails went through.

The problem really lies in the binary mode of error/success that web will
have in this case. There is no partial success, either you get up an error
page or you don't.

My thought about how to solve this is to make an addition to
smtplib.SMTP.sendmail(), an new parameter "stopOnRcptErr" or something, that
defaults to "False", which gives todays functionality. MailHost could then
call smtplib.SMTP.sendmail with stopOnRcptErr=True, which would then raise a
SMTPSenderRefused error if any of the recipients fail.

My questions:
1. What do you think? Is this reasonable?
2. Does anybody know where to send suggestions for changed Python stuff?
python-help doesn't seem right...