Hi, whats wrong with this script? try: mailhost=getattr(context, context.superValues('Mail Host')[0].id) except: raise AttributeError, "cant find a Mail Host object" mMsg = 'subscribe' mTo = 'sudelbuch-request@mailman.webpool.de' mFrom = email mSubj = 'subscribe' mailhost.send(mMsg, mTo, mFrom, mSubj) return container.Antwort(inhalt=email) It works in zope 2.5.1. but in 2.6.0 I get this error: [...] Request URL http://213.133.101.209:11580/Sudelbuch/addMailinglistMember Exception Type TypeError Exception Value an integer is required Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module Products.PythonScripts.PythonScript, line 315, in _exec Module Script (Python), line 11, in addMailinglistMember <PythonScript at /Sudelbuch/addMailinglistMember> Line 11 Module Products.MailHost.MailHost, line 125, in send Module Products.MailHost.MailHost, line 144, in _send Module smtplib, line 187, in __init__ Module smtplib, line 222, in connect TypeError: an integer is required TIA juh -- "Ein Fischer ist noch keine Fangflotte." Gunda Roestel, Sprecherin der Gruenen, zur Lage ihrer Partei
From: "Jan Ulrich Hasecke" <janulrich.hasecke@web.de>
Module Products.MailHost.MailHost, line 144, in _send Module smtplib, line 187, in __init__ Module smtplib, line 222, in connect TypeError: an integer is required
Your smtp-port is stored as a string. Update the MailHost settings once and it should be changed to an integer.
"Lennart Regebro" <lennart@regebro.nu> schrieb:
From: "Jan Ulrich Hasecke" <janulrich.hasecke@web.de>
Module Products.MailHost.MailHost, line 144, in _send Module smtplib, line 187, in __init__ Module smtplib, line 222, in connect TypeError: an integer is required
Your smtp-port is stored as a string. Update the MailHost settings once and it should be changed to an integer.
Lennart, you saved my day! :-) Thanks! juh -- Eine Weltbürgerin zieht aufs Land http://www.spiegel.de/netzwelt/netzkultur/0,1518,53445,00.html
FCC: /home/clemens/Mail/outgoing --text follows this line--
From: "Jan Ulrich Hasecke" <janulrich.hasecke@web.de>
Module Products.MailHost.MailHost, line 144, in _send Module smtplib, line 187, in __init__ Module smtplib, line 222, in connect TypeError: an integer is required
Your smtp-port is stored as a string. Update the MailHost settings once and it should be changed to an integer.
... this problem actually affects _all_ MailHost instances when upgrading from Zope2.5.1 (or earlier) to 2.6.0, as in 2.5.1 the smtp-port has been stored as a string, but is now stored as int in 2.6.0 I guessed a little hint about this incompatibility in the release notes would have been nice, but I can find nothing in this regard. There is a hint in the doc/CHANGES.txt, that the MailHost has been improved with respect to sending a date header now, but the type change is not mentioned there. Did I miss some place to look at, or should the release notes possibly be improved with respect to this? Cheers, Clemens
From: "Clemens Robbenhaar" <robbenhaar@espresto.com>
I guessed a little hint about this incompatibility in the release notes would have been nice, but I can find nothing in this regard.
I don't think anybody really was aware of it... :-/ It has to be fixed to 2.6.1 of course. The question is: Should the fix be to cast the smtp_port into an int every use (simple, functional, safe, ugly) or something else?
Did I miss some place to look at, or should the release notes possibly be improved with respect to this?
I checked some history. Up to 2.4 it was stored as an integer. For some reason it was changed between the final 2.5 beta and 2.5 release to be stored as a string, and then cast into an integer each time it was used. I don't know the rationale behind this change. However, the current MailHost is first appeared as a fix for several header problems I had already back in Zope 2.3, and this is probably why this change between 2.4 and 2.5 wasn't caught by the 2.6 MailHost. I based it on a 2.5 beta MailHost and must simply have missed this change, or at least not realized the effects of it.
participants (4)
-
Clemens Robbenhaar -
Jan Ulrich Hasecke -
Lennart Regebro -
Lennart Regebro