On 04/25/2011 10:59 AM, Victor Duchovni wrote:
On Thu, Apr 21, 2011 at 02:59:27PM -0400, John Baker wrote:

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.
I think that per-user transport lookups are unwise.

Hi,

Thanks for the reply, could you tell me why per-user transports are unwise? Do they not scale well? Our numbers are fairly low.
     - Map each user's primary email address to a "mailbox" address
       for delivery.

     - Use a different "mailbox domain" for different hosting environments.

     - If absolutely necessary (the destination only supports the primary
       address), reverse the mapping via smtp_generic_maps in the master.cf
       entry for the transport feeding the problem destination.

We only host one domain with a few thousand accounts and less than 1,000 really active at any given time so I wonder if this would be overkill. Until now with our limited number of users we have had one final destination on a Linux machine with three other gateway servers existing to load balance spam checking and avoid congestion. Without spam and virus checking one simple machine would do.

I probably should have been clearer about this but people want Google Apps since it's all the rage in Education now. I , for various reasons, have been skeptical of the free lunch and am proceeding with caution and moving slowly. Their recommended method for the transition is a "domain alias" that would be a completely virtual domain that only exists behind the scenes on servers to transport mail. It looked to me like that was recommended because it's easy though not necessarily simple to setup. My boss wanted to do this with per-user mappings in /etc/alias on the current final destination to redirect mail to the google cloud. I didn't like that for a lot of reasons. As we were moving to ldap for alias and group mail checking anyhow the next step up from that was to use virtual_alias_maps to look to ldap and see if user had the apps domain for a final destination. In either of these aliases rewrite the address to match the "domain alias" that then has the appropriate next hop listed in the transport table. But I thought why not use the transport table mechanism to make a transport decision rather then add mechanisms for a virtual domain? It seemed cleaner particularly since we are not sure yet if we are in the long term transitioning or augmenting with a second possible final destination.

So guess the real question is if it's better for postfix to use an ldap lookup to decide the next hop and final destination with transport or to use setting like virtual_alias_maps or virtual_mailbox_domains to rewrite address after an ldap lookup to see whether or not the user is using Apps for Education to get their mail.
But we only have two possible final destinations and don't
want to end up with really large transport tables on different servers.
Your per-user primary ->  mailbox tables will be identical everywhere. The
transport mappings for the various "mailbox domains" may need to be
server-specific in some cases, but often do not. All each server needs to
know is which if any of the domains in question are its responsibility
(mydestination or virtual_mailbox_domains) and which are remote
(relay_domains). Then just define "relay_transport" and "virtual_transport"
appropriately.

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.
Being too clever is often not a good idea, instead deploy the appropriate
table definition to the appropriate nodes.

query_filter = (uid=%u)
result_attribute = mailHost
result_format = smtp:[%s]
This can be a transport table for remote users, provided local users
never have "mailHost" set, but this fails badly when the same LDAP data
needs to work on the mailHost machine.

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.
Fixed result formats are intentionally supported.

Fixed "query_filter" values generate a warning that you probably are
not doing the right thing.



--
John Baker
Network Administrator
Marlboro College
Phone: 451-7551 Cell: 451-6748

Reply via email to