Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Migrating from Sendmail to Postfix

635 views
Skip to first unread message

Nadim Bitar

unread,
Dec 2, 2002, 12:28:42 PM12/2/02
to
I have a running mail server that has around 500 email accounts, I am
configuring a new mail server that would run postfix+courier+mysql.
What is the easiest way to migrate without loss of mail.
Any suggestion highly appreciated, hints on testing the server locally
before going live also very appreciated.
thanks in advance.

Simon White

unread,
Dec 3, 2002, 4:58:25 AM12/3/02
to
02-Dec-02 at 10:30, Nadim Bitar (nad...@earthlink.net) wrote :

This is in the docs. I followed the docs and it worked perfectly.

Note: copying mailboxes to the other machine is the only thing outside
the scope of the docs. I did it over NFS while both machines were down;
if you're doing it on the same machine you don't even have to do this
part, unless you change mailbox format at the same time (bad idea;
change the daemon first, make sure it works, then do a separate
migration to new mailbox format if you need it)

--
[Simon White. vim/mutt. si...@mtds.com. Folding@home no log script yet...]
If it dies, it's biology. If it blows up, it's chemistry, and if it
doesn't work, it's physics.
[Linux user #170823 http://counter.li.org. Home cooked signature rotator.]

Nadim Bitar

unread,
Dec 6, 2002, 10:39:39 AM12/6/02
to
> This is in the docs. I followed the docs and it worked perfectly.
>
which docs are you refering to? I read almost all the docs on
postfix.org and I didn't come across this subject.
thanks

Simon White <si...@mtds.com>On 火, 2002-12-03 at 01:58, Simon White
wrote:

Simon White

unread,
Dec 9, 2002, 4:17:42 AM12/9/02
to
07-Dec-02 at 11:23, Nadim Bitar (nad...@earthlink.net) wrote :
> My problem is not installing and configuring, it's moving the mail from
> the old server to the new one without loosing new incoming mail.
> On ?$BEZ, 2002-12-07 at 03:46, Simon White wrote:
> > 06-Dec-02 at 07:37, Nadim Bitar (nad...@earthlink.net) wrote :

> > > > This is in the docs. I followed the docs and it worked perfectly.
> > > >
> > > which docs are you refering to? I read almost all the docs on
> > > postfix.org and I didn't come across this subject.
> > > thanks
> >
> > There is a link on the postfix pages to a HOWTO for Courier/MySQL
> >
> > Postfix and Courier both come with docs to help too. Download the
> > tarballs and extract them, and look for docs.

OK so you have an old (sendmail?) server and a new Postfix one.

In the standard docs, you have how to switch of sendmail forever. If
you're just going to install Postfix on a new server, then you still
need to switch off sendmail at some point, but not by exactly the same
method. Here are the steps.

Before you start: set a low TTL on your DNS to allow fast move over to
your new mail server as soon as it is ready.

1) Get Postfix up and running on the new server, tested properly.
2) Migrate user lists, accounts, aliases to the new machine, and test it
"offline"

- when you are sure that the new machine accepts mail properly and isn't
an open relay, then...

3) Move mail spools to new machine, either by mounting /var/spool/mail
over NFS to a separate directory and then copying files onto the local
HDD of the new machine. If you use the same /etc/passwd from the old
server, and the two servers are compliant in their parsing of
/etc/passwd, then file ownership will be correct. If you're doing
something cleverer than that, you can work out your own user migration
with MySQL, I'm sure. For example, you're going to create new mail
spools referenced virtually and MySQL will contain usernames; no
problem, but you'll have to script the mailbox move to give files
correct permissions and put them in the right places, probably.

4) Update DNS entries to point to the new host.

5) Stop sendmail on the old server, but allow it to flush its queue,
using the instructions in the readme (INSTALL) file

"Be sure to keep the old sendmail running for at least a couple
days to flush any unsent mail. To do so, stop the sendmail daemon
and restart it as:

# /usr/sbin/sendmail.OFF -q
"
Your binary will still be called sendmail, so you'll do

# /usr/sbin/sendmail -q

6) Start Postfix on the new machine, it should start picking up mail
almost immediately, and delivering to where it should go... voilà.

Cheers,

--
|-Simon White, Internet Services Manager, Certified Check Point CCSA.
|-MTDS Internet, Security, Anti-Virus, Linux and Hosting Solutions.
|-MTDS 14, rue du 16 novembre, Agdal, Rabat, Morocco.
|-MTDS tel +212.3.767.4861 - fax +212.3.767.4863

Nadim Bitar

unread,
Dec 9, 2002, 4:33:52 AM12/9/02
to
Thanks Simon for your help.
I would follow these steps and hopefully everything would go well.
I was mostly worried about the the Maildir incompatibility. The new mail
server is going to have virtual users and domains stored in MySQL. The
previous setup was a mess.

Simon White

unread,
Dec 9, 2002, 4:52:11 AM12/9/02
to
09-Dec-02 at 01:34, Nadim Bitar (nad...@earthlink.net) wrote :

> Thanks Simon for your help.
> I would follow these steps and hopefully everything would go well.
> I was mostly worried about the the Maildir incompatibility. The new mail
> server is going to have virtual users and domains stored in MySQL. The
> previous setup was a mess.

If you have mailboxes in Unix mbox format and you're migrating to
maildir, you're going to have to add a conversion step. There are
programs that can do this for you, check archives for mbox2maildir,
using mutt to change from mbox to maildir, and a post from Ralf about
another utility I don't remember the name of.

--
[Simon White. vim/mutt. si...@mtds.com. Folding@home no log script yet...]

Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind. -- Dr. Seuss

0 new messages