Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to get users who meet certain criteria in our LDAP to have their mail redirected to the same email prefix at a subdomain.

For example, if a mail is received to, an ldap lookup reveals this user has been migrated to gmail and so the mail needs to be forwarded to

I'd appreciate any help anyone can provide.

Many thanks Mike Dixson

share|improve this question

1 Answer 1

Ok go it working, I was approaching it from a bit of a wrong angle before. Here's the winning config:


relay_domains = $mydestination,
virtual_alias_maps = hash:/etc/postfix/, ldap:/etc/postfix/


# postmap /etc/postfix/
server_host =
server_port = 389
bind = no
search_base = dc=domain,dc=ac,dc=uk
query_filter = (&(|(mail=%s)(mailAlternateAddress=%s))(businessCategory=student)(eduPersonEntitlement=
result_filter =
result_attribute = mail

I hope that helps others with the same issue ahead of them.

Thanks Mike Dixson

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.