-1

I would like to use an Exim filter file to create a newsletter: accepting mail from specified contributor addresses, then forwarding on to specified subscriber addresses. The below works, but is there a more elegant and robust approach?

# Exim filter
if
    $reply_address contains "eric@i.com" or
    $reply_address contains "graham@c.com"
then
    seen 
    deliver john@c.com
    deliver michael@p.com
    deliver terry@gj.com
endif
u003f
  • 473
  • 1
  • 6
  • 12

2 Answers2

0

Using a sender address to determine recipients is unusual. I would just an alias file. You could base it off the system alias router:

exim.conf

system_aliases:

  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup{$local_part}lsearch{/etc/aliases}}
  file_transport = address_file
  pipe_transport = address_pipe

/etc/aliases

mailinglist: john@c.com, michael@p.com, terry@gj.com
Jim U
  • 3,318
  • 1
  • 14
  • 24
0

Use this configuration to maintain your mailing lists in a single file, one address per line.

exim.conf

# append "mailinglist" to local domains so that "mailinglist" is
# recognized as a domain we handle.  Alternatively, you could just
# use your own domain and not bother with this

domainlist local_domains = @ : localhost : localhost.localdomain : mydomain.com : mailinglist

...

begin routers

...

mailing_lists:
  driver = redirect
  domains = mailinglist
  no_more
  file = /etc/exim/mailinglists/$local_part
  no_check_local_user
  forbid_pipe
  forbid_file
  errors_to = myusername@mydomain.net

/etc/exim/mailinglists/list01

john@c.com
michael@p.com
terry@gj.com

send test message to mailinglist "list01"

echo body | mail -s Test list01@mailinglist
Jim U
  • 3,318
  • 1
  • 14
  • 24
  • As above: what about the contributors?- people (here eric and graham) allowed to post **to** the newsletter? – u003f May 05 '17 at 23:13