changeset 13612:96f1427cec2e

2059 nightly(1) should support custom From: in mail Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Joshua M. Clulow <josh@sysmgr.org>
date Thu, 02 Feb 2012 22:09:15 +1100
parents 4af57d96fcca
children 8abd7b12d92f
files usr/src/tools/env/illumos.sh usr/src/tools/scripts/nightly.1 usr/src/tools/scripts/nightly.sh
diffstat 3 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/tools/env/illumos.sh	Fri Feb 03 09:39:03 2012 +0000
+++ b/usr/src/tools/env/illumos.sh	Thu Feb 02 22:09:15 2012 +1100
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2010, 2011 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 #
 
 # Configuration variables for the runtime environment of the nightly
@@ -118,6 +119,10 @@
 export STAFFER="$LOGNAME"
 export MAILTO="$STAFFER"
 
+# If you wish the mail messages to be From: an arbitrary address, export
+# MAILFROM.
+#export MAILFROM="user@example.com"
+
 # The project (see project(4)) under which to run this build.  If not
 # specified, the build is simply run in a new task in the current project.
 export BUILD_PROJECT=''
--- a/usr/src/tools/scripts/nightly.1	Fri Feb 03 09:39:03 2012 +0000
+++ b/usr/src/tools/scripts/nightly.1	Thu Feb 02 22:09:15 2012 +1100
@@ -17,6 +17,7 @@
 .\" " CDDL HEADER END
 .\" "
 .\" "Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+.\" "Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 .\" "
 .TH nightly 1 "6 July 2010"
 .SH NAME
@@ -407,6 +408,12 @@
 the build (for the \-m option).
 .RE
 .LP
+.B MAILFROM
+.RS 5
+The address to be used for From: in the completion e-mail at the
+end of the build (for the \-m option).
+.RE
+.LP
 .B REF_PROTO_LIST
 .RS 5
 Name of file used with protocmp to compare proto area contents.
--- a/usr/src/tools/scripts/nightly.sh	Fri Feb 03 09:39:03 2012 +0000
+++ b/usr/src/tools/scripts/nightly.sh	Thu Feb 02 22:09:15 2012 +1100
@@ -24,6 +24,7 @@
 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2008, 2010, Richard Lowe
 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 #
 # Based on the nightly script from the integration folks,
 # Mostly modified and owned by mike_s.
@@ -1767,10 +1768,19 @@
 	run_hook POST_NIGHTLY $state
 	run_hook SYS_POST_NIGHTLY $state
 
+	#
+	# mailx(1) sets From: based on the -r flag
+	# if it is given.
+	#
+	mailx_r=
+	if [[ -n "${MAILFROM}" ]]; then
+		mailx_r="-r ${MAILFROM}"
+	fi
+
 	cat $build_time_file $build_environ_file $mail_msg_file \
 	    > ${LLOG}/mail_msg
 	if [ "$m_FLAG" = "y" ]; then
-	    	cat ${LLOG}/mail_msg | /usr/bin/mailx -s \
+	    	cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
 	"Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
 			${MAILTO}
 	fi