repoze / repoze.sendmail

Send e-mails transactionally (originally cloned from zope.sendmail)
http://pypi.python.org/pypi/repoze.sendmail/
11 stars 25 forks source link

Fixes queued delivery script on Python 3.5 #39

Closed treinhard closed 7 years ago

treinhard commented 7 years ago

bin/qp --config qp.ini maildir fails on Python 3.5 because console script uses string value in connection.set_debuglevel while Python expects integer value (0/1/2):

Traceback (most recent call last):
  File "/Users/tobias/projects/mrt/lib/python3.5/site-packages/repoze/sendmail/queue.py", line 232, in _send_message
    self.mailer.send(fromaddr, toaddrs, message)
  File "/Users/tobias/projects/mrt/lib/python3.5/site-packages/repoze/sendmail/mailer.py", line 75, in send
    code, response = connection.ehlo()
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/smtplib.py", line 439, in ehlo
    self.putcmd(self.ehlo_msg, name or self.local_hostname)
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/smtplib.py", line 366, in putcmd
    self.send(str)
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/smtplib.py", line 344, in send
    if self.debuglevel > 0:
TypeError: unorderable types: str() > int()
tseaver commented 7 years ago

Thanks for the patch! It would be better to fix the value of self.debug_smtp as it is parsed from the config file: I have a change ready which does that instead.