Hi,
I gate some mailinglists to newsgroups. For this I use the following two
router entries:
#v+
mail2news_admin:
local_part_prefix = ml- : nl-
condition = $h_x-list-administrivia:
driver = redirect
data = postmaster
mail2news:
condition = ${lookup{$local_part}lsearch{/etc/exim4/mail2news}}
driver = redirect
data = "|/usr/lib/news/bin/mailpost -a usenet@??? \
${extract {1}{,}{${lookup{$local_part}lsearch{/etc/exim4/mail2news}}}}"
pipe_transport = address_pipe
errors_to = postmaster
headers_add = "Subject: ${sg {$rh_subject:} \
{\\\\[${extract {2}{,}{${lookup{$local_part}lsearch{/etc/exim4/mail2news}}}}\\\\] }{}}\n"
headers_remove = newsgroups:distribution:x-spam-report:received:errors-to:subject
#v-
Currently all my addresses are named ml- or nl-, which makes the check
for mail2news_admin simple. But if I would not use such prefixes, how
often becomes the ${lookup evaluated? Does exim cache the result?
The entry in mail2news may have two components: newsgroup,subjectpart
e.g. local.exim,exim. If the second component is present [subjectpart]
should be removed from the string otherwise subject should not be
modified. How can I achieve this?
Other comments on my idea? Can I make something better or write somewhat
shorter? Can I refer the result of condition anyhow? Maybe
${extract{2}{,}{$condition}}
Bye, Jörg.
--
Ein Mensch sieht ein und das ist wichtig,
nichts ist ganz flach und nichts ganz richtig.
(Eugen Roth)