# HG changeset patch # User Joshua M. Clulow # Date 1328180955 -39600 # Node ID 96f1427cec2eb760ffdd060b74b6bc8a1c304b24 # Parent 4af57d96fcca19ab199dcff044fbcec350404c6d 2059 nightly(1) should support custom From: in mail Reviewed by: Richard Lowe Reviewed by: Garrett D'Amore Reviewed by: Bayard Bell Reviewed by: Igor Kozhukhov Approved by: Richard Lowe diff -r 4af57d96fcca -r 96f1427cec2e usr/src/tools/env/illumos.sh --- 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 # # 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='' diff -r 4af57d96fcca -r 96f1427cec2e usr/src/tools/scripts/nightly.1 --- 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 .\" " .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. diff -r 4af57d96fcca -r 96f1427cec2e usr/src/tools/scripts/nightly.sh --- 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 # # 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