Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRINTING_MAILHOST_FIXED_ADDRESS handles the e-mail address as a list of chars #4

Closed
fredvd opened this issue Sep 20, 2016 · 2 comments

Comments

@fredvd
Copy link
Member

fredvd commented Sep 20, 2016

At least with some add'ons (Products.EasyNewsletter), the address specified as a fixed address is passed in as a string where PrintingMailhost considers it as a list. The MailHost object then start to send e-mails to every single letter of the address, which will fail.

Need to check if this also happens for for example the generic contact form and if it's a general bug or something also triggered by weirdness in the add'on.

@mauritsvanrees
Copy link
Member

Works fine locally. I end up in smtplib.py of core Python 2.7.12, which takes care of it this way:

    if isinstance(to_addrs, basestring):
        to_addrs = [to_addrs]

I don't notice anything relevant in the release notes https://hg.python.org/cpython/raw-file/v2.7.12/Misc/NEWS

Looking in the Python sourcecode, this has been in there since 1998:
https://hg.python.org/cpython/annotate/3bdd0e790bc9/Lib/smtplib.py#l383

Locally I get a greylist error, which is irrelevant here, but the traceback shows the code that is in use around sending mail:

Traceback (most recent call last):
  File "/Users/maurits/shared-eggs/Products.CMFPlone-4.3.11-py2.7.egg/Products/CMFPlone/patches/sendmail.py", line 12, in _catch
    return func(*args, **kwargs)
  File "/Users/maurits/shared-eggs/zope.sendmail-3.7.5-py2.7.egg/zope/sendmail/mailer.py", line 77, in send
    connection.sendmail(fromaddr, toaddrs, message)
  File "/usr/local/pythons/parts/opt/lib/python2.7/smtplib.py", line 742, in sendmail
    raise SMTPRecipientsRefused(senderrs)

It could be that a different code path is taken. This is when testing from the mail control panel form.

Anyway, it is easy enough to do a similar fix in our code.

@mauritsvanrees
Copy link
Member

I have released 1.0 with a fix. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants