Hi there.
We are starting to move some of our email to destinations in the cloud.
There are several ways to make this work right including virtual aliases
but the cleanest way seemed to me to be a per user transport map lookups
for cloud users. But we only have two possible final destinations and
don't want to end up with really large transport tables on different
servers. We also split our local and external smtp to reduce spam scan
related congestion so the next hop to the cloud is different depending
in where the mail is coming from. So I wanted a way to do one simple
ldap look up that would mean something different depending on the server.
My first working attempt uses this for and ldap transport lookup:
query_filter = (uid=%u)
result_attribute = mailHost
and
result_format = smtp:[%s]
on the internal servers or
result_format = :%s
on the external servers. This queries ldap, returns a FQDN in mail host
and then either goes to the host it resolves to as next hop or queries
MX records pointing to our cloud destination. This works ok but doesn't
allow for load balancing and failover on the way out.
Then I found through experimentation that though you have to have a
legitimate result_attribute or postfix ignores the rule you don't seem
to actually have to do anything with it in the result_format.
So I did this:
query_filter = (&(uid=%u)(CloudMail=true))
result_attribute = randomldapattribute
and
result_format = :externalfacingmx.edu
internally
or
result_format = :cloudmx.edu
externally
This seems to work great on my test server. If the query filter is true
it delivers it to the next hop in the result_format and goes on to the
domain defaults in my regular transport file if not. I like this a lot
because it is very simple and uses an ldap attribute that can be
multipurpose and the same for every cloud user or mail server.
But as this seemed like an unintended use of result_format I wanted to
be sure that it won't cause any side effects before I put it into
production.
Could it cause any unexpected behavior?
--
John Baker
Network Administrator
Marlboro College
Phone: 451-7551 Cell: 451-6748