Migration from Sendmail to Postfix requires relatively little effort as the Postfix mail server uses the Sendmail alias file format and the compatibility programs sendmail, mailq and newaliases are also available.
Two alternative procedures are available for migrating from the Sendmail server to the Postfix mail server:
Installing the Postfix mail server only after the Sendmail server has been uninstalled.
Installing the Postfix mail server in parallel to the existing Sendmail server installation.
Installing the Postfix mail server after uninstalling the Sendmail server
If you uninstall the Sendmail server before you install the Postfix mail server, you must ensure that the e-mails contained in the Sendmail server’s mail queue (default: /var/mqueue) are delivered before Sendmail is uninstalled. This is required because Postfix uses a queue system which is not compatible with the Sendmail queue system.
Proceed as follows:
| Stop the sendmail daemon. Use the following command to start a Sendmail run to empty the Sendmail mail queue: /usr/sbin/sendmail -q |
| If e-mails are still left in the Sendmail mail queue: As required, make further attempts to deliver the remaining e-mails or delete them. |
| Start installation of the Postfix mail server (see "Installing and uninstalling the Postfix server (SMTP server)"). |
Installing the Postfix mail server in parallel to the existing Sendmail server installation
If clearing of the Sendmail mail queue is delayed, for example because mail servers have failed temporarily, it is advisable to initially leave the Sendmail installation as it is and to install a Postfix mail server in parallel.
Proceed as follows:
| Start installation of the Postfix mail server (see "Installing and uninstalling the Postfix server (SMTP server)"). If the Postfix installation routine finds an installed Sendmail, it issues a warning. |
| Press the send key. By doing so you ignore the warning and Postfix installation is continued. The Postfix installation routine saves the sendmail program of the Sendmail server under the path /usr/sbin/sendmail.renamed.by.MAIL:postfix and replaces it by the Postfix variant. If the Postfix installation routine finds an /etc/mail/aliases or /etc/aliases file (e.g. from an earlier Sendmail installation), it copies this file into the Postfix configuration directory. When installation has been completed the script call /etc/init.d/MAIL.postfix start is used to call the newaliases program automatically in order to generate the associated index file. |
| Use the following command to start a Sendmail run to empty the Sendmail mail queue: /usr/sbin/sendmail.renamed.by.MAIL:postfix -q |
Before Postfix installation the /usr/sbin/mailq and /usr/sbin/newaliases calls were links on the Sendmail server to the Sendmail program. However, after successful Postfix installation the Postfix variant of the Sendmail program is started with these calls.
If after Postfix has been installed you still wish to use the Sendmail variants of the mailq and newaliases programs which operate on Sendmail files and queues, call the Sendmail program as follows with the suitable options selected:
/usr/sbin/sendmail.renamed.by.MAIL:postfix -bi for the newaliases functionality
/usr/sbin/sendmail.renamed.by.MAIL:postfix -bp for the mailq functionality
Postfix offers compatible support for the user-specific alias mechanism which is based on the .forward file contained in the home directory of the user concerned. As a result, no modifications to these files are required when migrating from Sendmail to Postfix.