I would like to know if i can configure postfix to forward mails if user
not found in local recipient table.

That is possible (with static: mapping) but not a good idea.
May i know why it's not a good idea?

Forwarding ALL recipients not in the local recipient table will
make your server a source of backscatter mail (accept spam from an
innocent sender address to a non-existent recipient, then return
the mail as undeliverable).
I thought you were talking about creating a static map with valid recipients. I had configured to forward ALL; later it occurred to me.

Users are split between LDAP in my server and a remote server for
example.com. So if u...@example.com is not present in LDAP it must
forward to remote server.

How would Postfix know that the address is valid? If your answer
is: return the message to the sender if ther recipient is not valid,
then that is the wrong reply.

I would have to use a static map of valid addresses, otherwise the mail
would loop between 2 servers.

You have changed the problem from "forward ALL recipients not
in the local recipient table" to "forward SPECIFIC recipients".
The latter can be done with virtual_alias_maps.

/etc/postfix/main.cf
     myorigin = example.com
     virtual_alias_maps = hash:/etc/postfix/virtual
     # NOT: virtual_alias_domains = example.com

/etc/postfix/virtual
     f...@example.com   foo@other.example
     b...@example.com   bar@other.example

Have configured with a list of valid recipients. Thanks for all the help.


--
-- Akshay
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to