Hi all,

I made some changes to the requestsponsor script. It fixes an error
while trying to find the debian/changelog and adds support for msmtp
or sendmail.

Cheers,


Rodrigo Belem.
--- requestsponsor.orig	2007-09-13 12:32:03.000000000 -0400
+++ requestsponsor	2007-09-13 12:28:31.000000000 -0400
@@ -26,7 +26,10 @@
 release = None
 for l in diff.splitlines():
     if l.startswith('+++ '):
-	in_changelog = l.endswith('/debian/changelog')
+        for i in l.split():
+	    in_changelog = i.endswith('/debian/changelog')
+            if in_changelog:
+                break
     if in_changelog:
 	m = changelog_header_re.match(l)
 	if m:
@@ -77,6 +80,12 @@
 %s''' % (myemailaddr, to, package, signed_mailbody)
 
 s = smtplib.SMTP()
-s.connect()
-s.sendmail(myemailaddr, to, mail)
-s.close()
+try:
+    s.connect()
+except:
+    cmd = subprocess.Popen(['/usr/sbin/sendmail', '-t'], stdin=subprocess.PIPE, close_fds=True)
+    pipe = cmd.stdin
+    pipe.write(mail)
+else:
+    s.sendmail(myemailaddr, to, mail)
+    s.close()
-- 
Ubuntu-motu mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu

Reply via email to