📜 ⬆️ ⬇️

Transfer mail from Gmail to Google Apps

image

If you decide to use the basic Google Apps package, and before that you used Gmail, and you need old letters, you will very quickly encounter the fact that the Google Email Uploader does not work correctly with Cyrillic, and in general, it loses letters during transfer, and migration means of Google Apps in the free version is not available. Of course, you can download everything through POP, but the folder sent in the new mail will be empty. You can still probably request a premium trial package and use the migration tool (is it available in trial?), But if you have at least 10 users, you will have to block $ 500 on the card, a little money, but these are unnecessary problems.

Anyways. Migration is beautifully done using imapsync . On a poppy, it is easily installed from the ports , on other systems it is also installed somehow. After installation, read the readme and faq . There you can also find a link to a specific relocation script.
')
As usual, the script did not work right away, firstly the quotes and hyphens are not the ones, but the main thing is errors related to the unrealized hopes of the script: “expected 8033 bytes but received 8238” and connection breaks, the author then advises to connect to Amazon, but from where take it.

imapsync --host1 imap.gmail.com --port1 993 \
--user1 putin@gmail.com --reconnectretry1 5000 --passfile1 ./passfile1 --ssl1 \
--host2 imap.gmail.com --port2 993 \
--user2 medvedev@kremlin.ru --reconnectretry2 5000 --passfile2 ./passfile2 --ssl2 \
--syncinternaldates --split1 100 --split2 100 \
--authmech1 LOGIN --authmech2 LOGIN \
--allowsizemismatch \
--justfolders

imapsync --host1 imap.gmail.com --port1 993 \
--user1 putin@gmail.com --reconnectretry1 5000 --passfile1 ./passfile1 --ssl1 \
--host2 imap.gmail.com --port2 993 \
--user2 medvedev@kremlin.ru --reconnectretry2 5000 --passfile2 ./passfile2 --ssl2 \
--syncinternaldates --split1 100 --split2 100 \
--authmech1 LOGIN --authmech2 LOGIN \
--allowsizemismatch \
--regexmess 's/Delivered-To: putin\@gmail.com/Delivered-To: medvedev\@kremlin.ru/g' \
--regexmess 's/<putin\@gmail.com>/<medvedev\@kremlin.ru>/g'


I had to add two parameters: --reconnectretry * and --allowsizemismatch.

The first call will create labels, the second will flood the letters. It remains only to transfer the filters, but there you need to download and upload xml - there will be no problems.

Passwords are said to be better stored in files, otherwise you can lose them.

Even in the author's script there is a regular expression, which starts to call letters without subject as “no-subject”, but I don’t understand who needs it and why, I didn’t understand why.

If you have a large machine and all used Gmail, it is not difficult to write a script for batch transfer .

Gigabyte mail utility transferred via home computer for 5 hours.

Source: https://habr.com/ru/post/90636/


All Articles