Just a note that the below idea works! Here is tutorial config for setting
up both local delivery AND remote forwarding. I guess this is really easy:

Put the text below (with your modifications) in a file, preferably in the
same directory where other Postfix configuration files are.

----------------------
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]
----------------------

Once this is done, put your ldap:[Location of above file] directive within a
virtual_alias_maps or alias_maps directive in your main configuration file.
This depends on whether the address being delivered to is read as a local or
virtual domain. A completely working example looks something like what I
have below:

ldap-forward-example.cf:
----------------------
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:

----------------------
#For virtual domains:
virtual_alias_maps = ldap:/etc/postfix/ldap-forward-example.cf
#
# OR
#
#For local domains:
 alias_maps = ldap:/etc/postfix/ldap-forward-example.cf

That should be it. Hope this helps someone. I have been searching all over
for this.

Regards,
Christopher Koeber


On Wed, Oct 20, 2010 at 10:09 PM, Christopher Koeber <ckoe...@gmail.com>wrote:

> Hello,
>
> My guess is that this is an easy question but I am not sure.
>
> I would like for the client to have the ability to forward email BUT I also
> need to keep a copy of that message. So, I have the following template that
> I believe can work for an alias file for an LDAP setup:
>
> server_host = [LDAP Server here]
> search_base = [Search Base Here]
> version=3
> timeout = 10
> bind = yes
> bind_dn = [bind-dn here]
> bind_pw = [bind password here]
> query_filter = (mail=%s)
> result_attribute = (local account?) + (forwarding account?)
>
> Now, I have a separate attribute called vacationForward within my LDAP
> system that contains the forwarding address. My local email address is
> stored as mail within LDAP.
>
> The problem is that I would need to return TWO results, correct? I need to
> return the local account and the forwarding account, correct?
>
> Thanks for any help with this.
>
> Regards,
> Christopher Koeber
>

Reply via email to