[Checkins] SVN: zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/ added no_tls, force_tls to ISMTPMailer

Andreas Jung andreas at andreas-jung.com
Sat Aug 18 12:43:43 EDT 2007


Log message for revision 78955:
  added no_tls, force_tls to ISMTPMailer
  

Changed:
  U   zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/interfaces.py
  U   zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/mailer.py

-=-
Modified: zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/interfaces.py
===================================================================
--- zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/interfaces.py	2007-08-18 16:21:03 UTC (rev 78954)
+++ zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/interfaces.py	2007-08-18 16:43:43 UTC (rev 78955)
@@ -55,7 +55,7 @@
 __docformat__ = 'restructuredtext'
 
 from zope.interface import Interface, Attribute
-from zope.schema import Object, TextLine, Int, Password, BytesLine
+from zope.schema import Object, TextLine, Int, Password, BytesLine, Bool
 
 from zope.i18nmessageid import MessageFactory
 _ = MessageFactory('zope')
@@ -165,7 +165,15 @@
         title=_(u"Password"),
         description=_(u"Password used for optional SMTP authentication."))
 
+    no_tls = Bool(
+        title=_(u"No TLS"),
+        description=_(u"Never use TLS for sending email."))
 
+    force_tls = Bool(
+        title=_(u"Force TLS"),
+        description=_(u"Use TLS always for sending email."))
+
+
 class IMailEvent(Interface):
     """Generic mail event."""
 

Modified: zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/mailer.py
===================================================================
--- zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/mailer.py	2007-08-18 16:21:03 UTC (rev 78954)
+++ zope.sendmail/branches/ajung-encryption-branch/src/zope/sendmail/mailer.py	2007-08-18 16:43:43 UTC (rev 78955)
@@ -36,11 +36,13 @@
     smtp = SMTP
 
     def __init__(self, hostname='localhost', port=25,
-                 username=None, password=None):
+                 username=None, password=None, no_tls=False, force_tls=False):
         self.hostname = hostname
         self.port = port
         self.username = username
         self.password = password
+        self.force_tls = force_tls
+        self.no_tls = no_tls
 
     def send(self, fromaddr, toaddrs, message):
         connection = self.smtp(self.hostname, str(self.port))



More information about the Checkins mailing list