Skip to content

Instantly share code, notes, and snippets.

@te-online
Last active February 25, 2020 19:01
Show Gist options
  • Save te-online/50adc9c86274c96efb03e441cc37c639 to your computer and use it in GitHub Desktop.
Save te-online/50adc9c86274c96efb03e441cc37c639 to your computer and use it in GitHub Desktop.
Massive Mail Move
#!/bin/bash
echo -n "Enter FROM hostname: "
read HOST1
echo -n "Enter FROM user: "
read USER1
echo -n "Enter FROM password: "
read -s PASS1
echo -n "Enter TO hostname: "
read HOST2
echo -n "Enter TO username: "
read USER2
echo -n "Enter TO password: "
read -s PASS2
imapsync --host1 ${HOST1} --user1 ${USER1} --password1 ${PASS1} --host2 ${HOST2} --user2 ${USER2} --password2 ${PASS2} --ssl1 --ssl2 --addheader
#!/bin/bash
HOST1="host1.example.org"
HOST2="host2.example.org"
declare -a users=("user1" "user2")
declare -a passw=("geheim1" "geheim2")
for i in "${!users[@]}"
do
imapsync --host1 ${HOST1} --user1 "${users[$i]}" --password1 "${passw[$i]}" --host2 ${HOST2} --user2 "${users[$i]}" --password2 "${passw[$i]}" --tls1 --tls2 --addheader
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment