brian moore
2004-05-26 18:35:20 UTC
Okay, the story is we're migrating a few thousand users from one machine
(running, ick, sendmail) to a brand spanking new postfix box.
The transition so far: set the new box to be MX and use a transport map
to send mail to the old machine except for a few addresses we're taking
over.... Ie, it looks like this:
efn.org slowsite:[clavin.efn.org]
***@efn.org local
***@efn.org local
***@efn.org local
etc. (slowsite mailer since they're using sendmail and it stops
accepting mail periodically so I have followed the 'bottlenecks'
advice on a high concurrency limit but low process limit transport
so that it doesn't get too backlogged.)
Now, here's the catch: when a new user is created (or one is pulled off
the existing server and moved here), I want to do the following steps:
1) set per-user transport to be 'defer'
2) sync the mailboxes
3) set perdition to use the local pop/imap servers
4) set per-user transport to the 'local' mailer
Basically make postfix the buffer during the transition of a user (or
managable size group of users). This should make it all happy and
good...
I have bit of perl that does:
tie %transport, 'DB_File', '/etc/postfix/transport-transition.db', O_CREAT|O_RDWR, 0666, $DB_HASH ;
$transport{$user . '@efn.org' } = 'local';
Which in theory should work. In fact, it does: the transport file is
updated... But postfix doesn't notice...
I'm lazy and didn't want to figure out why it didn't notice, so I forced
it into 'postmap -i' so that if there's some little trick to updating in
a way that postfix picks up, it should happen... but it doesn't. :/
samwise:/usr/local/sbin# ls -l /etc/postfix/transport-transition.db
-rw-r--r-- 1 root root 12288 May 26 11:03 /etc/postfix/transport-transition.db
samwise:/usr/local/sbin# postmap -q ***@efn.org /etc/postfix/transport-transition.db
local
but I see as recently as 11:27 that postfix has tried to send mail to
the slowsite transport.
I know that trivial-rewrite figures out the transport stuff, but it's
invoked at two stages: when the mail is first entered into the system
and it's placed in 'incoming', and again when qmgr figures out what to
do with it...
But...
samwise:/usr/local/sbin# ps aux | grep triv
postfix 21568 0.2 0.0 3448 1640 ? S 11:05 0:04 trivial-rewrite -n rewrite -t unix -u -c
postfix 21728 0.1 0.0 3316 1556 ? S 11:09 0:02 trivial-rewrite -n rewrite -t unix -u -c
so, both of those started after the last update to transport, so they
should both have the same version of the transport-transition.db file
that postmap -q sees....
But then why isn't qmgr figuring out to send these locally?
Is there a better 'trick' to get postfix to first forward all mail (on a
per-user basis), then hold it, then deliver it to a local address that
I could be using?
(running, ick, sendmail) to a brand spanking new postfix box.
The transition so far: set the new box to be MX and use a transport map
to send mail to the old machine except for a few addresses we're taking
over.... Ie, it looks like this:
efn.org slowsite:[clavin.efn.org]
***@efn.org local
***@efn.org local
***@efn.org local
etc. (slowsite mailer since they're using sendmail and it stops
accepting mail periodically so I have followed the 'bottlenecks'
advice on a high concurrency limit but low process limit transport
so that it doesn't get too backlogged.)
Now, here's the catch: when a new user is created (or one is pulled off
the existing server and moved here), I want to do the following steps:
1) set per-user transport to be 'defer'
2) sync the mailboxes
3) set perdition to use the local pop/imap servers
4) set per-user transport to the 'local' mailer
Basically make postfix the buffer during the transition of a user (or
managable size group of users). This should make it all happy and
good...
I have bit of perl that does:
tie %transport, 'DB_File', '/etc/postfix/transport-transition.db', O_CREAT|O_RDWR, 0666, $DB_HASH ;
$transport{$user . '@efn.org' } = 'local';
Which in theory should work. In fact, it does: the transport file is
updated... But postfix doesn't notice...
I'm lazy and didn't want to figure out why it didn't notice, so I forced
it into 'postmap -i' so that if there's some little trick to updating in
a way that postfix picks up, it should happen... but it doesn't. :/
samwise:/usr/local/sbin# ls -l /etc/postfix/transport-transition.db
-rw-r--r-- 1 root root 12288 May 26 11:03 /etc/postfix/transport-transition.db
samwise:/usr/local/sbin# postmap -q ***@efn.org /etc/postfix/transport-transition.db
local
but I see as recently as 11:27 that postfix has tried to send mail to
the slowsite transport.
I know that trivial-rewrite figures out the transport stuff, but it's
invoked at two stages: when the mail is first entered into the system
and it's placed in 'incoming', and again when qmgr figures out what to
do with it...
But...
samwise:/usr/local/sbin# ps aux | grep triv
postfix 21568 0.2 0.0 3448 1640 ? S 11:05 0:04 trivial-rewrite -n rewrite -t unix -u -c
postfix 21728 0.1 0.0 3316 1556 ? S 11:09 0:02 trivial-rewrite -n rewrite -t unix -u -c
so, both of those started after the last update to transport, so they
should both have the same version of the transport-transition.db file
that postmap -q sees....
But then why isn't qmgr figuring out to send these locally?
Is there a better 'trick' to get postfix to first forward all mail (on a
per-user basis), then hold it, then deliver it to a local address that
I could be using?
--
| And as we watch him digging his own grave
| It is important to know that was where he's at
brian moore <***@rom.org> | He can't afford to stop...That is what he believe
| He'll keep on digging for a thousand years.
| -- talking heads
| And as we watch him digging his own grave
| It is important to know that was where he's at
brian moore <***@rom.org> | He can't afford to stop...That is what he believe
| He'll keep on digging for a thousand years.
| -- talking heads