Last active
August 29, 2015 14:01
-
-
Save t-vieira/3f220d7dc829092b0a89 to your computer and use it in GitHub Desktop.
Migrar E-mails de uma Conta para Outra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#################################################################### | |
# MIGRAR E-MAIL DE UMA CONTA PARA OUTRA USANDO O IMAPSYNC | |
# | |
# Dependencias--------- | |
# | |
# sudo apt-get install makepasswd rcs perl-doc libmail-imapclient-perl | |
# | |
# Clonar imapsync------ | |
# | |
# git clone git://github.com/imapsync/imapsync.git | |
# | |
# Instalar o imapsync-- | |
# | |
# sudo make install | |
#################################################################### | |
# Informando os servidores, usuários e senhas para a transferência | |
echo "Qual o servidor pop da conta de origem?" | |
read SERVER1 | |
echo "Qual o usuário da conta de origem?" | |
read UNAME1 | |
echo "Qual a senha da conta de origem?" | |
read PWORD1 | |
echo "Qual o servidor pop da conta de destino?" | |
read SERVER2 | |
echo "Qual o usuário da conta de destino?" | |
read UNAME2 | |
echo "Qual a senha da conta de destino?" | |
read PWORD2 | |
echo "-------------------- Iniciando a migração------------------------" | |
# Deixe em branco a variavel HIDE se você quiser ver os tamanhos das pastas | |
HIDE="--nofoldersizes --skipsize" | |
imapsync --syncinternaldates --useheader 'Message-Id' \ | |
--host1 ${SERVER1} --user1 ${UNAME1} \ | |
--password1 ${PWORD1} --ssl1 \ | |
--host2 ${SERVER2} \ | |
--port2 993 --user2 ${UNAME2} \ | |
--password2 ${PWORD2} --ssl2 \ | |
--authmech1 LOGIN --authmech2 LOGIN --split1 200 --split2 200 ${HIDE} \ | |
# Descomentar a opção abaixo se não quiser transferir os e-mails dessas pastas | |
#--exclude 'Drafts|Trash|Spam|Sent' | |
# Para migrar pastas especiais do Gmail | |
imapsync --syncinternaldates --useheader 'Message-Id' \ | |
--host1 ${SERVER1} --user1 ${UNAME1} \ | |
--password1 ${PWORD1} --ssl1 \ | |
--host2 imap.googlemail.com \ | |
--port2 993 --user2 ${UNAME2} \ | |
--password2 ${PWORD2} --ssl2 \ | |
--ssl2 --noauthmd5 --split1 200 --split2 200 ${HIDE} \ | |
--folder "Inbox/Sent" --prefix2 '[Gmail]/' --regextrans2 's/Inbox\/Sent/Sent Mail/' \ | |
--folder "Inbox/Spam" --prefix2 '[Gmail]/' --regextrans2 's/Inbox\/Spam/Spam/' \ | |
--folder "Inbox/Trash" --prefix2 '[Gmail]/' --regextrans2 's/Inbox\/Trash/Trash/' \ | |
--folder "Inbox/Drafts" --prefix2 '[Gmail]/' --regextrans2 's/Inbox\/Drafts/Drafts/' \ | |
echo "---------------------------Fim da Migração ------------------------------------------------------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment