Imapsync: Porovnání verzí
založena nová stránka s textem „How to install and use imapsync (Debian/Ubuntu) When you need to transfer mailboxes from one server to another, for example during a migration, imapsync can be a great tool. It allows for incremental/recursive transfer of emails from one mailbox to another via IMAP. By default, it also transfers all the user’s folders, and you can stop the transfer at any time to resume it later. However, it’s worth noting that it’s not suitable for keeping tw…“ |
Bez shrnutí editace |
||
| Řádek 8: | Řádek 8: | ||
First, you’ll need to install some dependencies. To do so, you can run the following command: | First, you’ll need to install some dependencies. To do so, you can run the following command: | ||
<pre> | |||
# apt update && apt install -y libtest-simple-perl libtest-requires-perl libtest-mock-guard-perl libtest-fatal-perl libpar-packer-perl libnet-ssleay-perl libio-compress-perl libdigest-hmac-perl libcrypt-ssleay-perl libssl-dev libauthen-ntlm-perl libclass-load-perl libcgi-pm-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libhtml-parser-perl libjson-webtoken-perl libmail-imapclient-perl libparse-recdescent-perl libmodule-scandeps-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-mockobject-perl libtest-pod-perl libunicode-string-perl liburi-perl libwww-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus git rcs gcc apt-file; apt-file update | # apt update && apt install -y libtest-simple-perl libtest-requires-perl libtest-mock-guard-perl libtest-fatal-perl libpar-packer-perl libnet-ssleay-perl libio-compress-perl libdigest-hmac-perl libcrypt-ssleay-perl libssl-dev libauthen-ntlm-perl libclass-load-perl libcgi-pm-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libhtml-parser-perl libjson-webtoken-perl libmail-imapclient-perl libparse-recdescent-perl libmodule-scandeps-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-mockobject-perl libtest-pod-perl libunicode-string-perl liburi-perl libwww-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus git rcs gcc apt-file; apt-file update | ||
</pre> | |||
Then, configure some of the required modules for using imapsync: | Then, configure some of the required modules for using imapsync: | ||
# cpanm Crypt::OpenSSL::RSA Proc::ProcessTable Crypt::OpenSSL::Random --force | <pre># cpanm Crypt::OpenSSL::RSA Proc::ProcessTable Crypt::OpenSSL::Random --force</pre> | ||
# cpanm Mail::IMAPClient JSON::WebToken Test::MockObject Dist::CheckConflicts | <pre># cpanm Mail::IMAPClient JSON::WebToken Test::MockObject Dist::CheckConflicts</pre> | ||
# cpanm Unicode::String Data::Uniqid --force | <pre># cpanm Unicode::String Data::Uniqid --force</pre> | ||
# cpanm Mail::IMAPClient Crypt::OpenSSL::PKCS12 IO::Socket::SSL JSON::WebToken JSON Crypt::OpenSSL::RSA LWP HTML::Entities Encode::Byte | <pre># cpanm Mail::IMAPClient Crypt::OpenSSL::PKCS12 IO::Socket::SSL JSON::WebToken JSON Crypt::OpenSSL::RSA LWP HTML::Entities Encode::Byte</pre> | ||
Now you can download the application or clone it from the official imapsync repository on GitHub: | Now you can download the application or clone it from the official imapsync repository on GitHub: | ||
# cd /opt && git clone https://github.com/imapsync/imapsync.git | <pre># cd /opt && git clone https://github.com/imapsync/imapsync.git</pre> | ||
And access the imapsync directory and install it: | And access the imapsync directory and install it: | ||
# cd imapsync && make install | <pre># cd imapsync && make install</pre> | ||
Then you can copy it to the binaries directory: | Then you can copy it to the binaries directory: | ||
# cp imapsync /usr/bin/imapsync | <pre># cp imapsync /usr/bin/imapsync</pre> | ||
To verify the installation, you can run a functionality check: | To verify the installation, you can run a functionality check: | ||
# imapsync --testslive | <pre># imapsync --testslive</pre> | ||
Mailbox Synchronization | Mailbox Synchronization | ||
To perform mailbox synchronization, you can use the following sequence, modifying the hostname or IP address of the servers, as well as the users and their respective passwords (values in bold and italic). | To perform mailbox synchronization, you can use the following sequence, modifying the hostname or IP address of the servers, as well as the users and their respective passwords (values in bold and italic). | ||
| Řádek 32: | Řádek 35: | ||
But first, you can perform a synchronization test with the "--dry" option: | But first, you can perform a synchronization test with the "--dry" option: | ||
# imapsync --dry --host1 mail.domain.com --user1 user@domain.com --password1 "password" --host2 mail2.domain.com --user2 user2@domain.com --password2 "password" | <pre># imapsync --dry --host1 mail.domain.com --user1 user@domain.com --password1 "password" --host2 mail2.domain.com --user2 user2@domain.com --password2 "password"</pre> | ||
And to perform the actual synchronization, remove "--dry": | And to perform the actual synchronization, remove "--dry": | ||
# imapsync --host1 mail.domain.com --user1 user@domain.com --password1 "password" --host2 mail2.domain.com --user2 user2@domain.com --password2 "password" | <pre># imapsync --host1 mail.domain.com --user1 user@domain.com --password1 "password" --host2 mail2.domain.com --user2 user2@domain.com --password2 "password"</pre> | ||
Enjoy! | |||
Verze z 4. 2. 2026, 11:26
How to install and use imapsync (Debian/Ubuntu)
When you need to transfer mailboxes from one server to another, for example during a migration, imapsync can be a great tool. It allows for incremental/recursive transfer of emails from one mailbox to another via IMAP. By default, it also transfers all the user’s folders, and you can stop the transfer at any time to resume it later.
However, it’s worth noting that it’s not suitable for keeping two IMAP accounts actively synchronized when the user is independently using both sides. In that case, use dedicated tools for that purpose, such as offlineimap (written by John Goerzen) or mbsync (written by Michael R. Elkins) for two-way synchronizations.
Installing imapsync First, you’ll need to install some dependencies. To do so, you can run the following command:
# apt update && apt install -y libtest-simple-perl libtest-requires-perl libtest-mock-guard-perl libtest-fatal-perl libpar-packer-perl libnet-ssleay-perl libio-compress-perl libdigest-hmac-perl libcrypt-ssleay-perl libssl-dev libauthen-ntlm-perl libclass-load-perl libcgi-pm-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libhtml-parser-perl libjson-webtoken-perl libmail-imapclient-perl libparse-recdescent-perl libmodule-scandeps-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-mockobject-perl libtest-pod-perl libunicode-string-perl liburi-perl libwww-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus git rcs gcc apt-file; apt-file update
Then, configure some of the required modules for using imapsync:
# cpanm Crypt::OpenSSL::RSA Proc::ProcessTable Crypt::OpenSSL::Random --force
# cpanm Mail::IMAPClient JSON::WebToken Test::MockObject Dist::CheckConflicts
# cpanm Unicode::String Data::Uniqid --force
# cpanm Mail::IMAPClient Crypt::OpenSSL::PKCS12 IO::Socket::SSL JSON::WebToken JSON Crypt::OpenSSL::RSA LWP HTML::Entities Encode::Byte
Now you can download the application or clone it from the official imapsync repository on GitHub:
# cd /opt && git clone https://github.com/imapsync/imapsync.git
And access the imapsync directory and install it:
# cd imapsync && make install
Then you can copy it to the binaries directory:
# cp imapsync /usr/bin/imapsync
To verify the installation, you can run a functionality check:
# imapsync --testslive
Mailbox Synchronization To perform mailbox synchronization, you can use the following sequence, modifying the hostname or IP address of the servers, as well as the users and their respective passwords (values in bold and italic).
But first, you can perform a synchronization test with the "--dry" option:
# imapsync --dry --host1 mail.domain.com --user1 user@domain.com --password1 "password" --host2 mail2.domain.com --user2 user2@domain.com --password2 "password"
And to perform the actual synchronization, remove "--dry":
# imapsync --host1 mail.domain.com --user1 user@domain.com --password1 "password" --host2 mail2.domain.com --user2 user2@domain.com --password2 "password"
Enjoy!