To keep the copy of the forwarded mail you should use this tutorial which I am giving you below. Use this script with your modification file I would like toi suggest you to use this script with the postfix configuration files which you have done before:
Code:
server_host = [LDAP HOST]
search_base = [Search Base - i.e. (ou=Where to Search,dc=example,dc=com)]
version=3
timeout = 10
size_limit = 1 (Directive to inform the LDAP searching utility that only one SET of results should come back per search (i.e. if I search for one CN then only one CN with all resultant attributes should be returned.)
bind = yes
bind_dn = [Bind DN for searching]
bind_pw = [Bind Password]
query_filter = ([Attribute to search for here]=%s) - Note that this is the address of the email being recieved.
result_attribute = [Attribute Containing Local Address], [Attribute Containing External Address], [More Attributes containing addresses, separated by commas]
After doing this now keep your LDAP directory file to the virtual_alias_maps. This depends on whether the address being distributed to is converted as a local or virtual domain. A totally operating pattern looks somewhat similar to what I have beneath:
Ldap-forward-example.cf:
Code:
server_host = ldap-server.example.com
search_base = ou=People,dc=example,dc=com
version=3
timeout = 10
size_limit = 1
bind = yes
bind_dn = cn=Manager,dc=example,dc=com
bind_pw = password
query_filter = (mail=%s)
result_attribute = mail, addressToForward
Within the main.cf file:
Code:
#for virtual domains:
virtual_alias_maps = ldap:/etc/postfix/ldap-forward-example.cf
#
# OR
#
#For local domains:
alias_maps = hash:/etc/mail/aliases,ldap:/etc/postfix/ldap-forward-example.cf
Bookmarks