Skip to content

Instantly share code, notes, and snippets.

@pida42
Created September 12, 2020 07:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pida42/b20bc089935ef06748a5ffbb7f245c24 to your computer and use it in GitHub Desktop.
Save pida42/b20bc089935ef06748a5ffbb7f245c24 to your computer and use it in GitHub Desktop.
#! /bin/sh
# imapcopy -- Sync IMAP accounts (from server account A to server account B)
# Copyright (C) 2016 Frantisek Preissler, <github@ntisek.cz>
# Released under the terms of The MIT License
#if [ $# != 4 ]
if [ $# != 1 ]
then
# echo Usage: imapcopy [SOURCE-USER] [SOURCE-PASS] [TARGET-USER] [TARGET-PASS]
echo Usage: imapcopy [USER]
exit 1
fi
HOST1='mail.neco.com'
HOST2='zimbra.blabla.cz'
USER1="$1"
#USER2="$3"
USER2="$USER1"
#PASS1="$2"
PASS1="changeme"
#PASS2="$4"
PASS2="$PASS1"
/root/bin/Tools/imapsync/imapsync \
--host1 $HOST1 \
--user1 $USER1 \
--password1 $PASS1 \
--host2 $HOST2 \
--user2 $USER2 \
--password2 $PASS2 \
--port1 993 \
--port2 993 \
--ssl1 \
--ssl2 \
--logfile /root/bin/Tools/imapsync.logs/$USER1.txt \
--errorsmax 9999
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment