rev 3594 - debbugs-illa/bts

Pierre Habouzit madcoder at costa.debian.org
Tue Apr 18 17:37:40 UTC 2006


Author: madcoder
Date: 2006-04-18 17:37:39 +0000 (Tue, 18 Apr 2006)
New Revision: 3594

Added:
   debbugs-illa/bts/mailer.py
Log:
forgot a svn add



Added: debbugs-illa/bts/mailer.py
===================================================================
--- debbugs-illa/bts/mailer.py	2006-04-18 17:37:00 UTC (rev 3593)
+++ debbugs-illa/bts/mailer.py	2006-04-18 17:37:39 UTC (rev 3594)
@@ -0,0 +1,51 @@
+# vim:set encoding=utf-8:
+###############################################################################
+# Copyright:
+#   © 2006 Pierre Habouzit <madcoder at debian.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the University nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+###############################################################################
+
+import smtplib
+from email.MIMEText import MIMEText
+
+class BtsMailer:
+    def __init__(self):
+        self.smtp = smtplib.SMTP()
+        self.smtp.connect()
+
+    def BtsMail(self, body):
+        msg = MIMEText(body)
+        msg['Content-Type'] = 'text/plain; charset="utf-8"'
+        # actual value is not used, http://www.debian.org/Bugs/Reporting
+        msg['X-Debbugs-No-Ack'] = 'no-acks'
+        return msg
+
+    def sendmail(self, From, To, Msg):
+        self.smtp.sendmail(From, To, Msg)
+
+    def unlink(self):
+        self.smtp.close()
+




More information about the pkg-kde-commits mailing list