List of variables for substitution in reports?
Jim Holland
mailscanner at mango.zw
Tue Sep 5 09:22:02 IST 2006
On Thu, 31 Aug 2006, David Lee wrote:
> Julian: The end of a typical report (e.g. "recipient.spam.report.txt")
> has a 'signature' such as:
>
> ----------- snip ---------------
> MailScanner
> Email Virus Scanner
> %org-long-name%
> %web-site%
>
> For all your IT requirements visit: http://www.transtec.co.uk
> ----------- snip ---------------
>
> Our site likes to keep local changes to a minimum, so we try to take your
> reports as they are.
>
> But that final advertisement line isn't appropriate for our site. (And I
> would guess that we probably aren't alone in this.) Having to chop it out
> means a lot of potentially unnecessary maintenance effort as new versions
> of MS go in and their potentially changed reports have to be checked and
> reconciled.
>
> I can understand that you (as MS author) want to give recognition to one
> of your sponsors where reasonably possible. Fair enough; fine.
>
> So could I suggest that you introduce a new variable, such as %sponsor%,
> and use that in your reports. Your default value of %sponsor% could still
> be something about "transtec" (i.e. an untweaked install of MS would
> produce the same result as above).
>
> Supplementary: You might also introduce another variable, say %site-msg%,
> default value empty, which would allow a site to insert its own tag line
> (mission statement etc.) if it so chose.
>
> Hope that helps. (I'd be happy to try to beta-test this for you.)
I understand your problem, and have the same view of it here. However I
think that this could just be left to the users themselves to sort out
rather than adding yet another option. The work involved in fixing it
yourself is negligible - just run a one-line script in the report
directory such as:
perl -pi -e 's/For all your IT requirements visit.*//' *
or
perl -pi -e 's/For all your IT requirements visit.*/Our Mission Statement . . ./' *
and if you want to avoid dealing with all the rpmnew report files
that would appear after an upgrade, just run this before the above in the
same directory:
for file in *rpmnew; do mv -f $file `echo $file|sed s/.rpmnew//`; done
I find it essential to have a bash script to do the upgrades anyway - to
backup the old version, run Julian's install.sh script, log its output,
stop MailScanner, run the upgrade_MailScanner_conf script, view the diffs,
run the upgrade_languages_conf script, view the diffs etc. before manually
restarting MailScanner. It is then easy enough to include the above one
or two lines as appropriate.
Regards
Jim Holland
System Administrator
MANGO - Zimbabwe's non-profit e-mail service
More information about the MailScanner
mailing list