On Wed, Mar 12, 2025 at 05:17:52PM -0400, Bill Cole via Postfix-users wrote:
> > My mail server is over 13 years old. Rather than waiting for it to
> > fail, I have provisioned a replacement. It has the identical
> > configration as the production server. It has been tested on my local
> > LAN and works just the same as the production server. My plan for the
> > switch over is to shutdown postfix on the production server and wait a
> > few minutes.
>
> It would be best to disable the various SMTP services only, and let the
> queues drain normally. You can do that by commenting everything that runs
> smtpd out of master.cf and restarting Postfix.
https://www.postfix.org/postconf.5.html#master_service_disable
master_service_disable (default: empty)
Selectively disable master(8) listener ports by service type or
by service name and type. Specify a list of service types
("inet", "unix", "fifo", or "pass") or "name/type" tuples, where
"name" is the first field of a master.cf entry and "type" is a
service type. As with other Postfix matchlists, a search stops at
the first match. Specify "!pattern" to exclude a service from
the list. By default, all master(8) listener ports are enabled.
Note: this feature does not support "/file/name" or "type:table"
patterns, nor does it support wildcards such as "*" or "all".
This is intentional.
Examples:
# With Postfix 2.6..2.10 use '.' instead of '/'.
# Turn on all master(8) listener ports (the default).
master_service_disable =
# Turn off only the main SMTP listener port.
master_service_disable = smtp/inet
# Turn off all TCP/IP listener ports.
master_service_disable = inet
# Turn off all TCP/IP listener ports except "foo".
master_service_disable = !foo/inet, inet
This feature is available in Postfix 2.6 and later.
Hence:
# postconf -e 'master_service_disable = inet'
# postfix reload
> After doing that, change your
> MX to point ONLY at the new server. Then run 'sendmail -q' to make Postfix
> run through the whole queue to clear it.
The equivalent "native" interface is:
postqueue -f
> You can let Postfix sit on that state indefinitely, so if there are 'stuck'
> messages you can leave the non-accepting server up until Postfix manages to
> deliver them or bounce them.
One can expedite draining the queue, by setting the new server as a
relayhost, PROVIDED it is first configured to allow relaying by the old
server (old server's IP listed in mynetworks on new server):
# postconf -e 'relayhost = [newmx.domain.example]'
# postqueue -f
--
Viktor.
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]