[vhffs-dev] [1100] GIT post-receive scripts now send emails using SMTP server on loopback to avoid chroot issues .

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1100
Author:   beuss
Date:     2007-12-01 15:29:03 +0000 (Sat, 01 Dec 2007)

Log Message:
-----------
GIT post-receive scripts now send emails using SMTP server on loopback to avoid chroot issues.

Modified Paths:
--------------
    trunk/vhffs-robots/misc/git_post-receive
    trunk/vhffs-test-dependencies.in


Modified: trunk/vhffs-robots/misc/git_post-receive
===================================================================
--- trunk/vhffs-robots/misc/git_post-receive	2007-11-29 07:10:29 UTC (rev 1099)
+++ trunk/vhffs-robots/misc/git_post-receive	2007-12-01 15:29:03 UTC (rev 1100)
@@ -176,17 +176,18 @@
 {
 	# --- Email (all stdout will be the email)
 	# Generate header
+    current_date=`date -R`
 	cat <<-EOF
 	To: $recipients
+	Date: $current_date
 	Subject: ${EMAILPREFIX}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe
 	X-Git-Refname: $refname
 	X-Git-Reftype: $refname_type
 	X-Git-Oldrev: $oldrev
 	X-Git-Newrev: $newrev
 
-	This is an automated email from the git hooks/post-receive script. It was
-	generated because a ref change was pushed to the repository containing
-	the project "$projectdesc".
+	This is an automated email from git. It was enerated because a ref
+	change was pushed to the repository "$projectdesc".
 
 	The $refname_type, $short_refname has been ${change_type}d
 	EOF
@@ -572,11 +573,7 @@
 
 send_mail()
 {
-	if [ -n "$envelopesender" ]; then
-		/usr/sbin/sendmail -t -f "$envelopesender"
-	else
-		/usr/sbin/sendmail -t
-	fi
+    perl -e 'use Email::Send; my $message = (defined($ARGV[0]) ? "From: ".$ARGV[0]."\n" : ""); while(<STDIN>) { $message .= $_; } my $sender = new Email::Send( { mailer => "SMTP" } ); $sender->mailer_args([Host => "127.0.0.1"]); $sender->send($message);' $envelopesender;
 }
 
 # ---------------------------- main()

Modified: trunk/vhffs-test-dependencies.in
===================================================================
--- trunk/vhffs-test-dependencies.in	2007-11-29 07:10:29 UTC (rev 1099)
+++ trunk/vhffs-test-dependencies.in	2007-12-01 15:29:03 UTC (rev 1100)
@@ -44,7 +44,8 @@
     ('HTML::Template::Expr', '')];
 
 $dep{'robots'} = [
-    ('SVN::Notify', '')];
+    ('SVN::Notify', ''),
+    ('Email::Send', '')];
 
 &GetOptions( \%args,
 	'u|usage',


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/