summaryrefslogtreecommitdiffstats
path: root/test-wallace.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-02 15:47:14 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-02 15:47:14 +0000
commit219e2a96d15e867b220cc92ee91a03ede0984cfc (patch)
tree47e076cbfc4c94295856609fad9d81d59143fcad /test-wallace.py
parent2d7c188c7bea6932918d74715c32b2575358dd4a (diff)
downloadpykolab-219e2a96d15e867b220cc92ee91a03ede0984cfc.tar.gz
Add the bare bones of Wallace with the optout module
Diffstat (limited to 'test-wallace.py')
-rwxr-xr-xtest-wallace.py93
1 files changed, 93 insertions, 0 deletions
diff --git a/test-wallace.py b/test-wallace.py
new file mode 100755
index 0000000..84d3488
--- /dev/null
+++ b/test-wallace.py
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+#
+# Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com)
+#
+# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 3 or, at your option, any later version
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+import smtplib
+import socket
+import sys
+
+# For development purposes
+sys.path.extend(['.', '..'])
+
+from email.MIMEMultipart import MIMEMultipart
+from email.MIMEBase import MIMEBase
+from email.MIMEText import MIMEText
+from email.Utils import COMMASPACE, formatdate
+from email import Encoders
+
+def send_mail(send_from, send_to, send_with=None):
+ smtp = smtplib.SMTP("localhost", 8025)
+ smtp.set_debuglevel(True)
+ subject = "This is a Kolab load test mail"
+ text = """Hi there,
+
+I am a Kolab Groupware test email, generated by a script that makes
+me send lots of email to lots of people using one account and a bunch
+of delegation blah.
+
+Your response, though completely unnecessary, would be appreciated, because
+being a fictitious character doesn't do my address book of friends any good.
+
+Kind regards,
+
+Lucy Meier.
+"""
+
+ msg = MIMEMultipart()
+ msg['From'] = send_from
+ msg['To'] = COMMASPACE.join(send_to)
+ msg['Date'] = formatdate(localtime=True)
+ msg['Subject'] = subject
+
+ msg.attach( MIMEText(text) )
+
+ #msg.attach( MIMEBase('application', open('/boot/initrd-plymouth.img').read()) )
+
+ smtp.sendmail(send_from, send_to, msg.as_string())
+
+if __name__ == "__main__":
+ #send_to = [
+ #'Jeroen van Meeuwen <jeroen.vanmeeuwen@klab.cc>',
+ #'Aleksander Machniak <aleksander.machniak@klab.cc>',
+ #'Georg Greve <georg.greve@klab.cc>',
+ #'Paul Adams <paul.adams@klab.cc>',
+ #'Thomas Broderli <thomas.broderli@klab.cc>',
+ #'Christoph Wickert <christoph.wickert@klab.cc>',
+ #'Lucy Meier <lucy.meier@klab.cc>',
+ #]
+
+
+ #send_mail(
+ #'Jeroen van Meeuwen <jeroen.vanmeeuwen@klab.cc>',
+ #send_to
+ #)
+
+ #send_mail(
+ #'Lucy Meier on behalf of Paul Adams <paul.adams@test90.kolabsys.com>',
+ #send_to
+ #)
+
+ #send_mail(
+ #'Lucy Meier on behalf of Georg Greve <georg.greve@test90.kolabsys.com>',
+ #send_to
+ #)
+
+ send_to = [ 'Jeroen van Meeuwen <jeroen.vanmeeuwen@klab.cc>' ]
+
+ send_mail('Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>', send_to)