0

There has been a request to have public mailboxes such as jobs@ and sales@ for example.

We have a working proof of concept as below:

#Public mailbox router
public_mailbox:  
  local_part_suffix = +*
  local_part_suffix_optional
  driver = accept
  transport = public_delivery
  condition = ${if eq {${local_part}} {jobs}}

#Public mailbox transport
public_delivery:
  driver = appendfile
  maildir_format = true
  create_directory = true
  mode_fail_narrower = false
  directory = /var/mail/public/.${local_part}/
  user = mail
  group = mail
  delivery_date_add = true
  envelope_to_add = true  

This works as expected for a single address.

I am trying to have it lookup a list of addresses or local parts in a file as there will be multiple public folders one for each address.

Any help would be much appreciated.

Many thanks

Daniel

1 Answers1

1

In order to store the local parts in a file, create a file (e.g. /etc/exim4/public-addresses) with content:

jobs:
sales:
...

and replace the condition = ${if eq{$local_part}{jobs}} with:

local_parts = lsearch;/etc/exim4/public-addresses

Remark that, if the addresses are not too many, you can use a : separated list:

local_parts = jobs : sales : public1 : public2 : ...
Piotr P. Karwasz
  • 5,748
  • 2
  • 11
  • 21