- Перенос почты IMAP
- Перенос почты при смене почтового сервера
- Imapsync
- Afraid of losing all your precious emails? It’s time to copy all of them elsewhere! Safely.
- What is imapsync? (back to menu)
- Contact the author, Gilles LAMIRAL (back to menu)
- Buy imapsync and support (back to menu)
- Support (back to menu)
- Payment by bank transfer and IBAN (back to menu)
- Payment with crypto currencies, Bitcoins, Ethereum etc. (back to menu)
- Facts and figures (back to menu)
- How to transfer a single mailbox on Windows (back to menu)
- How to transfer a single mailbox on Mac (back to menu)
- How to transfer a single mailbox on Linux/Unix (back to menu)
- How to transfer many mailboxes (back to menu)
- Installation, Hardware, Operating Systems (back to menu)
- Documentation (back to menu)
Перенос почты IMAP
Перенос почты при смене почтового сервера
При решении вопроса о смене почтового сервера часто на первый план выходит вопрос: а что сделать, чтобы почта из старого почтового сервера (например, Dovecot) перекочевала в новый (например, Kerio Connect). Или использовалась почта на стороннем хостинге, и было принято решение о переносе всей почты на другой сервер (в том числе, на другую платформу, MS -> Unix, например).
Если вся почта принималась по POP3 — вопросов особенно не будет, в этом случае проблема возникнет при тотальной смене почтовых клиентов. А мы рассмотрим случай, когда не очень большая организация работает с почтой по протоколу IMAP. В таком случае вопрос будет стоять следующим образом:
- Либо находим утилиту по переконвертированию писем со старой на новую платформу.
- либо делаем архив почты, а на новом сервере почта будет «с нуля».
- либо (наш выбор) в цикле (или просто по очереди) автоматизированно копировать письма IMAP со старого почтового сервера на новый с помощью программы Imapsync.
В любом случае, вопросов будет много, и процесс смены почтового сервера — задача не из разряда легких. Это очень заранее запланированное мероприятие, с предварительными проверками и пр. Сразу становится понятным, почему в начале статьи я уточнил, что организация небольшая. В крупных компаниях, возможно, такой подготовленный штат системных администраторов, что они придумают что-то более быстродействующее. Для нас надо чтобы было попроще и без серьезных переконвертаций.
Imapsync
Imapsync поддерживает сохранение статуса «прочтено, не прочтено, удалено», вложенные почтовые папки и др. Imapsync написан на Perl и может быть запущен практически на любом компьютере, не обязательно запускать его на сервере. Т.е. вы можете произвести перенос почты удаленно по отношению и к старому, и к новому почтовым серверам. Вам не надо иметь доступ к консоли. Все, что необходимо — это протокол IMAP.
Схема действия такая:
- на новом почтовом сервере создаем учетные записи пользователей с паролями (пароли могут отличаться от паролей на старом почтовом сервере).
- запускаем imapsync.
imapsync \
—host1 —user1 —password1 \
—host2 —user2 —password2
где:
— почтовый сервер, откуда копируем почту,
— логин почтового аккаунта,
— пароль почтового аккаунта,
— почтовый сервер, куда копируем почту,
— логин почтового аккаунта,
— пароль почтового аккаунта
Опций на самом деле гораздо больше, эти — минимум. Можно указывать, использовать SSL или нет, минимальный размер писем, которые будут скопированы и много что еще. Я использовал только минимум опций — для переноса 10 почтовых ящиков этого может быть достаточно.
Если пароль содержит символ доллара ($), то выполнение из командной строки может привести к ошибке логина. В этой ситуации надо просто экранировать символ $ прямо в пароле.
—password1 Gmw$psdtRR надо писать
Скорее всего, у вас не 10, а 30 и больше почтовых ящиков. В таких случаях ручной ввод команд — муторно и неудобно. Разработчик предлагает вариант:
Создаем файл с логинами/паролями file.txt:
user001_1;password001_1;user001_2;password001_2
user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
user004_1;password004_1;user004_2;password004_2
user005_1;password005_1;user005_2;password005_2 .
В Unix скрипт может выглядеть примерно так:
Afraid of losing all your precious emails?
It’s time to copy all of them elsewhere!
Safely.
What is imapsync? (back to menu)
Imapsync presentation by Gilles
Imapsync is an IMAP transfer tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts. IMAP, IMAP4 in fact (started December 1994), is one of the three current standard protocols used to access mailboxes, the two other being POP3 (started November 1988) and HTTP (started May 1996) with webmails, webmails are often tied to an IMAP server.
The latest imapsync published release 1.977 was written on Monday, 23-Dec-2019 20:18:02 CET
Imapsync is a command-line tool that allows incremental and recursive IMAP transfers from one mailbox to another, both anywhere on the internet or in your local network. Imapsync runs on Windows, Linux, Mac OS X. «Incremental» means you can stop the transfer at any time and restart it later efficiently, without generating duplicates. «Recursive» means the complete folders hierarchy can be copied, all folders, all subfolders etc. «Command-line» means it’s not a graphical tool, on Windows you have to run imapsync from a batch file. Anyway there is a visual online service, you can try imapsync online at https://imapsync.lamiral.info/X/
Imapsync can’t migrate Contacts and Calendars. Most email systems don’t set or get Contacts or Calendars via the IMAP protocol. No way via IMAP, no way via imapsync but it can be done with other tools or via export/import of csv or ics files. Also consider using caldavsynchronizer or asking experts at Sumatra company.
Imapsync is not suitable for maintaining a synchronization between two active imap accounts while the user is working on both sides. See why in the Two Ways Sync document. Use offlineimap (written by John Goerzen) or mbsync (written by Michael R. Elkins) for bidirectional (2 ways) synchronizations.
Alternatives to imapsync are listed in the Similar softwares section.
Contact the author, Gilles LAMIRAL (back to menu)
Good feedback is always welcome!
and bad feedback is very often welcome
It may sounds crazy but I do reply personally to every single email message I receive, so don’t hesitate to spend time writing to me about your email problems, you’re sure to get my attention and my time.
Buy imapsync and support (back to menu)
Imapsync was the best investment I’ve ever done.
Read some other nice and true testimonials from users.
There is no trial version but I offer 30-day money back guarantee whatever the reason for a refund. Or drop me a gentle email and I will provide you the latest imapsync because, well, you made the effort to contact me.
After downloading imapsync, go to the installation documentation.
Special offer: it’s only €120 EUR if you buy imapsync + support at once (instead of 60 + 120 = 180 EUR).
For €120 EUR you will get:
- Imapsync full professional support (that costs also €120 EUR by itself, see why below).
- Access without any limit to the imapsync online service.
- Standalone imapsync.exe for win32, easy installation done by a zip extraction anywhere. See README_Windows.txt for details.
- Standalone imapsync_bin_Darwin for Mac OS X. (Catalina ok with a permission deed)
- Imapsync Perl source code for any operating system, Unix, Windows, OS X.
- The online visual interface, like /X, to install the service on a Linux server (not working on Windows yet).
- Lifetime of imapsync updates without extra payment.
- 30-day money back guarantee! No question nor condition to get a refund, really, just request it and you’ll sure get a refund!
- No limit to do anything with imapsync and its license.
For €60 EUR you will get all the above except imapsync full professional support (the first line).
For €120 EUR independently, you get imapsync full professional support, provided by the imapsync designer and developer, Gilles LAMIRAL, your servitor, who has been supporting imap migrations with imapsync for more than 19 years (I started in 2001). See a detailed support description below.
You may wonder why the support alone is the same price as imapsync+support? It’s because when you buy both at once, I’m not sure I will have to spend some time directly with you, it’s possible that everything goes smoothly for you, since this aim is my daily work. But when you buy the support alone, after buying the software, then I will surely spend time (any amount of hours) to help you. Does it seem fair enough?
Instantly at the end of the payment, Paypal will proposed you to go back to the site, via a link to gilles@lamiral.info (it’s my paypal account name), this link brings you to imapsync download.
You will also receive an email from gilles@lamiral.info a few minutes later (it can fall in the Spam folder sometimes).
In order to get an accurate invoice, please make sure the delivery postal address you enter in Paypal suits your accounting department, since revised editing is not easy.
Your invoice will be sent within a few days by email. My company is identified by VAT number FR74429303332 or French SIRET number 42930333200051, French APE/NAF number 6201Z («programmation informatique» in French, aka, computer programming).
Support (back to menu)
For those of you who seek support, contact me, Gilles LAMIRAL, by email or phone:
- Email address: gilles@lamiral.info.
- Desk phone number: +33 9 51 84 42 42 located in France.
- Mobile phone number: +33 6 19 22 03 54 located in France (SFR operator).
- Twitter: https://twitter.com/imapsync
The support is done in English, mostly by email or possibly phone/skype. Office hours start at 10:00, end at 16:00 UTC, extra time is possible in case of emergency. The support aims at helping you to get your imap migration job done, quickly if possible. Support includes things like no time to read the documentation, how to deal with special imap software servers (Gmail, Office365, Exchange etc.), choosing and explaining options, explaining error messages, solving authentication issues, dealing with speed, quotas, special context, running in parallel, etc., so in summary: anything!
I have been supporting imap migrations with imapsync since 2001, I still enjoy it!
Payment by bank transfer and IBAN (back to menu)
If you can’t pay with a credit card via Paypal then it is possible to pay via a bank transfer.
Refund for a bank transfer is less easier than with Paypal so drop me an email to test imapsync and to be sure it will do what you need it to do, before any payment.
The bank account references will be given upon request.
It will surely add extra work editing manually the invoice, back and forth getting good coordinates, so I will charge both software and support normal prices for a payment via bank transfer, that is 120 EUR.
Payment with crypto currencies, Bitcoins, Ethereum etc. (back to menu)
The funny thing about crypto payments is that I receive very few of them, one or two per year, and in small amount, one or two dollars equivalent. Maybe one day those little crypto coins will be like gold? (I would like that!)
Facts and figures (back to menu)
- There are 6000 to 7000 imapsync users per month (50 000 users for the year 2021). Well, if all users could be buyers!
- 9 M to 16 M mailboxes transfers per month during 2020.
- 136 M transfers for 2020, that is 4 whole mailboxes completely synced each second on average (136*10^6/365/24/3600
4), and an estimation of 60 Petabytes transferred in 2020 ( 1 PiB = 2^50 bytes = 1024^5
10^15), taking a mean of 500 Megabytes per transfer (an estimated mean given by online /X real stats). 60 Petabytes = 500*10^6*136*10^6. The 2020 global internet traffic was 2580 Exabytes (2580
(174+41) * 12 ) (1 EiB = 2^60 bytes = 1024^6
10^18) so imapsync is a very very tiny thing (23 per million, 60/2580000).
- Linux: 68%
- Win32: 18%
- Darwin: 12%
- FreeBSD: 1.43%
- Solaris: 0.02%
- OpenBSD: 0.03%
- Other: 0.01%
- Cygwin: 0%
- Unknown: 0%
- Windows 70%
- Macintosh 23%
- Linux 7%
The figures presented here do not include the GitHub imapsync release usage. It’s because —noreleasecheck is on by default since release 1.592 (2014/05/22) in the GitHub release. Looking at the numbers before and after 2014, the figures showed above could be doubled.
Where all those numbers come from? To know whether a newer imapsync exists or not, imapsync does an http GET to the file VERSION. Via the User-agent parameter it also sends:
- imapsync release
- Perl version
- Mail::IMAPClient version
- Operating System
You can remove this behavior by adding the option —noreleasecheck on the command line (or by setting $releasecheck = 0 in the source code). Check CVE-2013-4279.
How to transfer a single mailbox on Windows (back to menu)
After Imapsync installation, you have to edit a «ready to use» batch file called imapsync_example.bat and run it by a double-click. This batch file is also in the zip archive so it’s useless to download it.
I strongly advise you to read and follow the document README_Windows.txt
How to transfer a single mailbox on Mac (back to menu)
After Imapsync installation, you have to edit a «ready to use» script file called imapsync_example_darwin.bat and run it in a shell window. This script file is also in the tgz archive so it’s useless to download it.
I strongly advise you to read first and follow the document INSTALL.Darwin.txt and then the document TUTORIAL_Unix.
How to transfer a single mailbox on Linux/Unix (back to menu)
Here after is presented a Linux imapsync command line example. You can try it on a terminal, as is. Anyway, it’s easier to edit a shell script with the same exact command and run this script in a terminal or from a graphical desktop. Just take the Bourne shell script example imapsync_example.sh and adapt with your own parameters. This shell script file is also in the tgz archive so it can be useless to download it.
I strongly advise you to read and follow the document TUTORIAL_Unix.
After Imapsync installation, a basic example in a shell terminal is the following:
How to transfer many mailboxes (back to menu)
In order to migrate many mailboxes, you should use a loop over a csv file containing only the data credentials.
On Windows, see sync_loop_windows.bat batch example.
On Unix, see sync_loop_unix.sh example.
An example of this csv file is file.txt, it can be used with the two previous command scripts.
All example scripts can be found in the examples/* directory.
I strongly advise you to read also the following FAQ documents:
Installation, Hardware, Operating Systems (back to menu)
Hardware system requirements:
- 500 MB of RAM is ok. The mean value RAM used per imapsync process is 230 MB.
- Any CPU is ok.
- 100 MB of disk space is far enough.
- Any network link is ok. The average bandwidth rate is 345 KiB/s
Operating System requirements: Imapsync is avalable on Windows, Mac and Linux.
Which Operating System to chose?
Use the Operating System you are the most familiar with.
Location requirements:
Where to place imapsync?
Any host in any place is ok for imapsync as long as it has an network access to both IMAP servers, the source and the destination.
What to do next?
Depending on the system where you will run imapsync:
- Windows users, read directly README_Windows.txt.
- OS X users, read INSTALL.Darwin.txt.
- Centos users, read INSTALL.Centos.txt.
- CPanel users, read INSTALL.CPanel.txt.
- Debian users, read INSTALL.Debian.txt.
- AWS EC2 users, read INSTALL.AWS_EC2.txt.
- Ubuntu users, read INSTALL.Ubuntu.txt.
- ArchLinux users, read INSTALL.ArchLinux.txt.
- FreeBSD users, read INSTALL.FreeBSD.txt.
- Docker users, read FAQ.Docker.txt or directly the Imapsync Docker page.
- Online UI sysadmins, wanting their own /X, read INSTALL.OnlineUI.txt
- Other users,В read the second part of INSTALL.ANY.txt.
- All installation files are located in the INSTALL.d/ directory.
After the imapsync installation you should go to the documentation section just below.
Documentation (back to menu)
Windows users, the README_Windows.txt contains essential knowledge to do your first syncs.
Unix users, the TUTORIAL_Unix will teach you smoothly how to do your first syncs. Windows users can read it too.
The README file contains general and specific pieces of information to understand imapsync and succeed in your migration or backup.
The FAQ.d/* files present Frequently Asked Questions (and not so frequently asked ones) and their answers. Here is the main menu, take at least the time to read the menu, you will certainly lose some time to read it, two minutes, but reading this menu will most likely save you some struggling hours later, believe me. So read the three columns main menu:
The ChangeLog to read what changed in details since 2001.
The TODO file lists what may be coded or done in the future.
All the people I thank are in the CREDITS file.