1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/tests.sh

3556 lines
100 KiB
Bash
Raw Normal View History

2011-03-12 03:39:59 +01:00
#!/bin/sh
2013-10-18 02:11:27 +02:00
# $Id: tests.sh,v 1.227 2013/09/28 11:11:16 gilles Exp gilles $
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:01 +01:00
# Example 1:
2013-10-18 02:11:27 +02:00
# CMD_PERL='perl -I./W/Mail-IMAPClient-3.34/lib' sh -x tests.sh
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:01 +01:00
# Example 2:
# To select which Mail-IMAPClient within arguments:
# sh -x tests.sh 2 locallocal 3 locallocal
2011-03-12 03:45:02 +01:00
# This runs locallocal() with Mail-IMAPClient-2.2.9 then
2011-03-12 03:45:01 +01:00
# again with Mail-IMAPClient-3.xx
2011-03-12 03:45:02 +01:00
# 2 means "use Mail-IMAPClient-2.2.9"
# 3 means "use Mail-IMAPClient-3.xx"
2011-03-12 03:44:47 +01:00
HOST1=${HOST1:-'localhost'}
echo HOST1=$HOST1
HOST2=${HOST2:-'localhost'}
echo HOST2=$HOST2
2011-03-12 03:44:57 +01:00
# most tests use:
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:57 +01:00
# few debugging tests use:
2012-09-03 02:08:57 +02:00
CMD_PERL_2xx='perl -I./W/Mail-IMAPClient-2.2.9'
2013-10-18 02:11:27 +02:00
CMD_PERL_3xx='perl -I./W/Mail-IMAPClient-3.34/lib'
2012-04-17 00:26:18 +02:00
CMD_PERL=${CMD_PERL:-$CMD_PERL_3xx}
#echo $CMD_PERL
#exit
2011-03-12 03:44:57 +01:00
2011-03-12 03:39:59 +01:00
#### Shell pragmas
2011-03-12 03:43:43 +01:00
exec 3>&2 #
#set -x # debug mode. See what is running
set -e # exit on first failure
2011-03-12 03:39:59 +01:00
#### functions definitions
echo3() {
2011-03-12 03:44:36 +01:00
#echo '#####################################################' >&3
2011-03-12 03:44:47 +01:00
echo "$@" >&3
2011-03-12 03:39:59 +01:00
}
run_test() {
2011-03-12 03:44:36 +01:00
echo3 "#### $test_count $1"
$1
if test x"$?" = x"0"; then
echo "$1 passed"
else
2012-11-27 23:32:36 +01:00
echo "$1 failed"
2011-03-12 03:44:36 +01:00
fi
2011-03-12 03:39:59 +01:00
}
run_tests() {
2011-03-12 03:44:36 +01:00
for t in "$@"; do
2011-03-12 03:45:01 +01:00
test X"$t" = X3 && CMD_PERL=$CMD_PERL_3xx && continue
2011-03-12 03:44:36 +01:00
test_count=`expr 1 + $test_count`
run_test "$t"
2011-03-12 03:44:56 +01:00
#sleep 1
2011-03-12 03:44:36 +01:00
done
2011-03-12 03:39:59 +01:00
}
#### Variable definitions
test_count=0
##### The tests functions
perl_syntax() {
2011-03-12 03:44:47 +01:00
$CMD_PERL -c ./imapsync
2011-03-12 03:39:59 +01:00
}
no_args() {
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync
2011-03-12 03:39:59 +01:00
}
2011-03-12 03:44:29 +01:00
# list of accounts on plume :
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:47 +01:00
# mailbox toto used on first_sync()
# bad_login()
# bad_host()
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:47 +01:00
# mailbox titi used on first_sync()
# bad_host()
# locallocal()
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:47 +01:00
# mailbox tata used on locallocal()
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:47 +01:00
# mailbox tata titi on most ll_*() tests
2011-03-12 03:44:30 +01:00
2011-03-12 03:45:02 +01:00
# mailbox tete@est.belle used on big size tests:
2012-04-17 00:31:15 +02:00
# big_folder()
# big_folder_sizes_only()
2011-03-12 03:45:02 +01:00
# dprof()
# mailbox big1 big2 used on bigmail tests
# ll_bigmail()
# ll_memory_consumption
2011-03-12 03:39:59 +01:00
2011-03-12 03:43:48 +01:00
sendtestmessage() {
2011-03-12 03:44:47 +01:00
email=${1:-"tata"}
2011-03-12 03:43:48 +01:00
rand=`pwgen 16 1`
mess='test:'$rand
2011-03-12 03:44:35 +01:00
cmd="echo $mess""| mail -s ""$mess"" $email"
2011-03-12 03:43:48 +01:00
echo $cmd
2011-03-12 03:44:29 +01:00
eval "$cmd"
2011-03-12 03:43:48 +01:00
}
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:48 +01:00
can_send() {
test X`hostname` = X"plume" && return 0;
test X`hostname` = X"vadrouille" && return 0;
2011-03-12 03:45:01 +01:00
test X`hostname` = X"petite" && return 0;
2011-03-12 03:44:48 +01:00
return 1
}
2011-03-12 03:44:35 +01:00
zzzz() {
2011-03-12 03:44:36 +01:00
$CMD_PERL -V
2011-03-12 03:44:35 +01:00
}
option_version() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync --version
2011-03-12 03:44:35 +01:00
}
option_tests() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync --tests
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:45:02 +01:00
option_tests_debug() {
$CMD_PERL ./imapsync --tests_debug
}
2011-03-12 03:44:47 +01:00
option_bad_delete2() {
! $CMD_PERL ./imapsync --delete 2 --blabla
}
passwords_masked() {
$CMD_PERL ./imapsync --host1 boumboum --password1 secret --justbanner | grep MASKED
}
2011-03-12 03:44:35 +01:00
2012-11-27 23:32:36 +01:00
passwords_not_masked() {
$CMD_PERL ./imapsync --host1 boumboum --password1 secret --justbanner --showpasswords| grep secret
}
2011-03-12 03:44:35 +01:00
first_sync_dry() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-05-21 00:04:57 +02:00
--dry
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:44:29 +01:00
first_sync() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 titi \
2013-05-21 00:04:57 +02:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:39:59 +01:00
}
2011-03-12 03:44:29 +01:00
locallocal() {
2012-11-27 23:32:36 +01:00
#can_send && sendtestmessage
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
2011-03-12 03:45:02 +01:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:44:12 +01:00
}
2013-07-25 23:42:01 +02:00
ll_debug() {
#can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--debug --nofoldersizes
}
2012-04-17 00:30:19 +02:00
ll_nofoldersizes()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-09-03 02:08:57 +02:00
--nofoldersizes --folder INBOX
2012-04-17 00:30:19 +02:00
}
2013-04-22 21:50:50 +02:00
ll_nofoldersizes_foldersizesatend()
2012-12-29 01:43:39 +01:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-04-22 21:50:50 +02:00
--nofoldersizes --foldersizesatend --folder INBOX
2012-12-29 01:43:39 +01:00
}
2012-04-17 00:30:19 +02:00
2011-03-12 03:45:02 +01:00
pidfile() {
2011-03-12 03:44:54 +01:00
$CMD_PERL ./imapsync \
--justbanner \
--pidfile /var/tmp/imapsync.pid
! test -f /var/tmp/imapsync.pid
}
2012-11-27 23:32:36 +01:00
ll_pidfilelocking() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
--pidfilelocking --justconnect
echo "Exited $?"
! test -f /var/tmp/imapsync_test_pidfilelocking.pid
touch /var/tmp/imapsync_test_pidfilelocking.pid
if $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
--pidfilelocking --justconnect; then
echo "Exited $?"; ! :
else
echo "Exited $?"
fi
test -f /var/tmp/imapsync_test_pidfilelocking.pid
rm /var/tmp/imapsync_test_pidfilelocking.pid
}
2011-03-12 03:45:02 +01:00
justbanner() {
$CMD_PERL ./imapsync \
--justbanner
}
nomodules_version() {
$CMD_PERL ./imapsync \
--justbanner \
--nomodules_version
}
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:49 +01:00
ll_ask_password() {
{ sleep 2; cat ../../var/pass/secret.tata; } | \
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin
}
2011-03-12 03:44:54 +01:00
2012-07-21 04:18:22 +02:00
ll_authmech_PREAUTH() {
# No PREAUTH on my box
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata --authmech1 PREAUTH \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin
}
2012-12-29 01:43:39 +01:00
ll_unknow_option() {
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --unknow_option
}
2012-07-21 04:18:22 +02:00
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:40 +01:00
ll_timeout() {
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:54 +01:00
--folder INBOX --timeout 1
2011-03-12 03:44:40 +01:00
}
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:40 +01:00
ll_timeout_ssl() {
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--folder INBOX --timeout 5 --ssl1 --ssl2
2011-03-12 03:44:40 +01:00
}
2011-03-12 03:44:29 +01:00
ll_folder() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--folder INBOX.yop --folder INBOX.Trash
2011-03-12 03:39:59 +01:00
}
2013-02-09 03:40:54 +01:00
ll_star() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder 'INBOX.backstar\*' --dry --justfolders --debugimap1 --regextrans2 's#\\|\*#_#g'
}
2012-04-17 00:34:41 +02:00
2011-03-12 03:45:04 +01:00
ll_folder_noexist() {
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.noexist --folder INBOX.noexist2
}
# Way to check it each time:
2013-04-22 21:50:50 +02:00
# sh -x tests.sh ll_folder_create ll_delete2folders
2011-03-12 03:45:04 +01:00
ll_folder_create() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop --regextrans2 's/yop/newyop/' \
--justfolders
}
2011-06-14 12:59:46 +02:00
ll_folder_create_INBOX_Inbox() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --regextrans2 's/INBOX/Inbox/' \
2011-06-14 13:02:33 +02:00
--justfolders --nofoldersizes
2011-06-14 12:59:46 +02:00
}
2011-03-12 03:45:04 +01:00
2011-03-12 03:44:37 +01:00
ll_oneemail() {
2011-03-12 03:45:06 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.oneemail
2011-03-12 03:44:37 +01:00
}
2011-03-12 03:45:04 +01:00
ll_debugimap() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.oneemail --debugimap
}
2011-06-14 13:02:33 +02:00
2011-03-12 03:45:01 +01:00
ll_few_emails() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.few_emails
}
2011-03-12 03:44:37 +01:00
2011-06-14 13:04:24 +02:00
ll_few_emails_dev() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.few_emails --nofoldersizes
}
ll_size_null() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.size_null
}
2011-06-14 13:02:33 +02:00
ll_noheader() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-04-17 00:28:48 +02:00
--folder INBOX.few_emails --useheader '' --debug
2011-06-14 13:02:33 +02:00
}
ll_noheader_force() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.few_emails \
--useheader '' \
--skipheader 'Message-Id|Date'
}
2012-04-17 00:28:48 +02:00
ll_addheader() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.addheader --delete2 --expunge2 --addheader
}
2011-06-14 13:02:33 +02:00
ll_usecachemaxage() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--useuid --maxage 3
}
2011-03-12 03:44:37 +01:00
2011-03-12 03:44:30 +01:00
ll_folderrec() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-07-11 23:24:12 +02:00
--folderrec INBOX.yop --justfolders
2011-03-12 03:44:30 +01:00
}
2011-06-14 13:04:24 +02:00
ll_folderrec_star() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec 'INBOX.yop.*' --justfolders
}
2013-09-27 00:00:32 +02:00
ll_change_blank() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes
}
2011-06-14 13:04:24 +02:00
2011-03-12 03:45:04 +01:00
ll_folderrec_blank_bug() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec "INBOX.blanc "
}
ll_folderrec_blank_bug_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec "INBOX.blanc"
}
ll_folderrec_blank_bug_3() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec '"INBOX.blanc "'
}
2011-03-12 03:43:43 +01:00
2011-03-12 03:44:29 +01:00
ll_buffersize() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--buffersize 8
2011-03-12 03:44:15 +01:00
}
2011-03-12 03:44:29 +01:00
ll_justfolders() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justfolders --nofoldersizes
2011-03-12 03:44:43 +01:00
echo "rm -rf /home/vmail/titi/.new_folder/"
2011-03-12 03:44:08 +01:00
}
2011-03-12 03:45:02 +01:00
2011-03-12 03:45:04 +01:00
ll_delete2foldersonly() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--regextrans2 's,${h1_prefix}(.*),${h2_prefix}NEW${h2_sep}$1,' \
--regextrans2 's,^INBOX$,${h2_prefix}NEW${h2_sep}INBOX,' \
2012-04-17 00:34:41 +02:00
--delete2foldersonly '/${h2_prefix}NEW/' --dry
# --delete2foldersonly '${h2_prefix}NEW'
2011-03-12 03:45:04 +01:00
}
ll_delete2foldersonly_tmp() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--regextrans2 's,${h1_prefix}(.*),${h2_prefix}NEW_2${h2_sep}$1,' \
--regextrans2 's,^INBOX$,${h2_prefix}NEW_2${h2_sep}INBOX,' \
--delete2foldersonly '/${h2_prefix}NEW_2/'
}
ll_delete2foldersbutnot() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
2012-09-03 02:04:29 +02:00
--delete2foldersbutnot 'm{NEW_2|NEW_3|\[abc\]}' \
2011-03-12 03:45:04 +01:00
--dry
}
2013-09-26 23:59:52 +02:00
ll_delete2foldersonly_NEW_3() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--regextrans2 's,^INBOX.oneemail$,INBOX.NEW_3.oneemail,' \
--regextrans2 's,^INBOX.oneemail2$,INBOX.NEW_3.oneemail2,'
test -d /home/vmail/titi/.NEW_3.oneemail/ || return 1
test -d /home/vmail/titi/.NEW_3.oneemail2/ || return 1
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--include 'rrrrr' \
--delete2foldersonly '/^INBOX.NEW_3.oneemail$/'
! test -d /home/vmail/titi/.NEW_3.oneemail/ || return 1
test -d /home/vmail/titi/.NEW_3.oneemail2/ || return 1
}
2011-03-12 03:45:04 +01:00
2011-03-12 03:45:02 +01:00
ll_delete2folders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--delete2folders
2013-09-26 23:59:52 +02:00
! test -d /home/vmail/titi/.NEW_3/ || return 1
2011-03-12 03:45:02 +01:00
}
2011-03-12 03:44:49 +01:00
ll_bug_folder_name_with_blank() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-09-25 22:31:48 +02:00
--justfolders --fast
2011-03-12 03:44:49 +01:00
echo "rm -rf /home/vmail/titi/.bugs/"
}
2011-03-12 03:43:48 +01:00
2011-09-25 22:31:48 +02:00
ll_bug_folder_name_with_backslash() {
# Bug with Mail-IMAPClient-2.2.9
# Fixed using Mail-IMAPClient-3.28
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--fast
# --folder "INBOX.yop.jj\\kk"
# --folder '"INBOX.yop.jj\kk"' --debug --debugimap --regextrans2 's,\\,_,g'
# --folder "INBOX.yop.jj\\kk" --debug --debugimap1
echo "sudo rm -rf '/home/vmail/titi/.yop.jj\\kk'"
}
2011-03-12 03:44:29 +01:00
ll_prefix12() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.qqq \
--prefix1 INBOX.\
2011-03-12 03:45:02 +01:00
--prefix2 INBOX.
2011-03-12 03:44:19 +01:00
}
2011-03-12 03:44:57 +01:00
ll_nosyncinternaldates() {
can_send && sendtestmessage toto
$CMD_PERL_3xx ./imapsync \
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-05-21 00:04:57 +02:00
--folder INBOX \
2011-03-12 03:44:57 +01:00
--nosyncinternaldates --delete2 --expunge2
}
# bug:
# $d=""; # no bug with $d=undef
# $imap2->append_string($h2_fold,$string, $h1_flags, $d);
# 3.25 idate : Sending: 16 APPEND INBOX () "16-Jul-2010 22:09:42 +0200" {428}
# 2.xx idate : Sending: 62 APPEND INBOX "16-Jul-2010 22:14:00 +0200" {428}
# 3.25 noidate: Sending: 16 APPEND INBOX () "" {428} # Fails: NO IMAP!
# 2.xx noidate: Sending: 62 APPEND INBOX {428}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:39 +01:00
ll_idatefromheader() {
2011-06-14 12:59:46 +02:00
2012-04-17 00:26:18 +02:00
# can_send && sendtestmessage
2011-06-14 12:59:46 +02:00
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-04-17 00:26:18 +02:00
--folder INBOX.oneemail2 \
2011-03-12 03:45:02 +01:00
--idatefromheader --debug --dry
2011-03-12 03:44:39 +01:00
}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:29 +01:00
ll_folder_rev() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
2011-03-12 03:45:02 +01:00
--folder INBOX.yop
2011-03-12 03:43:43 +01:00
}
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:29 +01:00
ll_subscribed()
2011-03-12 03:43:48 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--subscribed
2011-03-12 03:43:49 +01:00
}
2011-03-12 03:43:48 +01:00
2011-03-12 03:39:59 +01:00
2012-04-17 00:26:18 +02:00
ll_nosubscribe()
2011-03-12 03:43:49 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-04-17 00:26:18 +02:00
--subscribed --nosubscribe
2011-03-12 03:43:48 +01:00
}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:29 +01:00
ll_justconnect()
2011-03-12 03:44:20 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host2 $HOST2 \
--host1 $HOST1 \
2011-03-12 03:45:02 +01:00
--justconnect
2011-03-12 03:44:20 +01:00
}
2011-03-12 03:44:29 +01:00
ll_justfoldersizes()
2011-03-12 03:43:50 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:54 +01:00
--justfoldersizes
}
2011-06-14 13:02:33 +02:00
ll_justfoldersizes_noexist()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes --folder NoExist --folder INBOX
}
2011-03-12 03:44:54 +01:00
ll_dev_reconnect()
{
# in another terminal:
#
2011-03-12 03:44:54 +01:00
: <<'EOF'
while :; do
2011-06-14 12:59:46 +02:00
killall -v -u vmail imapd;
2011-03-12 03:44:54 +01:00
RAND_WAIT=`numrandom .1..5i.1`
echo sleeping $RAND_WAIT
sleepenh $RAND_WAIT
done
2011-06-14 12:59:46 +02:00
# or
while read y; do
killall -u vmail imapd;
done
2011-03-12 03:44:54 +01:00
2011-06-14 12:59:46 +02:00
EOF
can_send && sendtestmessage
# can_send && sendtestmessage
$CMD_PERL ./imapsync \
2011-03-12 03:44:54 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
2011-06-14 12:59:46 +02:00
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --useuid \
--delete2 --expunge2
}
ll_dev_reconnect_ssl_tls()
{
# in another terminal:
#
: <<'EOF'
while :; do
killall -v -u vmail imapd;
RAND_WAIT=`numrandom .1..5i.1`
echo sleeping $RAND_WAIT
sleepenh $RAND_WAIT
done
# or
while read y; do
echo ENTER to kill all imapd
killall -v -u vmail imapd;
done
2011-03-12 03:44:54 +01:00
2011-06-14 12:59:46 +02:00
EOF
can_send && sendtestmessage
# can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --ssl1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --tls2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --useuid \
--delete2
2011-03-12 03:43:50 +01:00
}
2011-06-14 13:02:33 +02:00
ll_dev_reconnect_tls()
{
# in another terminal:
#
: <<'EOF'
while :; do
killall -v -u vmail imapd;
RAND_WAIT=`numrandom .1..5i.1`
echo sleeping $RAND_WAIT
sleepenh $RAND_WAIT
done
# or
while read y; do
echo ENTER to kill all imapd
killall -v -u vmail imapd;
done
EOF
can_send && sendtestmessage
# can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --tls1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --tls2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --useuid \
--delete2 --debugsleep --debugimap
}
2011-03-12 03:44:20 +01:00
2011-06-14 12:59:46 +02:00
2011-03-12 03:44:29 +01:00
ll_authmd5()
2011-03-12 03:43:50 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justlogin --authmd5
2011-03-12 03:43:50 +01:00
}
2011-03-12 03:45:04 +01:00
ll_authmd51()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin --authmd51
}
ll_authmd52()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin --authmd52
}
2011-03-12 03:44:29 +01:00
ll_noauthmd5()
2011-03-12 03:43:53 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justlogin --noauthmd5
2011-03-12 03:43:53 +01:00
}
2011-03-12 03:43:50 +01:00
2011-03-12 03:44:29 +01:00
ll_maxage()
2011-03-12 03:43:50 +01:00
{
2011-03-12 03:45:01 +01:00
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-09-03 02:08:57 +02:00
--maxage 1 --folder INBOX
2011-03-12 03:45:01 +01:00
}
2011-07-11 23:24:12 +02:00
ll_maxage_0()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 0 --folder INBOX
}
2013-07-25 23:42:01 +02:00
ll_maxage_10000_minage_9999()
{
# INTERSECTION: 0 messages
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 10000 --minage 9999 \
--folder INBOX --justfoldersizes
}
ll_maxage_9999_minage_10000()
{
# UNION: all messages
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 9999 --minage 10000 \
--folder INBOX --justfoldersizes
}
2013-09-26 23:59:52 +02:00
ll_maxage_10000_minage_9999_noabletosearch()
{
# INTERSECTION: 0 messages
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 10000 --minage 9999 \
--folder INBOX --justfoldersizes --noabletosearch
}
ll_maxage_9999_minage_10000_noabletosearch()
{
# UNION: all messages
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 9999 --minage 10000 \
--folder INBOX --justfoldersizes --noabletosearch
}
2013-07-25 23:42:01 +02:00
2013-04-22 21:50:50 +02:00
ll_maxage_10000()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 10000 --folder INBOX
}
ll_maxage_0_debugimap2()
{
#can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 0 --folder INBOX --debugimap2 --nofoldersizes
}
2011-07-11 23:24:12 +02:00
ll_search_ALL()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'ALL' --folder INBOX
}
ll_search_FLAGGED()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'FLAGGED' --folder INBOX
}
2012-12-29 01:43:39 +01:00
ll_search_NOT_DELETED()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'NOT DELETED' --folder INBOX
}
2011-07-11 23:24:12 +02:00
ll_search_SENTSINCE()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'SENTSINCE 11-Jul-2011' --folder INBOX
}
2012-04-17 00:26:18 +02:00
ll_search_BEFORE_delete2_useuid()
{
can_send && sendtestmessage titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'BEFORE 29-Sep-2011' --folder INBOX --delete2 --useuid
}
ll_search_SENTBEFORE()
{
can_send && sendtestmessage titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-04-22 21:50:50 +02:00
--search 'SENTBEFORE 31-Dec-2013' --folder INBOX --delete2
2012-04-17 00:26:18 +02:00
}
2012-04-17 00:27:13 +02:00
ll_search_SENTSINCE_and_BEFORE()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-04-22 21:50:50 +02:00
--search 'SENTSINCE 1-Jan-2010 SENTBEFORE 31-Dec-2013' --folder INBOX --delete2 --dry
}
ll_search_SENTSINCE_and_BEFORE_search2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'SENTSINCE 1-Jan-2010 SENTBEFORE 31-Dec-2013' \
--search2 'ALL' --folder INBOX --delete2
2012-04-17 00:27:13 +02:00
}
2011-07-11 23:24:12 +02:00
2011-06-14 13:04:24 +02:00
ll_maxage_nonew()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 1 --nofoldersizes \
--folder INBOX.few_emails
}
2012-11-27 23:32:36 +01:00
ll_nosearch_hack()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.few_emails --debugdev --debugimap1 --noabletosearch
}
2011-03-12 03:45:02 +01:00
ll_newmessage()
{
can_send && sendtestmessage
2011-03-12 03:45:06 +01:00
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-04-17 00:31:15 +02:00
--maxage 1 --folder INBOX --nofoldersizes \
2011-06-14 13:02:33 +02:00
--debugLIST
2011-03-12 03:45:06 +01:00
}
2012-04-17 00:31:15 +02:00
ll_exitwhenover()
{
can_send && sendtestmessage
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 1 --folder INBOX --nofoldersizes \
--exitwhenover 300
}
2011-03-12 03:45:06 +01:00
ll_folder_INBOX()
{
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:06 +01:00
--folder INBOX --noreleasecheck --usecache --delete2 --expunge2
2011-03-12 03:45:02 +01:00
}
2011-03-12 03:45:01 +01:00
ll_maxage_9999()
{
# can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes --folder INBOX \
--maxage 9999
2011-03-12 03:43:50 +01:00
}
2013-07-25 23:42:01 +02:00
ll_maxlinelength()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxlinelength 8 --nofoldersizes --folder INBOX
}
2011-03-12 03:43:54 +01:00
2011-03-12 03:44:29 +01:00
ll_maxsize()
2011-06-14 12:59:46 +02:00
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-06-14 12:59:46 +02:00
--maxsize 10 --nofoldersizes --folder INBOX
2011-03-12 03:43:50 +01:00
}
2011-03-12 03:43:47 +01:00
2011-06-14 12:59:46 +02:00
ll_maxsize_useuid()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxsize 10 --nofoldersizes --folder INBOX \
2011-06-14 13:02:33 +02:00
--useuid --debugcache
}
ll_minsize_useuid()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes --folder INBOX \
--useuid --debugLIST --minsize 500 --maxage 1
2011-06-14 12:59:46 +02:00
}
2011-06-14 13:02:33 +02:00
2011-03-12 03:44:29 +01:00
ll_skipsize()
2011-03-12 03:43:54 +01:00
{
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--skipsize --folder INBOX.yop.yap
2011-03-12 03:43:54 +01:00
}
2011-03-12 03:44:29 +01:00
ll_skipheader()
2011-03-12 03:43:54 +01:00
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:50 +01:00
--skipheader '^X-.*|^Date' --folder INBOX.yop.yap \
2011-03-12 03:45:02 +01:00
--debug
2011-03-12 03:43:54 +01:00
}
2011-03-12 03:44:29 +01:00
ll_include()
2011-03-12 03:43:51 +01:00
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--include '^INBOX.yop'
2011-03-12 03:43:51 +01:00
}
2013-02-09 03:40:54 +01:00
ll_exclude()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--exclude '^(?i)INBOX.YOP' --justfolders --nofoldersizes
}
2011-03-12 03:44:36 +01:00
2012-07-21 04:18:22 +02:00
ll_exclude_2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--exclude '^INBOX.yop$' --justfolders --nofoldersizes
}
2011-03-12 03:45:04 +01:00
ll_exclude_INBOX()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-09-26 23:59:52 +02:00
--exclude '^INBOX' --justfolders --nofoldersizes --dry
}
ll_exclude_blanc_middle()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--exclude '^INBOX.blanc\smiddle' --justfolders --nofoldersizes --dry
2011-03-12 03:45:04 +01:00
}
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:29 +01:00
ll_regextrans2()
2011-03-12 03:43:55 +01:00
{
2011-07-11 23:24:12 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2011-07-11 23:24:12 +02:00
--regextrans2 's/yop/yoX/' \
2013-05-21 00:04:57 +02:00
--folder 'INBOX.yop.yap' --debug
2011-07-11 23:24:12 +02:00
}
ll_regextrans2_downcase()
{
# lowercase the last basename part
# [INBOX.yop.YAP] -> [INBOX.yop.yap] using re [s/(.*)\Q${h1_sep}\E(.+)$/$1${h2_sep}\L$2\E/]
# [INBOX.yop.YAP] -> [INBOX.yop.yap]
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2011-07-11 23:24:12 +02:00
--regextrans2 's/(.*)\Q${h1_sep}\E(.+)$/$1${h2_sep}\L$2\E/' \
--folder 'INBOX.yop.YAP' --justfolders --debug --dry
}
ll_regextrans2_ucfirst()
{
# lowercase the last basename part
# [INBOX.yop.YAP] -> [INBOX.yop.yap] using re [s/(.*)\Q${h1_sep}\E(.+)$/$1${h2_sep}\L$2\E/]
# [INBOX.yop.YAP] -> [INBOX.yop.yap]
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2011-07-11 23:24:12 +02:00
--regextrans2 's/(.*)\Q${h1_sep}\E(.)(.+)$/$1${h2_sep}\u$2\L$3\E/' \
--folder 'INBOX.yop.YAP' --justfolders --debug --dry
2011-03-12 03:44:51 +01:00
}
2011-07-11 23:24:12 +02:00
2011-03-12 03:44:51 +01:00
ll_regextrans2_slash()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2011-03-12 03:44:51 +01:00
--folder 'INBOX.yop.yap' \
--sep1 '/' \
--regextrans2 's,/,_,'
}
2011-03-12 03:45:04 +01:00
ll_regextrans2_subfolder()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2011-03-12 03:45:04 +01:00
--folder 'INBOX.yop.yap' \
2012-04-17 00:28:48 +02:00
--prefix1 'INBOX.yop.' \
--regextrans2 's,^${h2_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,' --dry
2011-03-12 03:45:04 +01:00
}
2011-03-12 03:44:51 +01:00
ll_regextrans2_remove_space()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2011-03-12 03:44:51 +01:00
--folder 'INBOX.yop.y p' \
--regextrans2 's, ,,' \
--dry
2011-03-12 03:43:55 +01:00
}
2011-03-12 03:44:51 +01:00
2012-09-03 02:08:57 +02:00
ll_regextrans2_archive_per_month()
{
# Bad behavior on Courier
# SENTBEFORE 31-Apr returns nothing
# SENTBEFORE 30 Apr returns messages
year=2012
month=Apr
month_n=04
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2012-11-27 23:32:36 +01:00
--nofoldersizes \
2012-09-03 02:08:57 +02:00
--search "SENTSINCE 1-$month-$year SENTBEFORE 30-$month-$year" \
--regextrans2 "s{.*}{INBOX.Archive.$year.$month_n}"
}
2011-03-12 03:44:51 +01:00
2013-02-09 03:40:54 +01:00
ll_regextrans2_ALLIN()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes \
--regextrans2 's/.*/INBOX.ALLIN/' \
--folderrec 'INBOX.yop' --delete2
}
ll_regextrans2_ALLIN_usecache()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--regextrans2 's/.*/INBOX.ALLIN/' \
--folderrec 'INBOX.yop' --delete2 --usecache --nodelete2duplicates
}
ll_regextrans2_ALLIN_fake()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--regextrans2 's/.*/INBOX.ALLIN/' \
--foldersizes \
--folderrec 'INBOX.yop' --delete2
}
ll_regextrans2_ALLIN_useuid()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--foldersizes \
--regextrans2 's/.*/INBOX.ALLIN/' \
--folderrec 'INBOX.yop' --delete2 --useuid
}
2011-03-12 03:44:29 +01:00
ll_sep2()
2011-03-12 03:44:06 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
2011-03-12 03:45:02 +01:00
--sep2 '\\' --dry
2011-03-12 03:44:06 +01:00
}
2011-03-12 03:44:29 +01:00
ll_bad_login()
2011-03-12 03:43:53 +01:00
{
2011-03-12 03:44:36 +01:00
! $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 notiti \
2011-03-12 03:45:02 +01:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:43:53 +01:00
}
2011-03-12 03:44:29 +01:00
ll_bad_host()
2011-03-12 03:43:53 +01:00
{
2011-03-12 03:44:36 +01:00
! $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 badhost --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 badhost --user2 titi \
2011-03-12 03:45:02 +01:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:43:53 +01:00
}
2011-03-12 03:44:35 +01:00
ll_bad_host_ssl()
{
2011-03-12 03:44:36 +01:00
! $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 badhost --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 badhost --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--ssl1 --ssl2
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:43:56 +01:00
2011-03-12 03:44:29 +01:00
ll_useheader()
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
--useheader 'Message-ID' \
2011-03-12 03:45:02 +01:00
--dry --debug
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:43:56 +01:00
}
2012-04-17 00:28:48 +02:00
ll_useheader_Received()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--useheader 'Received' \
--dry --debug --fast
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:45:04 +01:00
ll_useheader_noheader()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--useheader 'NoExist' \
--debug --delete2 --expunge2
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:43:56 +01:00
2011-03-12 03:45:06 +01:00
2011-03-12 03:44:29 +01:00
ll_regexmess()
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:39 +01:00
rm -f /home/vmail/titi/.yop.yap/cur/*
2011-03-12 03:44:47 +01:00
fi
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
--regexmess 's/\157/O/g' \
--regexmess 's/p/Z/g' \
2011-03-12 03:45:02 +01:00
--debug
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
file=`ls -t /home/vmail/titi/.yop.yap/cur/* | tail -1`
diff ../../var/imapsync/tests/ll_regexmess/dest_01 $file
2013-07-25 23:42:01 +02:00
echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:47 +01:00
fi
2011-03-12 03:44:36 +01:00
}
2013-07-25 23:42:01 +02:00
ll_regexmess_bad_regex()
{
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--regexmess 'I am BAD'
}
ll_regexmess_remove_header_Disposition()
{
#Disposition-Notification-To: Gilles LAMIRAL <gilles.lamiral@laposte.net>
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.regexmess \
--nofoldersizes \
--regexmess 's{\A(.*?(?! ^$))(^Disposition-Notification-To:.*?\n)}{$1}gxms' \
--debugcontent --debug
echo "sudo sh -c 'rm /home/vmail/titi/.regexmess/cur/*'"
}
2011-03-12 03:44:36 +01:00
ll_regexmess_scwchu()
{
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.scwchu \
--regexmess 's{\A(.*?(?! ^$))^Date:(.*?)$}{$1Date:$2\nReceived: From; $2}gxms' \
--skipsize --skipheader 'Received: From;' \
2011-03-12 03:45:02 +01:00
--debug
2011-03-12 03:44:36 +01:00
echo 'rm /home/vmail/titi/.scwchu/cur/*'
2011-03-12 03:44:29 +01:00
}
2012-04-17 00:34:41 +02:00
ll_regexmess_wong()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.scwchu \
--regexmess 's{\A}{Content-Type: text/plain; charset="big5"\n}gxms' \
--debugcontent --debug
echo "sudo sh -c 'rm /home/vmail/titi/.scwchu/cur/*'"
}
ll_regexmess_wong_2()
{
#Received: from hkuhp22.hku.hk
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.scwchu \
--regexmess 's{\A(.*?(?!^$))^(Received: from hkuhp22.hku.hk.*?)$}{$1Content-Type: text/plain; charset="big5"\n$2}gms' \
--debugcontent --debug --dry
echo "sudo sh -c 'rm /home/vmail/titi/.scwchu/cur/*'"
}
2011-03-12 03:44:29 +01:00
ll_flags()
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
2011-03-12 03:44:51 +01:00
--debug
2011-03-12 03:44:36 +01:00
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:29 +01:00
}
ll_regex_flag()
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
2013-07-25 23:42:01 +02:00
--regexflag 's/\\Answered/\$Forwarded/g' --debugflags
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:49 +01:00
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2013-07-25 23:42:01 +02:00
ll_regex_flag_bad()
{
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--regexflag 'I am bad' --debugflags
echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:44:49 +01:00
ll_regex_flag2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug --regexflag s/\\\\Answered/\\\\Flagged/g
2013-07-25 23:42:01 +02:00
echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:29 +01:00
}
2011-03-12 03:44:49 +01:00
ll_regex_flag3()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug --regexflag s/\\\\Answered//g
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2011-07-11 23:24:12 +02:00
ll_regex_flag4()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap --nofoldersizes \
2012-04-17 00:26:18 +02:00
--regexflag 's/\$label1/\\label1/g' \
--regexflag "s/\\\$Forwarded//g" --debugflags
2011-07-11 23:24:12 +02:00
echo 'sudo rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2012-12-29 01:43:39 +01:00
ll_regex_flag5()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debugflags --regexflag "s/Answered/Flagged/g"
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
ll_regex_flag6_add_SEEN()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debugflags --regexflag "s/(.*)/\$1 \\\\Seen/"
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
ll_regex_flag7_add_SEEN()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debugflags --regexflag 's/(.*)/$1 \\Seen/'
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2011-07-11 23:24:12 +02:00
2011-03-12 03:44:51 +01:00
ll_regex_flag_keep_only()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug \
--regexflag 's/(.*)/$1 jrdH8u/' \
--regexflag 's/.*?(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)/$1 /g' \
--regexflag 's/(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u) (?!(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)).*/$1 /g' \
--regexflag 's/jrdH8u *//'
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:44:49 +01:00
2011-03-12 03:44:51 +01:00
ll_tls_justconnect() {
$CMD_PERL ./imapsync \
2011-03-12 03:45:02 +01:00
--host1 $HOST1 \
--host2 $HOST2 \
2011-03-12 03:44:51 +01:00
--tls1 --tls2 \
2013-07-06 00:26:28 +02:00
--justconnect --debugimap
2011-03-12 03:44:51 +01:00
}
ll_tls_justlogin() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--tls1 --tls2 \
2013-07-06 00:26:28 +02:00
--justlogin --debugimap
2011-03-12 03:44:51 +01:00
}
ll_tls_devel() {
2013-07-06 00:26:28 +02:00
ll_justlogin ll_ssl_justlogin \
&& ll_tls_justconnect ll_tls_justlogin
2011-03-12 03:44:51 +01:00
}
ll_tls() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-07-06 00:26:28 +02:00
--tls1 --tls2
2011-03-12 03:44:51 +01:00
}
2011-03-12 03:44:49 +01:00
2011-03-12 03:44:51 +01:00
ll_ssl_justconnect() {
2011-03-12 03:44:40 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 \
--host2 $HOST2 \
2011-03-12 03:44:40 +01:00
--ssl1 --ssl2 \
2011-03-12 03:44:51 +01:00
--justconnect
}
2013-07-06 00:26:28 +02:00
ll_ssl_tls_justconnect() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--ssl1 --tls1 --ssl2 --tls2 \
--justconnect --debugimap
}
ll_justconnect_devel() {
ll_justconnect && ll_tls_justconnect && ll_ssl_justconnect && ll_ssl_tls_justconnect
}
2011-03-12 03:44:51 +01:00
ll_ssl_justlogin() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--ssl1 --ssl2 \
--justlogin
2011-03-12 03:44:40 +01:00
}
2012-07-21 04:18:22 +02:00
ll_ssl_tls_justlogin() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-07-06 00:26:28 +02:00
--ssl1 --tls1 --ssl2 --tls2 \
2012-07-21 04:18:22 +02:00
--justlogin --debug
}
2011-03-12 03:44:51 +01:00
2013-07-06 00:26:28 +02:00
ll_justlogin_devel() {
ll_justlogin && ll_ssl_justlogin && ll_tls_justlogin && ll_ssl_tls_justlogin
}
2011-03-12 03:44:29 +01:00
ll_ssl() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--ssl1 --ssl2
2011-03-12 03:44:29 +01:00
}
ll_authmech_PLAIN() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authmech1 PLAIN --authmech2 PLAIN
2013-05-21 00:04:57 +02:00
}
2013-08-04 03:27:37 +02:00
ll_authmech_PLAIN_ssl() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --ssl1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --ssl2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes --nofoldersizes \
--authmech1 PLAIN --authmech2 PLAIN
}
ll_authmech_ssl_cmich() {
$CMD_PERL ./imapsync \
--host1 cmail.cmich.edu --ssl1 --ssl1_SSL_version SSLv3 \
--host2 imap.gmail.com --ssl2 \
--justconnect
}
2011-03-12 03:44:47 +01:00
2013-05-21 00:04:57 +02:00
ll_authmech_XOAUTH_gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 imapsync@lab3.dedalusprime.com.br \
--passfile1 ../../var/pass/secret.xoauth \
--host2 imap.gmail.com --ssl2 --user2 imapsync@lab3.dedalusprime.com.br \
--passfile2 ../../var/pass/secret.xoauth \
--justfoldersizes --nofoldersizes \
--authmech1 XOAUTH --authmech2 XOAUTH
2011-03-12 03:44:29 +01:00
}
2013-05-21 00:04:57 +02:00
2011-03-12 03:45:04 +01:00
ll_authmech_NTLM() {
2012-09-03 02:08:57 +02:00
$CMD_PERL -I./W/NTLM-1.09/blib/lib ./imapsync \
2011-03-12 03:45:04 +01:00
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin \
--debug --authmech1 NTLM
}
ll_authmech_NTLM_domain() {
2012-09-03 02:08:57 +02:00
$CMD_PERL -I./W/NTLM-1.09/blib/lib ./imapsync \
2011-03-12 03:45:04 +01:00
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin \
--authmech1 NTLM --domain1 freshgrillfoods.com --debugimap1
}
ll_authmech_NTLM_2() {
2012-09-03 02:08:57 +02:00
$CMD_PERL -I./W/NTLM-1.09/blib/lib ./imapsync \
2011-03-12 03:45:04 +01:00
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--authmech1 NTLM --dry
2012-04-17 00:26:18 +02:00
2011-03-12 03:45:04 +01:00
}
2011-03-12 03:44:29 +01:00
ll_authuser() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authuser2 titi
2011-03-12 03:44:29 +01:00
}
2011-04-24 23:19:36 +02:00
ll_authuser_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 anything \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes \
--authuser2 titi --folder INBOX.lalala
}
2011-03-12 03:44:29 +01:00
ll_authmech_LOGIN() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authmech1 LOGIN --authmech2 LOGIN
2011-03-12 03:44:29 +01:00
}
ll_authmech_CRAMMD5() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authmech1 CRAM-MD5 --authmech2 CRAM-MD5
2011-03-12 03:44:29 +01:00
}
ll_delete2() {
2011-06-14 13:04:24 +02:00
can_send && sendtestmessage titi
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
2012-09-12 03:50:53 +02:00
--delete2 --expunge2
}
ll_delete2_reverse() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX \
2011-03-12 03:45:02 +01:00
--delete2 --expunge2
2011-03-12 03:44:29 +01:00
}
2012-09-12 03:50:53 +02:00
ll_delete_reverse() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX \
--delete --minage 100 --maxage 300 --noexpungeaftereach
}
2011-06-14 13:04:24 +02:00
ll_delete2_minage() {
can_send && sendtestmessage titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
--delete2 --expunge2 --minage 1
}
ll_delete2_minage_useuid() {
can_send && sendtestmessage titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
--delete2 --uidexpunge2 --minage 1 --useuid
}
ll_delete2_uidexpunge2_implicit() {
can_send && sendtestmessage titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
--delete2 --useuid
}
2012-11-27 23:32:36 +01:00
ll_delete2duplicates() {
can_send && sendtestmessage titi
can_send && sendtestmessage tata
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
--delete2duplicates --uidexpunge2
}
2011-06-14 13:04:24 +02:00
ll_delete2_dev() {
can_send && sendtestmessage titi
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --nofoldersizes \
--delete2
}
2012-04-17 00:31:15 +02:00
ll_delete() {
2013-07-25 23:42:01 +02:00
echo 11111111111111111111111
2012-04-17 00:31:15 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-07-25 23:42:01 +02:00
--folder INBOX.oneemail3 --delete
2012-04-17 00:31:15 +02:00
#find /home/vmail/titi/.oneemail3/ || :
echo After first sync
test -f /home/vmail/titi/.oneemail3/cur/* || return 1
2013-07-25 23:42:01 +02:00
echo 222222222222222222222222
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
2012-04-17 00:31:15 +02:00
--folder INBOX.oneemail3 \
2011-03-12 03:45:04 +01:00
--delete
2012-04-17 00:31:15 +02:00
2013-07-25 23:42:01 +02:00
echo 3333333333333333333333333
2012-04-17 00:31:15 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX.oneemail3 \
--justfoldersizes
#find /home/vmail/titi/.oneemail3/ || :
echo After delete
! test -f /home/vmail/titi/.oneemail3/cur/* || return 1
2011-03-12 03:44:51 +01:00
}
2012-04-17 00:31:15 +02:00
2011-06-14 12:59:46 +02:00
ll_delete_delete2() {
2011-06-14 13:04:24 +02:00
! $CMD_PERL ./imapsync \
2011-06-14 12:59:46 +02:00
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--delete --delete2
}
2011-03-12 03:44:30 +01:00
ll_bigmail() {
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:45:02 +01:00
--host1 $HOST1 --user1 big1 \
--passfile1 ../../var/pass/secret.big1 \
--host2 $HOST2 --user2 big2 \
--passfile2 ../../var/pass/secret.big2 \
2011-03-12 03:45:02 +01:00
--folder INBOX.bigmail
2011-03-12 03:45:04 +01:00
echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"'
2011-03-12 03:45:02 +01:00
}
2012-04-17 00:27:13 +02:00
ll_bigmail_fastio() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 big1 \
--passfile1 ../../var/pass/secret.big1 \
--host2 $HOST2 --user2 big2 \
--passfile2 ../../var/pass/secret.big2 \
--folder INBOX.bigmail --fastio1 --fastio2
echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"'
}
2011-03-12 03:45:02 +01:00
ll_memory_consumption() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 big1 \
--passfile1 ../../var/pass/secret.big1 \
--host2 $HOST2 --user2 big2 \
--passfile2 ../../var/pass/secret.big2 \
--folder INBOX.bigmail2 \
--nofoldersizes
2011-03-12 03:45:04 +01:00
echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail2/cur/*"'
2011-03-12 03:44:30 +01:00
}
2012-04-17 00:34:41 +02:00
ll_remove_duplicates() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX.duplicates --delete2
}
2011-03-12 03:44:35 +01:00
msw() {
2011-03-12 03:44:57 +01:00
if can_send; then
sendtestmessage toto
fi
2011-03-12 03:45:00 +01:00
scp imapsync test.bat test_exe.bat\
2011-03-12 03:44:57 +01:00
../../var/pass/secret.toto \
../../var/pass/secret.titi \
../../var/pass/secret.tata \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat'
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:44:59 +01:00
msw2() {
if can_send; then
sendtestmessage toto
fi
2011-03-12 03:45:00 +01:00
scp imapsync test_exe.bat\
2011-03-12 03:44:59 +01:00
../../var/pass/secret.toto \
../../var/pass/secret.titi \
../../var/pass/secret.tata \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
2011-03-12 03:45:00 +01:00
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
2011-03-12 03:44:59 +01:00
}
2013-09-27 00:00:32 +02:00
ll_change_characters_gmail() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder "INBOX. f g\h\"i'j " --justfolders \
--regextrans2 "s/['\"\\\\]/_/g" --regextrans2 's,(/|^) +,$1,g' --regextrans2 's, +(/|$),$1,g'
}
2011-03-12 03:45:06 +01:00
xxxxx_gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
2012-04-17 00:34:41 +02:00
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
2011-03-12 03:45:06 +01:00
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
2013-09-27 00:00:32 +02:00
--regextrans2 's,(/|^) +,$1,g' --regextrans2 's, +(/|$),$1,g' \
2012-12-29 01:43:39 +01:00
--exclude 'INBOX.yop.YAP' \
--regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
--folder 'INBOX.Messages envoy&AOk-s' \
--folder 'INBOX.Sent'
2011-03-12 03:45:06 +01:00
}
2013-07-25 23:42:01 +02:00
xxxxx_gmail_useuid() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
--folder 'INBOX.Sent' --useuid --dry
}
2012-04-17 00:31:15 +02:00
2011-04-24 23:19:36 +02:00
xxxxx_gmail_2() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--regextrans2 's,(.*),SMS,'
}
xxxxx_gmail_3() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
2012-12-29 01:43:39 +01:00
--folder INBOX.few_emails --debug --useheader Message-ID --delete2 --dry
2011-04-24 23:19:36 +02:00
}
2012-12-29 01:43:39 +01:00
xxxxx_gmail_3_Received() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--folder INBOX.few_emails --debug --useheader Received --delete2 --dry
}
2012-04-17 00:31:15 +02:00
xxxxx_gmail_4_Sent() {
2011-04-24 23:19:36 +02:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--folder INBOX.Sent \
2012-04-17 00:31:15 +02:00
--regextrans2 's{Sent}{[Gmail]/Messages envoy&AOk-s}'
}
xxxxx_gmail_5_justfolders() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
2013-09-27 00:00:32 +02:00
--justfolders --nofoldersizes \
2013-10-18 02:11:27 +02:00
--regextrans2 's,(/|^) +,$1,g' --regextrans2 's, +(/|$),$1,g' \
--regextrans2 "s/[\^]/_/g" --debug
2011-04-24 23:19:36 +02:00
}
2012-04-17 00:31:15 +02:00
2011-04-24 23:19:36 +02:00
xxxxx_gmail_5_justlogin() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--justlogin
}
2012-04-17 00:31:15 +02:00
xxxxx_gmail_6() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
2012-04-17 00:34:41 +02:00
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
2012-04-17 00:31:15 +02:00
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--justfolders \
--regextrans2 "s, +$,,g" --regextrans2 "s, +/,/,g" \
--exclude INBOX.yop.YAP
#--dry --prefix2 '[Gmail]/'
}
2012-04-17 00:34:41 +02:00
xxxxx_gmail_7() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--folder INBOX.yop.yap
}
2011-04-24 23:19:36 +02:00
2012-11-27 23:32:36 +01:00
xxxxx_gmail_8_xlist() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--foldersizes \
--folder INBOX
}
2011-03-12 03:45:06 +01:00
gmail_xxxxx() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--nofoldersizes \
2012-04-17 00:31:15 +02:00
--dry --justfolders --exclude Gmail
2011-03-12 03:45:06 +01:00
}
2011-03-12 03:44:40 +01:00
gmail() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:04 +01:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
2011-03-12 03:44:40 +01:00
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
2012-04-17 00:31:15 +02:00
--passfile2 ../../var/pass/secret.tata \
--exclude Gmail
2011-03-12 03:44:43 +01:00
}
2011-03-12 03:44:40 +01:00
2011-09-25 22:31:48 +02:00
gmail_justfolders() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
2012-04-17 00:31:15 +02:00
--justfolders --exclude Gmail
2011-09-25 22:31:48 +02:00
}
gmail_via_stunnel_ks() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 ks.lamiral.info \
--port1 243 --nossl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--debug --justfolders
}
2011-03-12 03:44:43 +01:00
gmail_gmail() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:04 +01:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
2011-03-12 03:44:43 +01:00
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile1 ../../var/pass/secret.gilles_gmail \
2011-03-12 03:44:43 +01:00
--host2 imap.gmail.com \
--ssl2 \
2012-04-17 00:26:18 +02:00
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2012-04-17 00:31:15 +02:00
--justfolders --exclude Gmail
2011-03-12 03:44:43 +01:00
}
2012-07-21 04:18:22 +02:00
2013-04-22 21:50:50 +02:00
gmail_gmail_2() {
2011-03-12 03:45:04 +01:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
2011-03-12 03:44:43 +01:00
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile1 ../../var/pass/secret.gilles_gmail \
2011-03-12 03:44:43 +01:00
--host2 imap.gmail.com \
--ssl2 \
--user2 imapsync.gl@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2012-04-17 00:26:18 +02:00
--folder INBOX
2011-03-12 03:44:43 +01:00
#--dry # --debug --debugimap # --authmech1 LOGIN
2012-07-21 04:18:22 +02:00
}
2013-04-22 21:50:50 +02:00
gmail_gmail_3_delete() {
2012-07-21 04:18:22 +02:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 imapsync.gl@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl_gmail \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--folder '[Gmail]/All Mail' --delete
# '[Gmail]/All Mail' is not expunge by default!
2011-03-12 03:44:43 +01:00
}
2013-04-22 21:50:50 +02:00
gmail_gmail_4_tls() {
2012-07-21 04:18:22 +02:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 imap.gmail.com \
--ssl2 --tls2 --port2 993 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--folder INBOX
#--dry # --debug --debugimap # --authmech1 LOGIN
}
2013-04-22 21:50:50 +02:00
gmail_gmail_5_exclude_only_Gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 imap.gmail.com \
--ssl2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--nofoldersizes --folderrec "[Gmail]" --exclude "\[Gmail\]$"
}
2011-09-25 22:31:48 +02:00
yahoo_xxxx_login() {
! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com \
--ssl1 \
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin
}
yahoo_xxxx() {
2012-04-17 00:26:18 +02:00
# Yahoo works only with ssl (november 2011)
# Could do plain port 143 before
2011-09-25 22:31:48 +02:00
! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com \
2012-04-17 00:26:18 +02:00
--ssl1 \
2011-09-25 22:31:48 +02:00
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
--passfile2 ../../var/pass/secret.titi \
--sep1 '.'
}
2011-03-12 03:44:43 +01:00
allow3xx() {
2011-03-12 03:44:51 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:51 +01:00
--allow3xx --justlogin
2011-03-12 03:44:47 +01:00
}
2011-03-12 03:44:48 +01:00
noallow3xx() {
2013-05-21 00:04:57 +02:00
$CMD_PERL_3xx ./imapsync \
2011-03-12 03:44:48 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:51 +01:00
--noallow3xx --justlogin
2011-03-12 03:44:48 +01:00
}
2011-03-12 03:44:47 +01:00
archiveopteryx_1() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage je@lupus.aox.org
2011-03-12 03:44:43 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 lupus.aox.org --user1 je \
--passfile1 ../../var/pass/secret.aox_je \
--host2 lupus.aox.org --user2 je \
--passfile2 ../../var/pass/secret.aox_je \
2011-03-12 03:45:02 +01:00
--folder INBOX --regextrans2 's/INBOX/copy/'
2011-03-12 03:44:47 +01:00
}
2011-03-12 03:45:04 +01:00
dkimap_1() {
$CMD_PERL ./imapsync \
--host1 Mail.fourfrontsales.com --user1 dktest \
--passfile1 ../../var/pass/secret.dktest \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX/dkimap --regextrans2 's/INBOX.INBOX./INBOX./' \
2013-05-21 00:04:57 +02:00
--foldersize --nouid1
2011-03-12 03:45:04 +01:00
}
2011-03-12 03:44:51 +01:00
ll_justlogin() {
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-05-21 00:04:57 +02:00
--justlogin
2011-03-12 03:44:47 +01:00
}
2011-03-12 03:44:51 +01:00
ll_justlogin_backslash_char() {
2011-03-12 03:44:47 +01:00
# Look in the file ../../var/pass/secret.tptp to see
# strange \ character behavior
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 tptp@est.belle \
--passfile2 ../../var/pass/secret.tptp \
2013-05-21 00:04:57 +02:00
--justlogin
2011-03-12 03:44:40 +01:00
}
2012-04-17 00:30:19 +02:00
ll_justlogin_dollar_char() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 dollar \
--passfile2 ../../var/pass/secret.dollar \
--justlogin
}
2012-04-17 00:33:16 +02:00
ll_justlogin_equal_char() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 equal \
--passfile2 ../../var/pass/secret.equal \
--justlogin --debugimap2
}
2011-03-12 03:44:40 +01:00
2011-03-12 03:45:04 +01:00
ll_usecache() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX
}
2011-07-11 23:24:12 +02:00
ll_usecache_all() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes
}
2011-03-12 03:45:06 +01:00
2011-03-12 03:45:04 +01:00
ll_nousecache() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nousecache --nofoldersizes \
--folder INBOX
}
2012-11-27 23:32:36 +01:00
ll_usecache_INBOX() {
2011-03-12 03:45:06 +01:00
if can_send; then
sendtestmessage
else
:
fi
2012-11-27 23:32:36 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --foldersizes \
--folder INBOX
2011-03-12 03:45:06 +01:00
}
2012-11-27 23:32:36 +01:00
2011-03-12 03:45:06 +01:00
ll_usecache_noheader() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2013-04-22 21:50:50 +02:00
--usecache \
2011-03-12 03:45:06 +01:00
--folder INBOX --useheader ''
}
ll_usecache_debugcache() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX --useheader '' --debugcache
}
ll_usecache_debugcache_useuid() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX --useheader '' --debugcache --useuid
}
2013-04-22 21:50:50 +02:00
ll_useuid_INBOX()
2012-11-27 23:32:36 +01:00
{
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
2013-04-22 21:50:50 +02:00
--delete2 \
2012-11-27 23:32:36 +01:00
--useuid
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:45:06 +01:00
ll_useuid()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.useuid \
2011-07-11 23:24:12 +02:00
--delete2 \
2011-03-12 03:45:06 +01:00
--useuid
}
2011-07-11 23:24:12 +02:00
ll_useuid_all()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--delete2 --useuid --nofoldersizes
}
2011-03-12 03:45:06 +01:00
ll_useuid_nousecache()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.useuid \
--useuid --nousecache --debugcache
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:45:04 +01:00
2012-04-17 00:27:13 +02:00
ll_fastio()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --fastio1 --fastio2
}
2011-03-12 03:45:04 +01:00
2012-04-17 00:27:13 +02:00
ll_nofastio()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --nofastio1 --nofastio2
}
2011-03-12 03:45:04 +01:00
2011-03-12 03:44:29 +01:00
##########################
# specific tests
##########################
2012-07-21 04:18:22 +02:00
2013-10-18 02:11:27 +02:00
courier_45() {
$CMD_PERL ./imapsync \
--host1 imap.timeweb.ru --user1 imaptest@avanta-consulting.ru \
--passfile1 ../../var/pass/secret.avanta \
--host2 $HOST2 --user2 tobbit \
--passfile2 ../../var/pass/secret.tobbit \
--folder INBOX
}
courier_45_reverse() {
$CMD_PERL ./imapsync \
--host2 imap.timeweb.ru --user2 imaptest@avanta-consulting.ru \
--passfile2 ../../var/pass/secret.avanta \
--host1 $HOST2 --user1 tobbit \
--passfile1 ../../var/pass/secret.tobbit \
--folder INBOX
}
courier_45_reverse_empty() {
$CMD_PERL ./imapsync \
--host2 imap.timeweb.ru --user2 imaptest@avanta-consulting.ru \
--passfile2 ../../var/pass/secret.avanta \
--host1 $HOST2 --user1 empty \
--passfile1 ../../var/pass/secret.empty \
--folder INBOX --delete2
}
2012-09-03 02:08:57 +02:00
tobbit_11() {
$CMD_PERL ./imapsync \
--host1 217.22.84.74 --user1 Test_IMAP \
--passfile1 ../../var/pass/secret.tobbit \
--host2 localhost --user2 tobbit \
--passfile2 ../../var/pass/secret.tobbit \
--folder INBOX --sep1 / --prefix1 '' \
--nofoldersizes --useuid --idatefromheader
}
tobbit_12() {
$CMD_PERL ./imapsync \
--host1 217.22.84.74 --user1 Test_IMAP \
--passfile1 ../../var/pass/secret.tobbit \
--host2 localhost --user2 tobbit \
--passfile2 ../../var/pass/secret.tobbit \
--folder INBOX --sep1 / --prefix1 '' \
--nofoldersizes --useuid --idatefromheader --nocheckmessageexists
}
tobbit_21() {
$CMD_PERL ./imapsync \
--host1 217.22.84.74 --user1 Test_IMAP \
--passfile1 ../../var/pass/secret.tobbit \
--host2 localhost --user2 tobbit \
--passfile2 ../../var/pass/secret.tobbit \
--folder toto --sep1 / --prefix1 '' \
--nofoldersizes --useuid --idatefromheader
}
tobbit_22() {
$CMD_PERL ./imapsync \
--host1 217.22.84.74 --user1 Test_IMAP \
--passfile1 ../../var/pass/secret.tobbit \
--host2 localhost --user2 tobbit \
--passfile2 ../../var/pass/secret.tobbit \
--folder toto --sep1 / --prefix1 '' \
--nofoldersizes --useuid --idatefromheader --nocheckmessageexists
}
2012-07-21 04:18:22 +02:00
exchange_hoch_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 ex.fhstp.ac.at --ssl2 --user2 nscdummy@fhstp.local \
--passfile2 ../../var/pass/secret.fhstp \
--folder INBOX.oneemail --debug --delete2
}
exchange_hoch_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 ex.fhstp.ac.at --ssl2 --user2 nscdummy@fhstp.local \
--passfile2 ../../var/pass/secret.fhstp \
--folder INBOX.oneemail --dry --debugflags --debug --nofilterflags
}
exchange_hoch_3() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 ex.fhstp.ac.at --ssl2 --user2 nscdummy2@fhstp.local \
--passfile2 ../../var/pass/secret.fhstp \
--folder INBOX.few_emails --debugflags --debug --regexflag 's#\$Forwarded#\$MDNSent#'
}
2012-04-17 00:26:18 +02:00
dbmail_uid() {
# --useuid alone does not work on dbmaikl server 2.2.17 ready to run
# because uids are += 2 and uidnext is in fact uidnext + 1
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 182.236.127.31 --user2 imapsynctest \
--passfile2 ../../var/pass/secret.dbmail \
--folder INBOX --fast --delete2 --expunge2 \
--usecache --useuid --nocacheaftercopy
}
dbmail_nocacheaftercopy() {
# Does work
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 182.236.127.31 --user2 imapsynctest \
--passfile2 ../../var/pass/secret.dbmail \
--folder INBOX --fast --delete2 --expunge2 --usecache --nocacheaftercopy
}
dbmail_nocache() {
# Does work
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 182.236.127.31 --user2 imapsynctest \
--passfile2 ../../var/pass/secret.dbmail \
--folder INBOX --fast --delete2 --expunge2
}
bluehost2() {
$CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com --tls1 \
--user1 dalton@piila.com \
--passfile1 ../../var/pass/secret.bluehost2 \
--host2 box766.bluehost.com --ssl2 \
--user2 dalton@piila.com \
--passfile2 ../../var/pass/secret.bluehost2 \
--sep1 '/' --useuid --regextrans2 's/Inbox/INBOX/' --regextrans2 's,/,_,'
}
bluehost() {
$CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com --tls1 \
--user1 pii@piila.com \
--passfile1 ../../var/pass/secret.bluehost \
--host2 box766.bluehost.com --ssl2 \
--user2 pii@piila.com \
--passfile2 ../../var/pass/secret.bluehost \
--sep1 '/' --usecache --useuid --regextrans2 's/Inbox/INBOX/'
}
2011-09-25 22:31:48 +02:00
b2btech_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 pod51008.outlook.com \
--user2 TestGilles@uncc.edu \
--passfile2 ../../var/pass/secret.b2btech --tls2 \
--useheader Message-Id --useheader Message-ID --fast --delete2 --expunge2 \
--folder INBOX.oneemail --folder INBOX.few_emails --folder INBOX.Junk
}
Otilio() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 jacarmona@eurotyre.es \
--passfile1 ../../var/pass/secret.Otilio1 \
--host2 mail.eurotyre.es --user2 josedemo@eurotyre.es \
--passfile2 ../../var/pass/secret.Otilio2 \
--folder INBOX --nofoldersizes
}
Otilio2() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 jacarmona@eurotyre.es \
--passfile1 ../../var/pass/secret.Otilio1 \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--useuid --folder INBOX --nofoldersizes
}
Otilio3() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.eurotyre.es --user2 josedemo@eurotyre.es \
--passfile2 ../../var/pass/secret.Otilio2 \
--folder INBOX --nofoldersizes --regextrans2 's,INBOX,INBOX/delete_me,g'
}
2011-06-14 12:59:46 +02:00
Giancarlo_1() {
$CMD_PERL ./imapsync \
--host1 87.241.29.226 --user1 "Diego@studiobdp.local" \
--passfile1 ../../var/pass/secret.Giancarlo \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--regextrans2 's/.*/INBOX.Giancarlo/' \
--nofoldersizes --useuid
}
2011-09-25 22:31:48 +02:00
godaddy_1() {
2011-04-24 23:19:36 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.secureserver.net --user2 migrationtest@overnightmac.com \
--passfile2 ../../var/pass/secret.overnightmac --tls2 \
--folder INBOX.oneemail --folder INBOX.few_emails
}
2011-09-25 22:31:48 +02:00
godaddy_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.secureserver.net --user2 migrationtest@overnightmac.com \
--passfile2 ../../var/pass/secret.overnightmac --tls2 \
--folder INBOX.Junk --debug
}
2011-04-24 23:19:36 +02:00
mailenable_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 email.avonvalley.wilts.sch.uk --user2 "GLamiral" \
--passfile2 ../../var/pass/secret.avonvalley \
--sep2 / --prefix2 '' --useuid \
2011-06-14 12:59:46 +02:00
--folder INBOX --folder INBOX.Junk --folder INBOX.few_emails \
2011-04-24 23:19:36 +02:00
--delete2 --expunge2
}
mailenable_2_justfolders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 email.avonvalley.wilts.sch.uk --user2 "GLamiral" \
--passfile2 ../../var/pass/secret.avonvalley \
--sep2 / --prefix2 '' --useuid \
--justfolders --exclude "Gmail" --exclude ' '
}
mailenable_3_reverse() {
$CMD_PERL ./imapsync \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--host1 email.avonvalley.wilts.sch.uk --user1 "GLamiral" \
--passfile1 ../../var/pass/secret.avonvalley \
--sep1 / --prefix1 '' \
--folder few_emails \
--delete2 --expunge2 --debug --useuid
}
2011-06-14 12:59:46 +02:00
mailenable_21_host1() {
$CMD_PERL ./imapsync \
--host1 elix-irr.com --user1 "greg.watson" \
--passfile1 ../../var/pass/secret.greg.watson \
--host2 $HOST1 --user2 zzz \
--passfile2 ../../var/pass/secret.zzz \
--sep1 / --prefix1 '' \
--delete2 --expunge2 --useuid
}
mailenable_22_host2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 elix-irr.com --user2 "greg.watson" \
--passfile2 ../../var/pass/secret.greg.watson \
--sep2 / --prefix2 '' \
--folder INBOX.Junk --folder INBOX --folder INBOX.few_emails \
--useuid --debugLIST
}
2011-04-24 23:19:36 +02:00
bug_zero_byte() {
$CMD_PERL ./imapsync \
--host1 buzon.us.es --user1 rafaeltovar \
--passfile1 ../../var/pass/secret.rafaeltovar \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --regextrans2 s/INBOX/INBOX.rafaeltovar/
}
2011-03-12 03:45:06 +01:00
exchange_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.ethz.ch --ssl2 --user2 glamiral \
--passfile2 ../../var/pass/secret.ethz.ch \
2012-04-17 00:28:48 +02:00
--folder INBOX.few_emails \
--debugflags \
--useheader 'MESSAGE-ID' --delete2 --expunge2 \
--nofilterflags \
#--regexflag 's/\$\w+//g'
#-maxage 1
2011-03-12 03:45:06 +01:00
}
2011-04-24 23:19:36 +02:00
exchange_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.ethz.ch --ssl2 --user2 glamiral \
--passfile2 ../../var/pass/secret.ethz.ch \
--folder INBOX.Junk --useuid
}
exchange_3_delete2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.ethz.ch --ssl2 --user2 glamiral \
--passfile2 ../../var/pass/secret.ethz.ch \
--folder INBOX.Junk --useuid --delete2
}
2012-04-17 00:28:48 +02:00
exchange_4_useheader_Received() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.ethz.ch --ssl2 --user2 glamiral \
--passfile2 ../../var/pass/secret.ethz.ch \
--folder INBOX.yop.yap \
--delete2 --expunge2 \
--useheader 'Received'
# --useheader 'Received'
#--regexflag 's/\$\w+//g'
#-maxage 1
}
2011-03-12 03:45:06 +01:00
jong_1() {
$CMD_PERL ./imapsync \
--host1 mail.y-publicaties.nl --user1 gillesl --passfile1 ../../var/pass/secret.jong \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi --sep1 / --prefix1 '' \
2011-04-24 23:19:36 +02:00
--delete2 --expunge2 --expunge1 --expunge \
--foldersizes --folder Junk/2009 --useuid
2011-03-12 03:45:06 +01:00
# --debugimap1 --dry
}
jong_1_reverse() {
$CMD_PERL ./imapsync \
--host2 mail.y-publicaties.nl --user2 gillesl --passfile2 ../../var/pass/secret.jong \
--host1 $HOST2 --user1 gilles@est.belle --passfile1 ../../var/pass/secret.gilles_mbox \
--sep2 / --prefix2 '' \
2011-04-24 23:19:36 +02:00
--folder INBOX.Junk.2009 --delete2 --expunge2 --expunge1 --expunge --useuid
2011-03-12 03:45:06 +01:00
#--nofoldersizes
# --debugimap1 --dry
}
jong_1_lastuid()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.y-publicaties.nl --user2 gillesl \
--passfile2 ../../var/pass/secret.jong \
--sep2 / --prefix2 '' \
--folder INBOX --nofoldersizes --maxage 1
}
jong_2_delete() {
$CMD_PERL ./imapsync \
--host1 mail.y-publicaties.nl --user1 gillesl --passfile1 ../../var/pass/secret.jong \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi --sep1 / --prefix1 '' \
--delete --folder INBOX
# --debugimap1 --dry
}
2011-03-12 03:45:04 +01:00
gigamail_1() {
$CMD_PERL ./imapsync \
--host1 mail.gigamail.nl --user1 testbox@gigamail.nl --passfile1 ../../var/pass/secret.gigamail \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi \
--sep1 . --prefix1 ''
}
gigamail_2() {
$CMD_PERL ./imapsync \
--host1 mail.gigamail.nl --user1 testbox@gigamail.nl --passfile1 ../../var/pass/secret.gigamail \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi
}
gigamail_3() {
$CMD_PERL ./imapsync \
--host1 mail.gigamail.nl --user1 testbox@gigamail.nl --passfile1 ../../var/pass/secret.gigamail \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi --sep1 .
}
sunone_gmail()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 mailhost.marymount.edu --ssl1 --user1 adoe \
--passfile1 ../../var/pass/secret.adoe \
--host2 imap.googlemail.com --ssl2 --user2 adoe@marymount.edu \
--passfile2 ../../var/pass/secret.adoegmail \
--useheader Message-ID --no-authmd5 \
--exclude Trash
}
date2=`date`
echo3 "[$date1] [$date2]"
}
sunone_gmail_2()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 mailhost.marymount.edu --ssl1 --user1 jharsh@marymount.edu \
--passfile1 ../../var/pass/secret.jharsh \
--host2 imap.googlemail.com --ssl2 --user2 jharsh@marymount.edu \
--passfile2 ../../var/pass/secret.jharsh \
--useheader Message-ID --no-authmd5 \
--folder bug
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2012-04-17 00:31:15 +02:00
big_folder()
2011-03-12 03:43:55 +01:00
{
date1=`date`
2011-03-12 03:44:36 +01:00
{ $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
2011-03-12 03:45:06 +01:00
--folder INBOX.Junk.2010 \
--useheader Message-ID || \
2011-03-12 03:44:01 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2012-04-17 00:31:15 +02:00
big_folder_useuid()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk.2011 --nofoldersizes \
--useuid --tmpdir /var/tmp || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
big_folder_sizes_only()
2011-03-12 03:44:01 +01:00
{
date1=`date`
2011-03-12 03:44:36 +01:00
{ $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
2011-03-12 03:45:06 +01:00
--justfoldersizes --folder INBOX.Junk.2010 || \
2011-03-12 03:43:55 +01:00
true
}
date2=`date`
2011-03-12 03:44:01 +01:00
echo3 "[$date1] [$date2]"
2011-03-12 03:43:55 +01:00
}
2011-03-12 03:43:51 +01:00
2012-04-17 00:31:15 +02:00
big_folder_fast()
2011-03-12 03:45:06 +01:00
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk.2010 \
--fast || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2012-04-17 00:31:15 +02:00
big_folder_fast2()
2011-03-12 03:45:06 +01:00
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk \
--fast || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
echo2 'rm -f /home/vmail/tete/.Junk/cur/*'
}
2011-03-12 03:44:01 +01:00
2011-03-12 03:44:57 +01:00
dprof_justfoldersizes()
2011-03-12 03:44:01 +01:00
{
date1=`date`
2011-03-12 03:44:57 +01:00
{ $CMD_PERL -d:DProf ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.tete \
2011-03-12 03:44:57 +01:00
--justfoldersizes --folder INBOX.Junk || \
2011-03-12 03:44:01 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
2011-03-12 03:44:57 +01:00
mv tmon.out dprof_justfoldersizes_tmon.out
dprofpp -O 30 dprof_justfoldersizes_tmon.out
dprofpp -O 30 -I dprof_justfoldersizes_tmon.out
2011-03-12 03:44:01 +01:00
}
2011-03-12 03:44:57 +01:00
dprof_bigfolder()
{
date1=`date`
{ $CMD_PERL -d:DProf ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--nofoldersizes --folder INBOX.15_imapsync.imapsync-list || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
2011-03-12 03:45:02 +01:00
mv tmon.out dprof_bigfolder_tmon.out
2011-03-12 03:44:57 +01:00
dprofpp -O 30 dprof_bigfolder_tmon.out
dprofpp -O 30 -I dprof_bigfolder_tmon.out
}
2011-03-12 03:45:02 +01:00
dprof_bigmail()
{
date1=`date`
{ $CMD_PERL -d:DProf ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.bigmail
2011-03-12 03:45:04 +01:00
echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
2011-03-12 03:45:02 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
mv tmon.out dprof_bigmail_tmon.out
dprofpp -O 30 dprof_bigmail_tmon.out
dprofpp -O 30 -I dprof_bigmail_tmon.out
}
2011-03-12 03:44:57 +01:00
2011-03-12 03:44:29 +01:00
##########################
##########################
2011-03-12 03:44:17 +01:00
2011-03-12 03:44:56 +01:00
# Tests list
mandatory_tests='
2011-06-14 12:59:46 +02:00
no_args
2012-12-29 01:43:39 +01:00
option_version
option_tests
2011-03-12 03:45:02 +01:00
option_tests_debug
2011-03-12 03:44:56 +01:00
option_bad_delete2
2011-03-12 03:44:57 +01:00
passwords_masked
2012-11-27 23:32:36 +01:00
passwords_not_masked
2011-03-12 03:44:56 +01:00
first_sync_dry
first_sync
locallocal
2011-03-12 03:45:02 +01:00
pidfile
2012-11-27 23:32:36 +01:00
ll_pidfilelocking
2011-03-12 03:45:02 +01:00
justbanner
nomodules_version
2011-03-12 03:45:06 +01:00
xxxxx_gmail
gmail_xxxxx
2011-03-12 03:45:02 +01:00
gmail
gmail_gmail
2013-04-22 21:50:50 +02:00
gmail_gmail_2
2011-09-25 22:31:48 +02:00
yahoo_xxxx
2012-12-29 01:43:39 +01:00
ll_unknow_option
2011-03-12 03:44:56 +01:00
ll_ask_password
ll_bug_folder_name_with_blank
ll_timeout
2011-03-12 03:45:04 +01:00
ll_folder
ll_folder_noexist
2011-03-12 03:45:01 +01:00
ll_oneemail
2011-03-12 03:44:56 +01:00
ll_buffersize
ll_justfolders
ll_prefix12
2011-03-12 03:44:57 +01:00
ll_nosyncinternaldates
2011-03-12 03:44:56 +01:00
ll_idatefromheader
ll_folder_rev
ll_subscribed
2012-04-17 00:26:18 +02:00
ll_nosubscribe
2011-03-12 03:44:56 +01:00
ll_justfoldersizes
ll_authmd5
2011-03-12 03:45:04 +01:00
ll_authmd51
ll_authmd52
2011-03-12 03:44:56 +01:00
ll_noauthmd5
ll_maxage
ll_maxsize
ll_skipsize
ll_skipheader
ll_include
ll_exclude
2011-03-12 03:45:04 +01:00
ll_exclude_INBOX
2011-03-12 03:44:56 +01:00
ll_regextrans2
2011-03-12 03:45:04 +01:00
ll_regextrans2_subfolder
2011-03-12 03:44:56 +01:00
ll_sep2
ll_bad_login
ll_bad_host
ll_bad_host_ssl
ll_useheader
2011-03-12 03:45:04 +01:00
ll_useheader_noheader
2011-03-12 03:44:56 +01:00
ll_regexmess
2013-07-25 23:42:01 +02:00
ll_regexmess_bad_regex
2011-03-12 03:44:56 +01:00
ll_regexmess_scwchu
ll_flags
ll_regex_flag
2013-07-25 23:42:01 +02:00
ll_regex_flag_bad
2011-03-12 03:44:56 +01:00
ll_regex_flag_keep_only
ll_justconnect
ll_justlogin
ll_ssl
ll_ssl_justconnect
ll_ssl_justlogin
ll_tls_justconnect
ll_tls_justlogin
ll_tls
ll_authmech_PLAIN
2013-05-21 00:04:57 +02:00
ll_authmech_XOAUTH_gmail
2011-03-12 03:44:56 +01:00
ll_authmech_LOGIN
ll_authmech_CRAMMD5
2013-08-04 03:27:37 +02:00
ll_authmech_PREAUTH
2011-03-12 03:44:56 +01:00
ll_authuser
2011-06-14 12:59:46 +02:00
ll_delete_delete2
2011-03-12 03:44:56 +01:00
ll_delete2
ll_delete
ll_folderrec
allow3xx
2011-03-12 03:45:02 +01:00
noallow3xx
2011-03-12 03:45:02 +01:00
ll_memory_consumption
ll_newmessage
2011-03-12 03:45:04 +01:00
ll_usecache
2011-03-12 03:45:06 +01:00
ll_usecache_noheader
ll_usecache_debugcache
2011-03-12 03:45:04 +01:00
ll_nousecache
2013-09-26 23:59:52 +02:00
ll_delete2foldersonly_NEW_3
2011-03-12 03:45:04 +01:00
ll_delete2foldersonly
ll_delete2foldersonly_tmp
ll_delete2foldersbutnot
2011-06-14 12:59:46 +02:00
ll_folder_create
ll_folder_create_INBOX_Inbox
2011-03-12 03:45:02 +01:00
ll_delete2folders
2011-03-12 03:45:06 +01:00
ll_useuid
ll_useuid_nousecache
2011-06-14 13:02:33 +02:00
ll_noheader_force
ll_noheader
2011-03-12 03:45:02 +01:00
'
2011-03-12 03:44:56 +01:00
other_tests='
2011-03-12 03:45:02 +01:00
archiveopteryx_1
2011-03-12 03:44:56 +01:00
msw
2011-03-12 03:45:02 +01:00
msw2
ll_bigmail
ll_justlogin_backslash_char
option_tests_debug
'
2011-03-12 03:44:56 +01:00
l() {
echo "$mandatory_tests" "$other_tests"
}
2011-03-12 03:44:23 +01:00
2011-03-12 03:39:59 +01:00
# mandatory tests
2011-03-12 03:44:47 +01:00
run_tests perl_syntax
2011-03-12 03:39:59 +01:00
2011-03-12 03:45:01 +01:00
2011-03-12 03:39:59 +01:00
# All tests
2011-03-12 03:44:56 +01:00
test $# -eq 0 && run_tests $mandatory_tests
2011-03-12 03:44:11 +01:00
2011-03-12 03:39:59 +01:00
# selective tests
2011-03-12 03:44:35 +01:00
test $# -gt 0 && run_tests "$@"
2011-03-12 03:39:59 +01:00
# If there, all is good
echo3 ALL $test_count TESTS SUCCESSFUL