Created
January 25, 2019 19:08
-
-
Save thiagomgo/f046f487dc01429165d9fe1553ddcf97 to your computer and use it in GitHub Desktop.
Sync accounts using imapsync
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 | |
LISTA="/opt/sync-mail/list.txt" | |
LISTA_TMP="/tmp/list" | |
HOST_ORIGEM="xxx.xxx.xxx.xxx" | |
HOST_DESTINO="xxx.xxx.xxx.xxx" | |
cat ${LISTA}|grep -v "^#" | sed '/^ *$/d' > ${LISTA_TMP} | |
while IFS=: read usuario nome senha;do | |
echo -e "\n\nsyncing account ${usuario1}...\n\n" | |
imapsync --host1 ${HOST_ORIGEM} --user1 "${usuario}" --password1 "${senha}" --host2 ${HOST_DESTINO} --user2 "${usuario}" --password2 "${senha}" --delete2 | |
done < ${LISTA_TMP} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment