-1

I currently have this config and it works as intended

redirect2email_router:

driver = redirect
allow_fail
allow_defer
senders = lsearch;/usr/local/atmail/mailserver/senders.txt
data = recipient@domain.com
unseen

The problem is when I try to send to multiple recipients instead of one. I tried different syntaxes and even try to use lsearch with no luck. Most info out there is pertinent to alias so I'm kind of stuck here.

Any help would be appreciated.

Sven
  • 98,649
  • 14
  • 180
  • 226

1 Answers1

0

I'm not sure I understand the problem, so here are some variants:

  1. You want to send a BCC to the different recipients depend on sender.

You have to create the file bcc.list with lines "sender : recipient [: recipient ...]"

sender-a@domain.tld : recipient1@domain.tld
sender-a@domain.tld : recipient2@domain.tld
sender-b@domain.tld : recipient2@domain.tld : recipient3@domain.tld
sender-c@domain.tld : recipient1@domain.tld
. . . . .

If more then one line defined for specific sender, first one will be always used. Then you have to modify your router:

driver = redirect
allow_fail
allow_defer
data = ${lookup{$sender_address}lsearch{/path/bcc.list}}
unseen
  1. Number of BCC for number of recipients should be sended when specific sender is detected

You have to create bcc.list with one sender per line:

sender-a@domain.tld
sender-b@domain.tld
sender-c@domain.tld
. . . . .

And here is the router:

driver = redirect
allow_fail
allow_defer
senders = ${lookup{$sender_address}lsearch{/path/bcc.list}{yes}{no}}
data = recipient-1@domain.com : recipient-2@domain.com : recipient-3@domain.com
unseen
Kondybas
  • 6,964
  • 2
  • 20
  • 24