[Zope3-checkins] CVS: Zope3/src/zope/app/mail - configure.zcml:1.1.14.3 mailer.py:1.3.2.4 meta.zcml:1.1.14.4 metaconfigure.py:1.2.2.4

Albertas Agejevas alga@codeworks.lt
Mon, 23 Jun 2003 07:13:54 -0400


Update of /cvs-repository/Zope3/src/zope/app/mail
In directory cvs.zope.org:/tmp/cvs-serv19503/src/zope/app/mail

Modified Files:
      Tag: cw-mail-branch
	configure.zcml mailer.py meta.zcml metaconfigure.py 
Log Message:
Configuration related things:
  * fixed a bug where smtplib was fed a unicode string and barfed
  * renamed name attributes on mailer to id


=== Zope3/src/zope/app/mail/configure.zcml 1.1.14.2 => 1.1.14.3 ===
--- Zope3/src/zope/app/mail/configure.zcml:1.1.14.2	Sun Jun 22 13:47:26 2003
+++ Zope3/src/zope/app/mail/configure.zcml	Mon Jun 23 07:13:24 2003
@@ -1,6 +1,7 @@
 <zopeConfigure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:mail="http://namespaces.zope.org/mail"
+   xmlns:browser="http://namespaces.zope.org/browser"
    >
 
   <serviceType id="Mail"
@@ -13,14 +14,18 @@
 
   <mail:smtpMailer name="smtp" hostname="localhost" port="25" />
 
-  <--
-  <comment>
+  <!--
     To send mail, uncomment the following directive and be sure to
     create the queue directory.
-  </comment>
+   -->
 
   <mail:queuedService permission="zope.SendMail"
-		      queuePath="./queue"
-		      mailer="sendmail" />
-   -->
+                      queuePath="./queue"
+                      mailer="smtp" />
+  <browser:view for="zope.app.interfaces.content.folder.IRootFolder"
+               permission="zope.Public"
+	       class=".test.Foo"
+	       name="send"
+	       />
+
 </zopeConfigure>


=== Zope3/src/zope/app/mail/mailer.py 1.3.2.3 => 1.3.2.4 ===
--- Zope3/src/zope/app/mail/mailer.py:1.3.2.3	Sun Jun 22 10:23:15 2003
+++ Zope3/src/zope/app/mail/mailer.py	Mon Jun 23 07:13:24 2003
@@ -55,7 +55,7 @@
         self.password = password
 
     def send(self, fromaddr, toaddrs, message):
-        connection = self.smtp(self.hostname, self.port)
+        connection = self.smtp(self.hostname, str(self.port))
         if self.username is not None and self.password is not None:
             connection.login(self.username, self.password)
         connection.sendmail(fromaddr, toaddrs, message)


=== Zope3/src/zope/app/mail/meta.zcml 1.1.14.3 => 1.1.14.4 ===
--- Zope3/src/zope/app/mail/meta.zcml:1.1.14.3	Sun Jun 22 13:47:26 2003
+++ Zope3/src/zope/app/mail/meta.zcml	Mon Jun 23 07:13:24 2003
@@ -30,7 +30,7 @@
 
       <attribute name="mailer" required="yes">
         <description>
-          The name of the mailer used by this service.
+          The id of the mailer used by this service.
         </description>
       </attribute>
 
@@ -70,9 +70,9 @@
         Registers a new Sendmail mailer.
       </description>
 
-      <attribute name="name" required="yes">
+      <attribute name="id" required="yes">
         <description>
-          Name of the mailer.
+          Id of the mailer.
         </description>
       </attribute>
 
@@ -91,7 +91,7 @@
         Registers a new SMTP mailer.
       </description>
 
-      <attribute name="name" required="yes">
+      <attribute name="id" required="yes">
         <description>
           Name of the mailer.
         </description>


=== Zope3/src/zope/app/mail/metaconfigure.py 1.2.2.3 => 1.2.2.4 ===
--- Zope3/src/zope/app/mail/metaconfigure.py:1.2.2.3	Sun Jun 22 13:47:26 2003
+++ Zope3/src/zope/app/mail/metaconfigure.py	Mon Jun 23 07:13:24 2003
@@ -66,19 +66,19 @@
         ]
 
 
-def sendmailMailer(_context, name,
+def sendmailMailer(_context, id,
                    command="/usr/lib/sendmail -oem -oi -f %(from)s %(to)s"):
-    return [Action(discriminator=('mailer', name),
+    return [Action(discriminator=('mailer', id),
                    callable=provideMailer,
-                   args=(name, SendmailMailer(command)),)
+                   args=(id, SendmailMailer(command)),)
         ]
 
 
-def smtpMailer(_context, name, hostname="localhost", port="25",
+def smtpMailer(_context, id, hostname="localhost", port="25",
                username=None, password=None):
-    return [Action(discriminator=('mailer', name),
+    return [Action(discriminator=('mailer', id),
                    callable=provideMailer,
-                   args=(name, SMTPMailer(hostname, port,
+                   args=(id, SMTPMailer(hostname, port,
                                           username, password)),)
         ]