at our site, we use Exim on a number of different kinds of servers. to
keep complexity down, we have separated the common bits into files which
can be included in each exim.conf. at this time, we have 14 different
exim.conf, so I'm sure you understand that this is essential to be able
to maintain the files consistently.
however, the current macro handling in Exim is quite restrictive: they
have to be set in the main section, and they can't be redefined. this
means that most macro definitions must be duplicated across each
exim.conf as we can't put the default values in a common include file
and redefine them where needed.
the enclosed patch adds support for macro definitions in the sections
"acls", "authenticators", "routers" and "transports". I wasn't sure if
the syntax could be added to the sections "local_scans", "retrys" and
"rewrites" without breaking backwards compatibility, so I didn't change
those. a macro definition can not appear in the middle of a
router/acl/transport stanza.
the patch also adds support for redefining a macro using the "==" token.
it is an error to redefine a non-existing macro, but you can use this
syntax to gather data, e.g.
OPTIONS = an_option
OPTIONS == OPTIONS new_option
OPTIONS == OPTIONS another_option
note that
MACRO ==foo
would previously set MACRO to "=foo", but it will now cause a syntax
panic as "MACRO" is undefined. the fix is to add a space:
MACRO = =foo
although backwards compatibility is broken somewhat, I think it will be
rare, and it will be discovered very quickly indeed by the admin ;-)
the patch also fixes a small inconsistency in that
MACRO1 = foo
MACRO = bar
is allowed in today's Exim, whereas
MACRO = bar
MACRO1 = foo
causes a syntax panic due to MACRO1 containing the name of an already
defined macro.
I would love to see this patch included upstream. thank you for your
consideration.
--
Kjetil T.
postmaster, University of Oslo
keep complexity down, we have separated the common bits into files which
can be included in each exim.conf. at this time, we have 14 different
exim.conf, so I'm sure you understand that this is essential to be able
to maintain the files consistently.
however, the current macro handling in Exim is quite restrictive: they
have to be set in the main section, and they can't be redefined. this
means that most macro definitions must be duplicated across each
exim.conf as we can't put the default values in a common include file
and redefine them where needed.
the enclosed patch adds support for macro definitions in the sections
"acls", "authenticators", "routers" and "transports". I wasn't sure if
the syntax could be added to the sections "local_scans", "retrys" and
"rewrites" without breaking backwards compatibility, so I didn't change
those. a macro definition can not appear in the middle of a
router/acl/transport stanza.
the patch also adds support for redefining a macro using the "==" token.
it is an error to redefine a non-existing macro, but you can use this
syntax to gather data, e.g.
OPTIONS = an_option
OPTIONS == OPTIONS new_option
OPTIONS == OPTIONS another_option
note that
MACRO ==foo
would previously set MACRO to "=foo", but it will now cause a syntax
panic as "MACRO" is undefined. the fix is to add a space:
MACRO = =foo
although backwards compatibility is broken somewhat, I think it will be
rare, and it will be discovered very quickly indeed by the admin ;-)
the patch also fixes a small inconsistency in that
MACRO1 = foo
MACRO = bar
is allowed in today's Exim, whereas
MACRO = bar
MACRO1 = foo
causes a syntax panic due to MACRO1 containing the name of an already
defined macro.
I would love to see this patch included upstream. thank you for your
consideration.
--
Kjetil T.
postmaster, University of Oslo