Forward or BCC email

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward or BCC email

Jeroen van Aart-2
I would like to know what is the simplest way to do the following:

Assuming my server is an MTA for domain example.net with local delivery
to mostly virtual users. Virtual user addresses look like
[hidden email]. These users often get emails from the example.org
domain.

Email received only from [hidden email] by one specific virtual user
with address [hidden email] needs to be BCC'ed or forwarded to
[hidden email]. The email for example.com is not handled by me.


I have read the available documentation for a while but haven't been
able to find a satisfactory solution. One solution that looks promising
was to use "sender_bcc_maps" however it appears that this can not be
used on a per (virtual) user basis, or recipient address.

I thought some kind of content inspection could work but that seems the
wrong approach.

Using a .forward file doesn't appear to work either because it will
forward everything and not differentiate based on the sender address.

For now it appears piping email to an external command using the users
.forward file is the only solution.

I may have just overlooked something obvious, but I got stuck.
Could anyone point to solution other than using piping in the .forward file?


Thanks,
Jeroen

--
Earthquake Magnitude: 5.3
Date: Sunday, September 23, 2012 06:40:53 UTC
Location: Fiji region
Latitude: -16.7502; Longitude: 175.5428
Depth: 22.60 km
Reply | Threaded
Open this post in threaded view
|

Re: Forward or BCC email

Noel Jones-2
On 9/24/2012 5:19 PM, Jeroen van Aart wrote:

> I would like to know what is the simplest way to do the following:
>
> Assuming my server is an MTA for domain example.net with local
> delivery to mostly virtual users. Virtual user addresses look like
> [hidden email]. These users often get emails from the
> example.org domain.
>
> Email received only from [hidden email] by one specific virtual
> user with address [hidden email] needs to be BCC'ed or
> forwarded to [hidden email]. The email for example.com is not
> handled by me.
>

To add a bcc: address for a specific sender+recipient combination,
you could use a restriction class that checks for that condition and
then returns the BCC access table action.  This works nicely for a
small number of conditions, but quickly gets awkward if you have
lots of sender+recipient combos to check.

documentation:
http://www.postfix.org/RESTRICTION_CLASS_README.html
http://www.postfix.org/access.5.html

A more flexible and scalable approach is to use an external policy
service.  You could probably convince postfwd to do this without
much effort, or use it as a starting point for your own creation.
http://www.postfix.org/SMTPD_POLICY_README.html
http://www.postfix.org/addon.html#policy


  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: Forward or BCC email

Jeroen van Aart-2
Noel Jones wrote:
> To add a bcc: address for a specific sender+recipient combination,
> you could use a restriction class that checks for that condition and

> documentation:
> http://www.postfix.org/RESTRICTION_CLASS_README.html
> http://www.postfix.org/access.5.html
>
> A more flexible and scalable approach is to use an external policy
> service.  You could probably convince postfwd to do this without
> much effort, or use it as a starting point for your own creation.
> http://www.postfix.org/SMTPD_POLICY_README.html
> http://www.postfix.org/addon.html#policy

Thank you, that gives me enough information to make something work. I
will report back what I did to make it work.

Thanks,
Jeroen

--
Earthquake Magnitude: 5.2
Date: Tuesday, September 25, 2012 19:42:32 UTC
Location: Solomon Islands
Latitude: -9.7643; Longitude: 159.7576
Depth: 27.50 km