From: Ian Jackson Date: Tue, 20 Apr 2010 16:49:33 +0000 (+0100) Subject: Substitute the message number for [REFERENCE] in added-headers, if present X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?p=modbot-mtm.git;a=commitdiff_plain;h=68ea4a368d293b3d2cf0d470af817ec300fd3553 Substitute the message number for [REFERENCE] in added-headers, if present --- diff --git a/stump/bin/processApproved b/stump/bin/processApproved index 1b2f176..a62333e 100755 --- a/stump/bin/processApproved +++ b/stump/bin/processApproved @@ -31,7 +31,12 @@ post() { ( echo Path: "$PATH_SUFFIX" - cat $MNG_ROOT/etc/added-headers | grep ': ' + perl <$MNG_ROOT/etc/added-headers -ne ' + next unless m/\:/; + s/\[REFERENCE\]/[$ENV{"WEBSTUMP_MESSAGENUM"}]/g + if defined $ENV{"WEBSTUMP_MESSAGENUM"}; + print or die $!; + ' # I do grep above because a lot of users inserts empty # lines in the added headers.