This is by way of a sanity check; I believe something is not possible to
do in Postfix without resorting to external code, but would be very pleased
if I was proved wrong.

Suppose I have a catchall delivery for a (virtual) domain into a mailbox:

   @domain => A

I also have a couple of other addresses in the same domain delivering to
their own mailboxes:

   p...@domain => B
   p...@domain => C

So far so good, easy to set up and things work as expected. Now for the
complication. In addition to the fully qualified addresses delivering to
their own mailboxes I require a copy of this mail delivered into the
catchall mailbox:

   p...@domain => B, A
   p...@domain => C, A

Now, providing I'm prepared to do an address rewrite I can set this up as
follows:

virtual_alias_maps = hash:virtual_aliases
virtual_mailbox_maps = hash:virtual_mailbox_recipients

virtual_aliases:
p...@domain p...@domain catch...@domain
p...@domain p...@domain catch...@domain

virtual_mailbox_recipients:
@domain A
p...@domain B
p...@domain C

The problem is that I don't want to see that rewrite to catch...@domain being done, because of just one more little complication. Instead of delivering to mailbox A, I want mail that would arrive there sent on to another MTA, so my
configuration looks like this:

virtual_alias_maps = hash:virtual_aliases
virtual_mailbox_maps = hash:virtual_mailbox_recipients
transport_maps = hash:transport

virtual_aliases:
p...@domain p...@domain catch...@domain
p...@domain p...@domain catch...@domain

virtual_mailbox_recipients:
@domain OK
p...@domain B
p...@domain C

transport:
domain smtp:[MTA]
p...@domain virtual
p...@domain virtual

If I allow that address rewite then mail for p...@domain or p...@domain will get
sent on to the MTA with an envelope recipient address of catch...@domain
rather than their original recipient address.

I've tried various work arounds without success. The one that seems most
natural, but which DOES NOT WORK, is the following:

virtual_aliases:
p...@domain @domain p...@domain
p...@domain @domain p...@domain

This results in mail for either address only arriving in their own mailbox.

Is there another approach to this that I'm missing?

Reply via email to