[Digicool-CVS] CVS: CVSROOT - postcommit_actions:1.128
Ken Manheimer
klm@zope.com
Thu, 9 Aug 2001 12:58:29 -0400
Update of /cvs-repository/CVSROOT
In directory cvs.zope.org:/tmp/cvs-serv25846
Modified Files:
postcommit_actions
Log Message:
Another tiny fix, to circumvent sendmail error warnings that were
cluttering our run log.
Switch sendmail command over to _not_ use "arpanet" mode, but still
collect the From line from the message. Setting file permissions to
do the arpanet mode operation without sendmail error messages is a
pain, and we can use a combination of command line args and specifying
the right stuff in the file to get it to work (thanks to baymountain
guys for finding a combo that threaded the twisty maze). PITA to find
the right combination that accommodates sendmail, but it works.
=== CVSROOT/postcommit_actions 1.127 => 1.128 ===
CVSMASTER = "cvs-admin@zope.com"
-MAIL_CMD = "/usr/lib/sendmail -ba"
+# You have to plug in the recipients email address via '%' string formatting.
+MAIL_CMD = "/usr/lib/sendmail -t -f %s"
WAIT = 0 # Fork unless --wait is requested.
DRYRUN = 0 # '--dryrun' option
@@ -389,18 +390,21 @@
if not email:
email = OFFICIAL_SENDER
- cmd = ("%s%s%s %s %s" % ((VERBOSE and "set -x; ") or "",
- (DRYRUN and "echo Would do: ") or "",
- mailcmd,
- (VERBOSE and "-v") or "",
- string.join(addrs, ",")))
+ cmd = ("%(verbose1)s%(dryrun)s%(mailcmd)s %(verbose2)s"
+ % {'verbose1': (VERBOSE and "set -x; ") or "",
+ 'dryrun': (DRYRUN and "echo Would do: ") or "",
+ 'mailcmd': mailcmd % email,
+ 'verbose2': (VERBOSE and "-v") or ""})
if VERBOSE:
complain("%sDoing mail cmd for user %s:\n\t%s\n",
((DRYRUN and "NOT ") or ""), user, cmd)
- text = ("Subject: %(subject)s\nTo: %(to)s\n"
- "From: %(from)s\nSender: %(sender)s\n\n"
+ text = ("Subject: %(subject)s\n"
+ "To: %(to)s\n"
+ "From: %(from)s\n"
+ "Sender: %(sender)s\n"
+ "\n"
"%(text)s"
% {'subject': subject,
'to': string.join(addrs, ","),