Move Postfix Virtual Maildirs to a new server?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Move Postfix Virtual Maildirs to a new server?

Dan Farrell
Greetings postfix gurus,

I have a modest postfix server; my own mailbox  has thousands of
messages, but most boxes have hundreds or even less.  But, I want to
migrate to a new server which also runs postfix, but uses mysql for
some storage, and perhaps even mail message storage itself.  

If I wanted to migrate with the flat-file message system I am using
now, I could just shut down the primary mailserver and let a backup
mailserver pick up the mail while I move the old mailboxes, right?
Then I can repoint the primary mailserver DNS A record, start up the
new server, and watch the newest batch of mail pour in, right?

If I wanted to use mysql to store the mail, I'll have to send it over
to the new mail server some other way to get it stored into mysql.  I
could perhaps write a little code to do it, but I would rather use a
built-in mechanism.  

Is there any way to re-process already delivered mail?  I would very
much like to update the MX records for all hosted mail domains and then
tell the old server to requeue all the mail in all the boxes.  I could
forsee the server picking up all this old mail and faithfully sending
it to the listed MX for the domain, which would by then be the new
server.

Is something like that available, or would I have to script it myself?

Thanks,

        Dan Farrell
Reply | Threaded
Open this post in threaded view
|

Re: Move Postfix Virtual Maildirs to a new server?

mouss-2
Dan Farrell wrote:

> Greetings postfix gurus,
>
> I have a modest postfix server; my own mailbox  has thousands of
> messages, but most boxes have hundreds or even less.  But, I want to
> migrate to a new server which also runs postfix, but uses mysql for
> some storage, and perhaps even mail message storage itself.  
>
> If I wanted to migrate with the flat-file message system I am using
> now, I could just shut down the primary mailserver and let a backup
> mailserver pick up the mail while I move the old mailboxes, right?

yes. but if users check their mail (imap, pop) during this migration,
they will not see all their mail. so some planning is needed to avoid
annoying users too much!

> Then I can repoint the primary mailserver DNS A record, start up the
> new server, and watch the newest batch of mail pour in, right?
>

you start the new server and make it work (and test it) before you
change the DNS records.

you can add another MX record and let both servers deliver mail to the
new server. then only stop the old server after a few days.

> If I wanted to use mysql to store the mail, I'll have to send it over
> to the new mail server some other way to get it stored into mysql.  I
> could perhaps write a little code to do it, but I would rather use a
> built-in mechanism.  
>

you could try dbmail, but it's not widely used. do you really want to go
that road?

> Is there any way to re-process already delivered mail?

if you chose the sql way, you can re-deliver old mail, although this may
be non trivial (if you redeliver with postfix, you may need to
remove/rewrite Delivered-To headers to avoid postfix thinking there is a
loop).

but better keep using files...

> I would very
> much like to update the MX records for all hosted mail domains and then
> tell the old server to requeue all the mail in all the boxes.  I could
> forsee the server picking up all this old mail and faithfully sending
> it to the listed MX for the domain, which would by then be the new
> server.
>
> Is something like that available, or would I have to script it myself?
>
> Thanks,
>
> Dan Farrell

Reply | Threaded
Open this post in threaded view
|

Re: Move Postfix Virtual Maildirs to a new server?

Dan Farrell
On Sun, 16 Nov 2008 08:03:17 +0100
mouss <[hidden email]> wrote:

> but better keep using files...

Thanks, Mouss, you've been a strong voice on the lists ever since I
joined.  

Do you recommend against SQL email storage in general?  

If so, what about SQL storage for virtual mailbox and virtual alias
databases?  

Do you know of any implementations of something like GlusterFS for a
mailbox storage scheme?  

(I am trying to devise a redundant storage system for my email; a mysql
cluster was one possibility, but I too don't much like the idea as
the cluster doesn't seem very fast.  I'm testing with DNS right now
and it seems to be doing all right, but I am starting to feel like it
isn't fast enough for a write-heavy service like email.  Gluster would
be better perhaps, but it's in heavy development.  Although, that can
be a good thing.  And I'm already leaning towards it as a good
replication & syncing technique for web server data... )

Thoughts, anyone?  

Thanks much, all readers.  
Reply | Threaded
Open this post in threaded view
|

Re: Move Postfix Virtual Maildirs to a new server?

Joel Reicher-2
> Do you recommend against SQL email storage in general?  

That may depend more on how the email is accessed after it's been delivered
than on the delivery system.

I'm far from an expert on this, but I've heard it said many times in IMAP
circles that relational databases don't seem to work well for mail storage.

> (I am trying to devise a redundant storage system for my email;
...
> Thoughts, anyone?  

It depends on what aspects of the system you're trying to make redundant.
Disks are best handled by RAID, locally-attached servers probably by SAN,
but entire networks or sites I don't really know. For that you probably
need replication of some kind.

Cheers,

        - Joel