moving only new mails from one server to another

Andrew McGlashan andrew.mcglashan at affinityvision.com.au
Mon Nov 12 16:22:14 EET 2018


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

On 12/11/18 9:29 pm, Nicolas wrote:
> Hello,
> 
> I think it is not really the right place to post about that, but
> lot of dovecot experts there ;)
> 
> Basically, I have a server with dovecot 2.2.9 that has new
> (unread) mails  (because of a bad DNS config at a migration time).
> 
> Is there an easy way to move only these unread mails to a another
> server ? (no perms trouble here : all vmail:vmail)
> 
> Though to iterate through all /var/vmail/*/*/Maildir/new and
> scp/rsync them.
> 
> Would that work ?

TMPFILE=$(mktemp)
cd /
tar cf "${TMPFILE}" \
	./var/vmail/*/Maildir/new/1* \
	./var/vmail/*/Maildir/.*/new/1*
scp -p "${TMPFILE}" remoteserver:/tmp/

Login to remote server:

cd /
tar xf /tmp/NAME_OF_TAR_FILE


Cheers
A.
-----BEGIN PGP SIGNATURE-----

iHUEAREIAB0WIQTJAoMHtC6YydLfjUOoFmvLt+/i+wUCW+mMjAAKCRCoFmvLt+/i
+7W0AP9eMmwwOihJAppUjcaf5lN8bsst2CtAmNSAtAm0dZmnDQEAznuJsw7nORui
WWYlMSiE35eHSTXZV6UvgEPxsZROhfs=
=2drw
-----END PGP SIGNATURE-----


More information about the dovecot mailing list