[CentOS] Large scale Postfix/Cyrus email system for 100, 000+ users

Tue Oct 23 19:23:20 UTC 2007
mouss <mlist.only at free.fr>

Matt Shields wrote:
> Data changes too frequently to generate the file every x number of
> minutes across all smtp servers.
> 
> The mysql db isn't a single server.  It's a master (read/write) with
> multiple replicas for read access.  Those replicas are load balanced
> with LVS (heartbeat/ldirectord/ipvsadm).  The postfix(smtp) incoming
> and outgoing servers are also load balanced with LVS.  So database
> read speed is not an issue.  Believe me, we know how to build large
> high traffic sites, the only problem we're having is the exact syntax
> on using transport_maps or virtual_transport with multiple lmtp
> transports, and I think I got that figured out with the
> transport_maps.  Will post more later.


the syntax is simple, but depends on the structure of your tables.


transport_maps =
	...
	proxy:mysql:/etc/postfix/maps/mysql/transport
	...

# cat /etc/postfix/maps/mysql/transport
hosts = 192.0.2.33 ...
user = youruser
password = yourpassword
dbname = yourdbname
query = select
		concat('lmtp:', host)
	from
		yourtable
	where
		mailbox = '%s'

The above assumes a simple {`mailbox`, `host`} structure. you'll need to
adjust the sql query to your table structure.