Thanks to all for the replies. This is an existing somewhat elderly setup and I don't want to make major changes (file system, LMTP etc) at this stage. For postfix, Wietse's suggestion should work nicely. I guess I should build in a delay of a second or two after issuing the command to ensure that any local deliveries in progress are completed before the snapshot is taken - this is not a very big/busy server. For dovecot well I will just stop it. So something like this:
postconf defer_transports=local postfix reload sleep 2s /etc/init.d/dovecot stop # (this is on Debian 6.0, no systemd) # take lvm snapshot here, then: postconf defer_transports= postfix reload /etc/init.d/dovecot start # backup from snapshot can now proceed On 9 April 2017 at 15:29, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote: > > > On Apr 9, 2017, at 4:52 AM, Dominic Raferd <domi...@timedicer.co.uk> > wrote: > > > > Is there a best/recommended way to pause postfix local deliveries so that > > I can take an LVM snapshot of the local mails for backup purposes? > > The "best" way is to use a file system that supports snapshots, such as > "zfs". Otherwise, what Wietse said about "defer_transports". Covers > the Postfix part. > > > The pause only has to be momentary, while the snapshot is taken, but the > > files need to be in a consistent state. If anyone also knows the way to > > pause Dovecot imap/pop3 similarly (as this could also be accessing the > > same files), that would be helpful too. > > You'd have to stop Dovecot, terminating all active connections, or use > a file-system that supports snapshots. > > With maildir, you can probably not worry too much about consistency, > and just do periodic rsync without stopping Postfix or Dovecot. > > -- > Viktor. > >