Howdy,
The following, untested patch adds rudimentary smtplib support to
mailer.py. I would appreciate it if someone would test it.
Matt
* tools/hook-scripts/mailer.py
(main): Send mail with smtplib.
* tools/hook-scripts/mailer.conf.example
(from_addr, to_addr): New.
Index: tools/hook-scripts/mailer.py
===================================================================
--- tools/hook-scripts/mailer.py (revision 4318)
+++ tools/hook-scripts/mailer.py (working copy)
@@ -13,6 +13,8 @@
import string
import ConfigParser
import time
+import cStringIO
+import smtplib
import svn.fs
import svn.util
@@ -37,9 +39,11 @@
1, # use_copy_history
pool)
- ### pipe it to sendmail rather than stdout
- generate_content(sys.stdout, cfg, repos, editor, pool)
-
+ msg = cStringIO.cStringIO()
+ generate_content(msg, cfg, repos, editor, pool)
+ server = smtplib.SMTP()
+ server.sendmail(cfg.general.from_addr, [cfg.general.to_addr], msg.getvalue())
+ server.quit()
def generate_content(output, cfg, repos, editor, pool):
Index: tools/hook-scripts/mailer.conf.example
===================================================================
--- tools/hook-scripts/mailer.conf.example (revision 4318)
+++ tools/hook-scripts/mailer.conf.example (working copy)
@@ -10,3 +10,8 @@
### know how I plan to allow the insertion of spaces)
diff = /usr/bin/diff -u -L "%(label_from)s" -L "%(label_to)s" "%(from)s" "%(to)s"
+### the from address
+from_addr = foo@invalid
+
+### the to address
+to_addr = bar@invalid
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 10 02:28:52 2003