macros in reports [Was: Re: Update Annoyances]

David Lee t.d.lee at DURHAM.AC.UK
Fri Oct 17 17:59:49 IST 2003

On Sun, 12 Oct 2003, Kevin Spicer wrote:

> [...]
> reports - The ability to expand macros in reports (so for example the
> signature could be a macro set in the config file, or elsewhere)  this
> would save the effort of having to go through each file, diff the
> changes and copy them accross just so you get the correct contact
> details in the reports.  Maybe, instead of putting macro definitions in
> the config file have a macros file for each language in the reports
> directory?
> [...]

Earlier this week, prompted by Kevin's email above, I sent Julian off-list
a "me, too", in case he was counting votes on this issue.  He wasn't, but
we did have a useful general email chat expanding Kevin's idea.  As a
result, he asked me to open it up to the list.  So here it is.

We recognised that there are many files of message texts (such as
"reports/en/deleted.virus.message.txt") and that each one potentially
needed local maintenance (i.e. potentially tedious manual intervention)
across MailScanner releases, and yet that there was potentially much
commonality, not just the signature.

The very sketchy, hazy idea that I put to Julian was:

====================== snip =================
>I hadn't really thought about the detail!  But I had simply realised
>that this mechanism might be more widely useful to some people.  Perhaps:
>   1.  Title of message.
>   2.  Some sort of "site-legal" paragraph that might have commonality
>       across messages within a site, but differ from site to site.
>   3. Some sort of "country-legal" paragraph (e.g. RIP act for the UK).
>      (Care not to confuse this with locale/language e.g. "reports/en".)
>A possibility (probably impractical, but a useful thought-exercise)
>might be to envisage the message files (currently the entire text) being
>replaced by a set of macro references (and only macro references in the
>thought-exercise).  I have no idea what the syntax is, but as pseudo-code:
>-- msg start --
>-- msg end --
>A general "TITLE" ("INTRO" etc.) would always be defined (possibly null).
>The macro expansion mechanism would use this, unless overriden by a more
>specific "TITLE-VIRUS-DELETED" definition in the configuration.
====================== snip =================

The idea of that thought-exercise is that the files is that the file
contents would simply macro references, general enough so that for most
sites, most files could remain as defaults (no maintenance), and that the
macro definitions could be concentrated in one place (localised manual
intervention, possibly assisted by "patch"/"diff" etc.).

A related aspect is that it allows the content (macro definitions, via a
central config) and the presentation (macro references, via files (would
they continue to be files?)) to have a decent separation.

The idea is to help 90% of the sites, 90% of the time: we realise that
reaching 100% is probably impossible, and that diminishing returns could
rapidly take over if this is pushed too far.

So there it is.  Rip it apart!


:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:            South Road            :
:                                           Durham                :
:  Phone: +44 191 334 2752                  U.K.                  :

More information about the MailScanner mailing list