Le 08/12/2010 16:54, Pavel Dimow a écrit :
Hi,
I know this is very bad, but I will need this only temporally.
Basically I need to forward email to one address depending on the
sender and recipient address
but still original recipient should receive email. I think that this
is maybe impossible using header checks or I am wrong?
For example I need something like this:
If sender is d...@example.com and recipient is coy...@foobar.com then
deliver this email to coy...@foobar.com and gr...@foobar.com
if your problem is temporary, read below. else, forget about this.
if your postfix has the "bcc" action in access(5), you can use it:
smtpd_restriction_class =
..
restriction_rdr_doe
smtpd_sender_restrictions =
check_sender_access hash:/etc/postfix/sender_doe
restriction_rdr_doe =
check_recipient_access hash:/etc/postfix/recipient_doe
== sender_doe
d...@€xample.com restriction_rdr_doe
== recipient_doe
coy...@example.org redirect b...@example.net
== virtual_aliases
b...@temp.example coy...@example.org, road.run...@example.net
as you can see:
- this is a bit convoluted
- it doesn't scale well. (you need one restriction class and two access
files for each doe/coyote pair... etc).
also, I am assuming envelope addresses, not headers. there's no way to
do that with headers (currently, header_checks act on _one_ header at a
time).
Or this is dovecot's job?
if you have sieve in dovecot, then it's a better place.
PS. note that the (envelope) sender and headers (From:, Reply-To:) are
different things.