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

6329 lines
189 KiB
Bash
Raw Normal View History

2011-03-12 03:39:59 +01:00
#!/bin/sh
2020-04-11 01:15:57 +02:00
# $Id: tests.sh,v 1.353 2020/01/02 23:48:18 gilles Exp gilles $
2017-09-23 23:54:48 +02:00
# general tests start
# general tests end
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:01 +01:00
# Example 1:
2017-09-23 23:54:48 +02:00
# CMD_PERL='perl -I./W/Mail-IMAPClient-3.39/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:
2015-12-03 18:16:32 +01:00
# sh -x tests.sh 2 ll 3 ll
# This runs ll() 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:
2019-07-03 01:25:47 +02:00
CMD_PERL_3xx='perl -I./W/Mail-IMAPClient-3.42/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
2016-09-19 17:17:24 +02:00
#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
}
2016-09-19 17:17:24 +02:00
echolog() {
echo "`date_ymdhms` : $@" >> W/.tests.errors.txt
echo3 Last errors listed in W/.tests.errors.txt
}
2011-03-12 03:39:59 +01:00
run_test() {
2016-09-19 17:17:24 +02:00
echo3 "#### $tests_count $1"
2017-09-23 23:54:48 +02:00
setxon
# do not run anything between the two following instructions
$1; run_test_status=$?
# now you can run
setxback 2> /dev/null
2016-09-19 17:17:24 +02:00
if test x"$run_test_status" = x"0"; then
2011-03-12 03:44:36 +01:00
echo "$1 passed"
else
2016-09-19 17:17:24 +02:00
echo3 "$1 failed"
2011-03-12 03:44:36 +01:00
fi
2016-09-19 17:17:24 +02:00
return $run_test_status
2011-03-12 03:39:59 +01:00
}
2017-09-23 23:54:48 +02:00
setxon() {
if ! { echo $-|grep x ; } ; then
#echo 'set -x was off'
setx_restore_cmd='set +x'
set -x
else
echo 'set -x already on'
setx_restore_cmd=""
fi
}
setxback() {
$setx_restore_cmd
}
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
2016-09-19 17:17:24 +02:00
tests_count=`expr 1 + $tests_count`
2015-05-28 19:04:57 +02:00
#
2016-09-19 17:17:24 +02:00
if ! run_test "$t"; then
tests_failed_count=`expr 1 + $tests_failed_count`
tests_failed_list="$tests_failed_list $t"
fi
sleep 0
2011-03-12 03:44:36 +01:00
done
2016-09-19 17:17:24 +02:00
if test 0 -eq $tests_failed_count; then
echo3 "ALL $tests_count TESTS SUCCESSFUL"
echolog "ALL $tests_count TESTS SUCCESSFUL"
return 0
else
# At least one failed
echo3 "FAILED $tests_failed_count/$tests_count TESTS: $tests_failed_list"
echolog "FAILED $tests_failed_count/$tests_count TESTS: $tests_failed_list"
return 1
fi
2011-03-12 03:39:59 +01:00
}
#### Variable definitions
2016-09-19 17:17:24 +02:00
tests_count=0
tests_failed_count=0
2011-03-12 03:39:59 +01:00
##### 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
}
2013-12-30 03:03:13 +01:00
# list of accounts on petite :
2011-03-12 03:39:59 +01:00
2013-12-30 03:03:13 +01:00
# mailboxes toto -> titi used on first_sync()
2011-03-12 03:44:29 +01:00
2015-12-03 18:16:32 +01:00
# mailboxes tata -> titi used on ll()
2013-12-30 03:03:13 +01:00
# mailboxes 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:
2015-05-28 19:04:57 +02:00
# huge_folder()
# huge_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
2016-09-19 17:17:24 +02:00
# mailboxes toto -> delme -> delme used on ll_delself
2011-03-12 03:43:48 +01:00
sendtestmessage() {
2011-03-12 03:44:47 +01:00
email=${1:-"tata"}
2015-05-28 19:04:57 +02:00
rand=${2:-"`pwgen 16 1`"}
mess='test: '"$rand"
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
}
2020-04-11 01:15:57 +02:00
sendtestmessage_titi() {
email=${1:-"titi"}
rand=${2:-"`pwgen 16 1`"}
mess='test: '"$rand"
cmd="echo $mess""| mail -s '""$mess""' $email"
echo $cmd
eval "$cmd"
}
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:48 +01:00
can_send() {
2020-04-11 01:15:57 +02:00
# no send at all
2016-09-19 17:17:24 +02:00
return 1
2020-04-11 01:15:57 +02:00
2019-07-03 01:17:46 +02:00
test X`hostname` = X"petite" && return 0;
2011-03-12 03:44:48 +01:00
test X`hostname` = X"plume" && return 0;
test X`hostname` = X"vadrouille" && return 0;
return 1
}
2017-09-23 23:54:48 +02:00
at_home() {
test X`hostname` = X"petite" && return 0;
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
}
2019-07-03 01:25:47 +02:00
set_return_code_variables()
{
# Copy from imapsync
EX_OK=0 #/* successful termination */
EX_USAGE=64 #/* command line usage error */
EX_NOINPUT=66 #/* cannot open input */
EX_UNAVAILABLE=69 #/* service unavailable */
EX_SOFTWARE=70 #/* internal software error */
EXIT_CATCH_ALL=1 # Any other error
EXIT_BY_SIGNAL=6
EXIT_PID_FILE_ERROR=8
EXIT_CONNECTION_FAILURE=10
EXIT_TLS_FAILURE=12
EXIT_AUTHENTICATION_FAILURE=16
EXIT_SUBFOLDER1_NO_EXISTS=21
EXIT_WITH_ERRORS=111
EXIT_WITH_ERRORS_MAX=112
EXIT_TESTS_FAILED=254 # Like Test::More API
}
2017-09-23 23:54:48 +02:00
# general tests start
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
}
2017-09-23 23:54:48 +02:00
option_tests_in_var_tmp_sub() {
(
mkdir -p /var/tmp/imapsync_tests
cd /var/tmp/imapsync_tests
/g/public_html/imapsync/i3 --tests
)
}
option_tests_in_var_tmp() {
(
cd /var/tmp/
/g/public_html/imapsync/i3 --tests
)
}
2018-05-07 16:04:23 +02:00
option_testsdebug() {
$CMD_PERL ./imapsync --testsdebug
2011-03-12 03:45:02 +01:00
}
2018-05-07 16:04:23 +02:00
option_releasecheck() {
$CMD_PERL ./imapsync --help --releasecheck | egrep 'This imapsync.*local.*official'
}
option_noreleasecheck() {
2019-07-03 01:25:47 +02:00
! { $CMD_PERL ./imapsync --help --noreleasecheck | egrep 'This imapsync.*local.*official' ; }
2018-05-07 16:04:23 +02:00
}
2011-03-12 03:44:47 +01:00
option_bad_delete2() {
2019-07-03 01:25:47 +02:00
$CMD_PERL ./imapsync --delete 2 --blabla
test "$?" = "$EX_USAGE"
2011-03-12 03:44:47 +01:00
}
2018-05-07 16:04:23 +02:00
option_extra_arguments() {
2019-07-03 01:25:47 +02:00
$CMD_PERL ./imapsync --testslive blabla
test "$?" = "$EX_USAGE"
2018-05-07 16:04:23 +02:00
}
2011-03-12 03:44:47 +01:00
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
}
2015-12-03 18:16:32 +01:00
passwords_dollar() {
$CMD_PERL ./imapsync --host1 boumboum --user1 ee --password1 '$secret' --host2 boumboum --user2 ee --password2 '$secret' --showpasswords
}
passwords_parenthese() {
2016-09-19 17:17:24 +02:00
#$CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 '( secret' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1
$CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 'secret )' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1
2015-12-03 18:16:32 +01:00
}
2017-09-23 23:54:48 +02:00
passfile1_noexist() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 /noexists \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi
2019-07-03 01:25:47 +02:00
test "$?" = "$EX_NOINPUT"
2017-09-23 23:54:48 +02:00
}
2019-07-03 01:25:47 +02:00
2017-09-23 23:54:48 +02:00
passfile2_noexist() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 /noexists
2019-07-03 01:25:47 +02:00
test "$?" = "$EX_NOINPUT"
2017-09-23 23:54:48 +02:00
}
ll_showpasswords() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--password1 'ami\"seen' \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin --showpasswords --debugimap1
}
2019-07-03 01:25:47 +02:00
ll_authentication_failure() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--password1 wrong \
--host2 $HOST2 --user2 titi \
--password2 wrong
test "$?" = "$EXIT_AUTHENTICATION_FAILURE"
}
ll_justhost1()
{
$CMD_PERL ./imapsync --host1 $HOST2
}
ll_justhost2()
{
$CMD_PERL ./imapsync --host2 $HOST2
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
testslive() {
$CMD_PERL ./imapsync --testslive
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
testslive6() {
$CMD_PERL ./imapsync --testslive6
}
2015-12-03 18:16:32 +01:00
2016-09-19 17:17:24 +02:00
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
2015-12-03 18:16:32 +01:00
ll() {
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
}
2019-07-03 01:17:46 +02:00
ll_INBOX() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX
}
2020-04-11 01:15:57 +02:00
ll_skipcrossduplicates() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--skipcrossduplicates --debugcrossduplicates
}
2019-07-03 01:25:47 +02:00
ll_append_debugimap() {
sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --maxage 1 --debugimap1 --nofoldersizes
}
2019-07-03 01:17:46 +02:00
ll_diff() {
# sendtestmessage
CMD_IMAPSYNC=./imapsync_old ll_tee LOG_imapsync/ll_diff_1.txt
# sendtestmessage
CMD_IMAPSYNC=./imapsync ll_tee LOG_imapsync/ll_diff_2.txt
diff LOG_imapsync/ll_diff_1.txt LOG_imapsync/ll_diff_2.txt
}
ll_tee() {
logfile=${1:-"LOG_imapsync/ll_tee.txt"}
$CMD_PERL $CMD_IMAPSYNC \
--host1 $HOST1 --user1 tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2019-07-03 01:25:47 +02:00
--folder INBOX.few_emails --password1 wrong | tee $logfile
# --passfile1 ../../var/pass/secret.tata \
2019-07-03 01:17:46 +02:00
}
2017-09-23 23:54:48 +02:00
ll_minsize() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--minsize 1000000 --folder INBOX
}
ll_search_larger() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'LARGER 1000' --folder INBOX
}
ll_maxsize() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxsize 1000 --folder INBOX
}
ll_search_smaller() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'SMALLER 1000' --folder INBOX
}
2018-05-07 16:04:23 +02:00
kk_simulong() {
$CMD_PERL ./imapsync \
--testslive --simulong 30
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2019-07-03 01:25:47 +02:00
ll_sigreconnect_INT() {
( $CMD_PERL ./imapsync \
2018-05-07 16:04:23 +02:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2019-07-03 01:25:47 +02:00
--sigreconnect INT --simulong 30 \
--pidfile /tmp/imapsync_tests_ll_sigreconnect_INT.pid
echo status code when killing itself: $? # status code when killing itself?
) &
echo ; sleep 2; echo ;
2020-04-11 01:15:57 +02:00
kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
2019-07-03 01:25:47 +02:00
echo ; sleep 3; echo ;
2020-04-11 01:15:57 +02:00
kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
2019-07-03 01:25:47 +02:00
echo ; sleep 3; echo ;
2020-04-11 01:15:57 +02:00
kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
2019-07-03 01:25:47 +02:00
sleepenh 0.1
2020-04-11 01:15:57 +02:00
kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
2019-07-03 01:25:47 +02:00
wait
2018-05-07 16:04:23 +02:00
}
ll_sigreconnect_CACA() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--sigreconnect CACA --simulong 30
}
ll_sigreconnect_none() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--sigreconnect '' --simulong 30
}
ll_sigignore_INT() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--sigignore 'INT' --simulong 10
}
ll_sigignore_TERM() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--sigignore 'TERM' --simulong 10
}
2020-04-11 01:15:57 +02:00
# ABORT tests
2018-05-07 16:04:23 +02:00
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_abort_pidfile_no_exist() {
2017-09-23 23:54:48 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2018-05-07 16:04:23 +02:00
--abort --pidfile /noexist \
| grep 'Can not read pidfile /noexist. Exiting.'
2017-09-23 23:54:48 +02:00
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
ll_abort_noprocess() {
2020-04-11 01:15:57 +02:00
echo 999999 > /tmp/imapsync_fake.pid
2017-09-23 23:54:48 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--abort --pidfile /tmp/imapsync_fake.pid \
| grep 'Can not send signal kill ZERO to PID 999999.'
2017-09-23 23:54:48 +02:00
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2018-05-07 16:04:23 +02:00
ll_abort() { # send QUIT signal
rm -f LOG_imapsync/imapsync_abortme.log
2017-09-23 23:54:48 +02:00
$CMD_PERL ./imapsync \
2019-07-03 01:25:47 +02:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--pidfile /tmp/imapsync_abortme.pid \
--logfile imapsync_abortme.log --simulong 4 &
sleep 2
2017-09-23 23:54:48 +02:00
2019-07-03 01:25:47 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--abort --pidfile /tmp/imapsync_abortme.pid \
--logfile imapsync_aborter.log \
| egrep 'Process PID .* ended.' \
|| { echo 'Look into LOG_imapsync/imapsync_aborter.log' ; return 1 ; }
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
2019-07-03 01:25:47 +02:00
grep 'Killing myself with signal QUIT' LOG_imapsync/imapsync_abortme.log
2017-09-23 23:54:48 +02:00
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_abort_cgi_context_tail() {
2019-07-03 01:25:47 +02:00
rm -f LOG_imapsync/imapsync_abortme.log
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--pidfile /tmp/imapsync_abortme_cgi_context.pid --pidfilelocking --tail \
--logfile imapsync_abortme_cgi_context.log --simulong 4 &
sleep 2
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--abort --pidfile /tmp/imapsync_abortme_cgi_context.pid --pidfilelocking --tail \
2020-04-11 01:15:57 +02:00
| egrep 'Process PID .* ended.' || return 1
2019-07-03 01:25:47 +02:00
grep 'Killing myself with signal QUIT' LOG_imapsync/imapsync_abortme_cgi_context.log
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_abort_no_pidfile_option() {
rm -f LOG_imapsync/imapsync_abortme.log
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--logfile imapsync_abortme_no_pidfile_option.log --simulong 4 &
sleep 2
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--abort \
| egrep 'Process PID .* ended.' || return 1
grep 'Killing myself with signal QUIT' LOG_imapsync/imapsync_abortme_no_pidfile_option.log
}
2019-07-03 01:25:47 +02:00
2020-04-11 01:15:57 +02:00
abort_tests()
{
ll_abort_pidfile_no_exist \
&& ll_abort_noprocess \
&& ll_abort \
&& ll_abort_cgi_context_tail \
&& ll_abort_no_pidfile_option
}
2017-09-23 23:54:48 +02:00
ll_nouid1() {
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--nouid1 --folder INBOX # --debugimap1
2017-09-23 23:54:48 +02:00
}
2014-11-19 23:16:16 +01:00
ll_eta() {
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 \
2019-07-03 01:17:46 +02:00
--folder INBOX
2014-11-19 23:16:16 +01:00
}
2019-07-03 01:17:46 +02:00
ll_final_diff() {
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 \
--folder INBOX --f1f2 INBOX=INBOX.final_diff --maxage 30
}
2014-11-19 23:16:16 +01:00
2019-07-03 01:24:23 +02:00
ll_with_errors() {
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 \
--folder INBOX --maxage 30 \
--regexflag 's/.*/PasGlop \\PasGlopRe/'
}
2015-12-03 18:16:32 +01:00
2015-05-28 19:04:57 +02:00
ll_errors() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2016-09-19 17:17:24 +02:00
--nofoldersizes --folder INBOX.errors --regexflag 's/.*/PasGlop \\PasGlopRe/' --errorsmax 5 --delete2
2015-05-28 19:04:57 +02:00
#--pipemess 'grep lalalala' --nopipemesscheck --dry --debugcontent --debugflags
}
2020-04-11 01:15:57 +02:00
ll_debug()
{
2013-07-25 23:42:01 +02:00
$CMD_PERL ./imapsync \
2020-04-11 01:15:57 +02:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--debug
2013-07-25 23:42:01 +02:00
}
2015-12-03 18:16:32 +01:00
ll_debugcontent() {
2016-09-19 17:17:24 +02:00
can_send && sendtestmessage
2015-12-03 18:16:32 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--debugcontent --maxage 1 --folder INBOX --dry
}
2013-12-30 03:03:13 +01:00
ll_debugmemory() {
2019-07-03 01:17:46 +02:00
sendtestmessage
2013-12-30 03:03:13 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2016-09-19 17:17:24 +02:00
--debugmemory --nofoldersizes --folder INBOX
2013-12-30 03:03:13 +01:00
}
2020-04-11 01:15:57 +02:00
ll_justfolderlists()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--checkselectable --justfolderlists
}
2018-05-07 16:04:23 +02:00
ll_checkselectable()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--checkselectable --debugimap1 --justfolderlists \
| grep 'is selectable'
}
ll_nocheckselectable()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nocheckselectable --justfolderlists \
| grep 'Not checking that wanted folders are selectable'
}
ll_checkfoldersexist()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--checkfoldersexist --debug --justfolderlists \
| grep -i 'checking'
2018-05-07 16:04:23 +02:00
}
2020-04-11 01:15:57 +02:00
ll_nocheckfoldersexist()
2018-05-07 16:04:23 +02:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nocheckfoldersexist --justfolderlists \
| grep -i 'Not checking that wanted folders exist'
}
2013-07-25 23:42:01 +02:00
2020-04-11 01:15:57 +02:00
ll_nofoldersizes()
2012-04-17 00:30:19 +02:00
{
$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
2019-07-03 01:25:47 +02:00
pidfile_well_removed() {
2011-03-12 03:44:54 +01:00
$CMD_PERL ./imapsync \
--justbanner \
--pidfile /var/tmp/imapsync.pid
2019-07-03 01:25:47 +02:00
test "$?" = "$EX_OK" || return 1
2011-03-12 03:44:54 +01:00
! test -f /var/tmp/imapsync.pid
}
2019-07-03 01:25:47 +02:00
pidfile_bad() {
$CMD_PERL ./imapsync \
--justbanner \
--pidfile /var/tmp/noexist/imapsync.pid
test "$?" = "$EXIT_PID_FILE_ERROR"
}
2020-04-11 01:15:57 +02:00
test_tail() {
2019-07-03 01:25:47 +02:00
$CMD_PERL ./imapsync \
--justbanner --simulong 15 \
--pidfile /var/tmp/imapsync_tail_tests.pid \
--pidfilelocking &
sleep 1
$CMD_PERL ./imapsync \
--justbanner \
--pidfile /var/tmp/imapsync_tail_tests.pid \
--pidfilelocking --tail
}
2018-05-07 16:04:23 +02:00
ll_pidfilelocking() {
2016-09-19 17:17:24 +02:00
rm -f /var/tmp/imapsync_test_pidfilelocking.pid
2019-07-03 01:25:47 +02:00
2018-05-07 16:04:23 +02:00
echo ll_pidfilelocking 01 lockfile is not previously there
2019-07-03 01:25:47 +02:00
$CMD_PERL ./imapsync --justbanner \
--pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
--pidfilelocking || return 1
2018-05-07 16:04:23 +02:00
echo ll_pidfilelocking 02 lockfile normally removed
2019-07-03 01:25:47 +02:00
! test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1
echo ll_pidfilelocking 03 lockfile created before
touch /var/tmp/imapsync_test_pidfilelocking.pid || return 1
echo ll_pidfilelocking 04 lockfile already there but not with a PID number
! $CMD_PERL ./imapsync --justbanner \
--pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
--pidfilelocking || return 1
2018-05-07 16:04:23 +02:00
echo ll_pidfilelocking 05 lockfile still there
2016-09-19 17:17:24 +02:00
test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1
2019-07-03 01:25:47 +02:00
2018-05-07 16:04:23 +02:00
echo ll_pidfilelocking 06 filling lockfile with 33333
echo 33333 > /var/tmp/imapsync_test_pidfilelocking.pid
2019-07-03 01:25:47 +02:00
2018-05-07 16:04:23 +02:00
echo ll_pidfilelocking 07 lockfile already there with fake PID in it, imapsync will remove it and generate a new one.
2019-07-03 01:25:47 +02:00
$CMD_PERL ./imapsync --justbanner \
--pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
--pidfilelocking || return 1
2018-05-07 16:04:23 +02:00
echo ll_pidfilelocking 08 lockfile should be removed now
! test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1
2012-11-27 23:32:36 +01:00
}
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() {
2015-05-28 19:04:57 +02:00
{
sleep 2; cat ../../var/pass/secret.tata;
sleep 2; cat ../../var/pass/secret.titi;
} | \
2011-03-12 03:44:49 +01:00
$CMD_PERL ./imapsync \
2015-05-28 19:04:57 +02:00
--host1 $HOST1 --user1 tata \
2011-03-12 03:44:49 +01:00
--host2 $HOST2 --user2 titi \
--justlogin
}
2017-09-23 23:54:48 +02:00
ll_env_password() {
set +x
IMAPSYNC_PASSWORD1=`cat ../../var/pass/secret.tata` \
IMAPSYNC_PASSWORD2=`cat ../../var/pass/secret.titi` \
$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 \
2017-09-23 23:54:48 +02:00
--folder INBOX --timeout 3 --justlogin
2011-03-12 03:44:40 +01:00
}
2016-01-22 17:52:28 +01:00
ll_timeout1_timeout2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2017-09-23 23:54:48 +02:00
--folder INBOX --timeout1 4 --timeout2 5 --justlogin
2016-01-22 17:52:28 +01:00
}
ll_timeout_timeout1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2017-09-23 23:54:48 +02:00
--folder INBOX --timeout1 5 --timeout 4 --justlogin
2016-01-22 17:52:28 +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
}
2015-12-03 18:16:32 +01:00
ll_backstar() {
2013-02-09 03:40:54 +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.backstar\*' --dry --justfolders --debugimap1 --regextrans2 's#\\|\*#_#g'
}
2015-12-03 18:16:32 +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 --regextrans2 's,\*,_,g'
}
2017-09-23 23:54:48 +02:00
ll_tr() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--dry --justfolders --regextrans2 'tr/a/_/'
}
ll_regextrans2_d() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--dry --justfolders --regextrans2 's,INBOX\.,,'
}
2015-08-04 03:44:40 +02:00
lks_trailing_space() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 ks.lamiral.info --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--justfolders --ssl1 --ssl2
}
lks_doublequote() {
2013-12-30 03:03:13 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 ks.lamiral.info --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder 'INBOX."uni"' --debugimap2 --nofoldersizes --justfolders --ssl1 --ssl2
}
2015-08-04 03:44:40 +02:00
lks_doublequote_rev() {
2013-12-30 03:03:13 +01:00
$CMD_PERL ./imapsync \
--host1 ks.lamiral.info --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--foldersizes --ssl1 --ssl2 --justfolders
}
2019-07-03 01:17:46 +02:00
ksks_password_doublequote() {
$CMD_PERL ./imapsync \
--host1 ks.lamiral.info --user1 test1 \
--password1 'secret1' \
--host2 ks.lamiral.info --user2 test1 \
--password2 '"secret1"' \
--debugimap --justlogin --showpasswords
}
2012-04-17 00:34:41 +02:00
2019-07-03 01:25:47 +02:00
ksks_empty_test1()
{
$CMD_PERL ./imapsync \
--host1 ks.lamiral.info --user1 test1 \
--password1 'secret1' \
--host2 ks.lamiral.info --user2 test1 \
--password2 'secret1' \
--delete1 --delete1emptyfolders
}
ksks_init_test1()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 ks.lamiral.info --user2 test1 \
--password2 'secret1' \
--folder INBOX.init --f1f2 INBOX.init=INBOX
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2019-07-03 01:25:47 +02:00
ksks_reset_test1()
{
ksks_empty_test1
ksks_init_test1
}
ksks_empty_test2() {
$CMD_PERL ./imapsync \
--host1 ks.lamiral.info --user1 test2 \
--password1 'secret2' \
--host2 ks.lamiral.info --user2 test2 \
--password2 'secret2' \
--delete1 --delete1emptyfolders
}
2012-04-17 00:34:41 +02:00
2011-03-12 03:45:04 +01:00
ll_folder_noexist() {
2015-05-28 19:04:57 +02:00
$CMD_PERL ./imapsync \
2011-03-12 03:45:04 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.noexist --folder INBOX.noexist2
}
2014-11-19 23:16:16 +01:00
ll_folder_mixfolders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--mixfolders --justfolders --nofoldersizes
}
2011-03-12 03:45:04 +01:00
# Way to check it each time:
2013-04-22 21:50:50 +02:00
# sh -x tests.sh ll_folder_create ll_delete2folders
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_folder_create() {
2011-03-12 03:45:04 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2019-07-03 01:25:47 +02:00
--folder INBOX.yop --regextrans2 's/yop/new.nested.yop/' \
2011-03-12 03:45:04 +01:00
--justfolders
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
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
}
2014-05-30 03:56:21 +02:00
ll_folder_create_backslash_backslash() {
$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.yip --regextrans2 's/yop/newyop/' \
--sep2 '\\' \
--justfolders --nofoldersizes --dry
2015-12-03 18:16:32 +01:00
}
ll_folder_domino() {
$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.yip --regextrans2 's/yop/newyop/' \
--sep2 '\' --prefix2 '' --prefix1 '' \
--regextrans2 's,^Inbox\\(.*),$1,i' \
--justfolders --dry --debug
}
ll_folder_domino_sub() {
$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.yip --regextrans2 's/yop/newyop/' \
--sep2 '\' --prefix2 '' \
--subfolder2 'OLDBOX' \
--justfolders --dry --debug
2014-05-30 03:56:21 +02:00
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
ll_domino2() {
$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.yip --regextrans2 's/yop/newyop/' \
--domino2 \
--subfolder2 'OLDBOX' \
--justfolders --dry --debug
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
ll_domino1_domino2() {
$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.yip --regextrans2 's/yop/newyop/' \
--domino1 --domino2 \
--subfolder2 'OLDBOX' \
--justfolders --dry
}
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
}
2015-05-28 19:04:57 +02:00
ll_pipemess() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2016-09-19 17:17:24 +02:00
--folder INBOX.few_emails --pipemess 'cat' --pipemess 'reformime -r7'
cmd_status=$?
2015-05-28 19:04:57 +02:00
echo "sudo rm -rf /home/vmail/titi/.few_emails/"
2016-09-19 17:17:24 +02:00
return $cmd_status
}
ll_pipemess_catcat() {
$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 --pipemess '(cat|cat)' --pipemess 'reformime -r7'
cmd_status=$?
echo "sudo rm -rf /home/vmail/titi/.few_emails/"
return $cmd_status
2015-05-28 19:04:57 +02:00
}
ll_pipemess_nocmd() {
! $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 --pipemess 'nocat'
echo "sudo rm -rf /home/vmail/titi/.few_emails/"
}
2016-09-19 17:15:41 +02:00
ll_pipemess_false() {
! $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 --pipemess '/bin/false' --nopipemesscheck
echo "sudo rm -rf /home/vmail/titi/.few_emails/"
}
ll_pipemess_true() {
! $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 --pipemess '/bin/true'
echo "sudo rm -rf /home/vmail/titi/.few_emails/"
}
2015-05-28 19:04:57 +02:00
2011-06-14 13:04:24 +02:00
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
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
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
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
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 \
2019-07-03 01:17:46 +02:00
--folder INBOX.addheader --delete2 --addheader
2012-04-17 00:28:48 +02:00
}
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 \
2014-11-19 23:08:41 +01:00
--justfolders --nofoldersizes --folder "INBOX. blanc_begin" --regextrans2 "s,(\.|^) +,\$1,g"
2013-09-27 00:00:32 +02:00
}
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
}
2015-12-03 18:16:32 +01:00
ll_automap() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justautomap --automap
}
2020-04-11 01:15:57 +02:00
ll_justautomap() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justautomap
}
2015-12-03 18:16:32 +01:00
l_ks_automap() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 test2.lamiral.info --user2 test2 \
--password2 secret2 \
--justautomap --automap
}
l_gmail_automap() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justautomap --automap --dry
}
gmail_l_automap() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justautomap --automap --dry
}
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 \
2015-12-03 18:16:32 +01:00
--justfolders
2013-12-30 03:03:13 +01:00
echo "sudo rm -rf /home/vmail/titi/.new_folder/"
}
2015-12-03 18:16:32 +01:00
2016-09-19 17:17:24 +02:00
ll_justfolders_delete1emptyfolders() {
./W/learn/create_folder localhost tata `cat /g/var/pass/secret.tata` INBOX.Empty INBOX.Empty.Empty INBOX.Empty.Empty.Empty
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--justfolders --delete1emptyfolders --include Empty --folder INBOX --folderfirst INBOX.Empty.Empty --foldersizes
2017-09-23 23:54:48 +02:00
}
2020-04-11 01:15:57 +02:00
2017-09-23 23:54:48 +02:00
ll_delete1_delete1emptyfolders() {
./W/learn/create_folder localhost tata `cat /g/var/pass/secret.tata` INBOX.Empty INBOX.Empty.Empty INBOX.Empty.Empty.Empty
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--delete1emptyfolders --delete1 --include Empty --folder INBOX --folderfirst INBOX.Empty.Empty --dry
2016-09-19 17:17:24 +02:00
}
2015-12-03 18:16:32 +01:00
2017-09-23 23:54:48 +02:00
2019-07-03 01:17:46 +02:00
ll_justfolders_skipemptyfolders() {
2014-11-19 23:16:16 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2019-07-03 01:17:46 +02:00
--justfolders --skipemptyfolders \
2020-04-11 01:15:57 +02:00
--folder INBOX.empty --folder INBOX.notempty
2014-11-19 23:16:16 +01:00
}
2019-07-03 01:17:46 +02:00
2015-05-28 19:04:57 +02:00
ll_justfolders_folderfirst_noexist() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes --justfolders --folderfirst noexist --debug
}
2014-11-19 23:16:16 +01:00
2020-04-11 01:15:57 +02:00
ll_justfolders_foldersizes()
{
2013-12-30 03:03:13 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders
echo "sudo rm -rf /home/vmail/titi/.new_folder/"
2011-03-12 03:44:08 +01:00
}
2011-03-12 03:45:02 +01:00
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_delete2foldersonly_dry()
{
2011-03-12 03:45:04 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
2019-07-03 01:25:47 +02:00
--subfolder2 NEW --delete2foldersonly NEW --dry
2011-03-12 03:45:04 +01:00
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_delete2foldersonly_subfolder2()
{
./W/learn/create_folder localhost titi `cat /g/var/pass/secret.titi` INBOX.NEW_2
2011-03-12 03:45:04 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
2019-07-03 01:25:47 +02:00
--subfolder2 NEW_2 \
2020-04-11 01:15:57 +02:00
--delete2foldersonly NEW_2 --folder INBOX --debug
# NEW_2 should be still there because of --subfolder2 NEW_2
test -d /home/vmail/titi/.NEW_2/ || return 1
2011-03-12 03:45:04 +01:00
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_delete2foldersbutnot()
{
2011-03-12 03:45:04 +01:00
$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
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_delete2foldersonly_NEW_3()
{
2013-09-26 23:59:52 +02:00
$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
2018-05-07 16:04:23 +02:00
}
2013-09-26 23:59:52 +02:00
2018-05-07 16:04:23 +02:00
ll_delete2foldersonly_bug() {
$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.Archive/' --dry
# --delete2foldersonly '/^INBOX.Archive$/' --dry
2013-09-26 23:59:52 +02:00
}
2011-03-12 03:45:04 +01:00
2020-04-11 01:15:57 +02:00
# In mandatory_tests
ll_delete2folders()
{
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 \
--justfolders --nofoldersizes \
--delete2folders
2013-09-26 23:59:52 +02:00
2020-04-11 01:15:57 +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 \
2019-07-03 01:17:46 +02:00
--nosyncinternaldates --delete2
2011-03-12 03:44:57 +01:00
}
# 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
}
2015-08-04 03:44:40 +02:00
ll_idatefromheader_barker() {
# can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.europe.secureserver.net --user2 test@alicebarkertest.com \
--passfile2 ../../var/pass/secret.barker \
--folder INBOX.oneemail2 --nofoldersizes \
--debug --useheader ALL
}
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
--host1 $HOST1 \
2017-09-23 23:54:48 +02:00
--host2 $HOST2 \
--justconnect
}
ll_justconnect_ipv6()
{
$CMD_PERL ./imapsync \
--host1 "::1" \
--host2 "::1" \
--justconnect
}
ll_justconnect_ipv6_nossl()
{
$CMD_PERL ./imapsync \
--host1 "::1" --nossl1 \
--host2 "::1" --nossl2 \
--justconnect
}
ks_justconnect_ipv6()
{
$CMD_PERL ./imapsync \
--host1 ks2ipv6.lamiral.info \
--host2 ks2ipv6.lamiral.info \
--justconnect
}
ks_justconnect_ipv6_nossl()
{
$CMD_PERL ./imapsync \
--host1 ks2ipv6.lamiral.info --nossl1 \
--host2 ks2ipv6.lamiral.info --nossl2 \
--justconnect
2011-03-12 03:44:20 +01:00
}
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02: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 \
2020-04-11 01:15:57 +02:00
--nocheckfoldersexist --nocheckselectable \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--justfoldersizes # --folder INBOX
2011-03-12 03:44:54 +01:00
}
2020-04-11 01:15:57 +02:00
ll_justfoldersizes_all_to_INBOX()
2014-05-30 03:56:21 +02:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
2020-04-11 01:15:57 +02:00
--nocheckfoldersexist --nocheckselectable \
2014-05-30 03:56:21 +02:00
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--justfoldersizes --regextrans2 's/.*/INBOX/'
2014-05-30 03:56:21 +02:00
}
2020-04-11 01:15:57 +02:00
ll_justfoldersizes_case_different()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nocheckfoldersexist --nocheckselectable \
--justfoldersizes --folder NoExist --folder INBOX --regextrans2 's,^INBOX$,iNbOx,'
}
ll_justfoldersizes_case_different_2()
2014-05-30 03:56:21 +02:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes --folder INBOX.yop --regextrans2 's,yop,YoP,'
}
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 \
2020-04-11 01:15:57 +02:00
--justfoldersizes --folder NoExist --folder AnotherNoExist \
--nocheckfoldersexist --errorsmax 2
2011-06-14 13:02:33 +02:00
}
2016-09-19 17:17:24 +02:00
ll_reconnect_on_signal_debugimap()
{
# in another terminal:
#
: <<'EOF'
while echo ENTER TO STOP; read a ; do
killall --signal STOP -v -u vmail imapd
echo ENTER to CONT; read a
killall --signal CONT -v -u vmail imapd
done
EOF
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--debugsleep 3.5 --debugimap
}
ll_reconnect_on_signal()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi
}
2011-06-14 13:02:33 +02:00
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
2016-09-19 17:17:24 +02:00
killall -v -u vmail imapd
2011-06-14 12:59:46 +02:00
done
EOF
$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 \
2016-09-19 17:17:24 +02:00
--reconnectretry2 0 --reconnectretry1 0
2011-06-14 12:59:46 +02:00
}
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 \
2016-09-19 17:17:24 +02:00
--delete2 --debugsleep 5 --debugimap
2011-06-14 13:02:33 +02:00
}
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
}
2019-07-03 01:25:47 +02:00
ll_maxage_0_float_1min()
{
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.0006944 --folder INBOX --noabletosearch
}
2019-07-03 01:17:46 +02:00
ll_minage_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 \
--minage 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()
{
$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
}
2020-04-11 01:15:57 +02:00
ll_search1_NOT_OR_OR_UID()
2015-12-03 18:16:32 +01:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2020-04-11 01:15:57 +02:00
--search1 'NOT OR OR UID 20000 UID 20002 UID 20004' --folder INBOX
}
2015-12-03 18:16:32 +01:00
2020-04-11 01:15:57 +02:00
ll_search1_OR_OR_UID()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search1 'OR OR UID 20000 UID 20002 UID 20004' --folder INBOX
2015-12-03 18:16:32 +01:00
}
2020-04-11 01:15:57 +02:00
ll_search2_NOT_OR_OR_UID()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search2 'NOT OR OR UID 20000 UID 20002 UID 20004' --folder INBOX
}
2011-07-11 23:24:12 +02:00
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
}
2017-09-23 23:54:48 +02:00
ll_search_HEADER_attachment()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search "OR HEADER Content-Disposition attachment HEADER Content-Type multipart/mixed" \
--folder INBOX
}
ll_search_HEADER_attachment_multipart()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search "HEADER Content-Type multipart/mixed" \
--folder INBOX
}
ll_search_NOT_SUBJECT()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search "NOT SUBJECT test:" \
--folder INBOX
}
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 \
2018-05-07 16:04:23 +02:00
--folder INBOX.few_emails --noabletosearch
2017-09-23 23:54:48 +02:00
# --debugdev --debugimap
}
ll_noabletosearch1()
{
$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 --noabletosearch1 --debugimap
}
ll_noabletosearch2()
{
$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 --noabletosearch2 --debugimap
2012-11-27 23:32:36 +01:00
}
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
}
2015-12-03 18:16:32 +01:00
ll_debugLIST()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --nofoldersizes \
--debugLIST
}
ll_search_UID()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --nofoldersizes \
--debugLIST --search1 "UID 10000:20000"
}
2012-04-17 00:31:15 +02:00
ll_exitwhenover()
{
2019-07-03 01:17:46 +02:00
sendtestmessage
sendtestmessage
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 \
--maxage 1 --folder INBOX --nofoldersizes \
2019-07-03 01:17:46 +02:00
--exitwhenover 100
2012-04-17 00:31:15 +02:00
}
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 \
2019-07-03 01:17:46 +02:00
--folder INBOX --noreleasecheck --usecache --delete2
2011-03-12 03:45:02 +01:00
}
2014-05-30 03:56:21 +02:00
ll_dry_folder_missing()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --dry --regextrans2 "s,^INBOX$,noexit,"
}
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
2015-05-28 19:04:57 +02:00
ll_maxlinelengthcmd()
{
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 --maxlinelengthcmd cat --nofoldersizes --folder INBOX
}
2014-02-13 18:34:20 +01:00
ll_minmaxlinelength()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--minmaxlinelength 1000 --nofoldersizes --folder INBOX
}
ll_maxlinelength_prepa_1()
{
$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 \
--folderrec INBOX.Junk --foldersizes --justfolders \
--usecache --tmpdir /var/tmp --minmaxlinelength 8000 --debugmaxlinelength
}
ll_maxlinelength_prepa_2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tete@est.belle \
--passfile1 ../../var/pass/secret.tete \
--host2 ks.lamiral.info --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--ssl2 \
--include INBOX.Junk.20 --foldersizes --nojustfolders \
--useuid --tmpdir /var/tmp --minmaxlinelength 10 --delete2 --nofastio1 --nofastio2
}
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
{
$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 \
2016-01-22 17:52:28 +01:00
--maxsize 10 --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()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2016-01-22 17:52:28 +01:00
--maxsize 10 --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 \
2016-01-22 17:52:28 +01:00
--folder INBOX \
2011-06-14 13:02:33 +02:00
--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
{
2016-01-22 17:52:28 +01: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-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
{
2016-01-22 17:52:28 +01: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-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
}
2015-05-28 19:04:57 +02:00
ll_include_include()
{
if can_send; then
#echo3 Here is plume
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes \
--include '^INBOX.yop' --include '^INBOX.'
}
ll_include_exclude()
{
if can_send; then
#echo3 Here is plume
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes \
--include '^INBOX.yop' --exclude '^INBOX.'
}
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
2015-12-03 18:16:32 +01:00
ll_f1f2_01()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
2016-01-22 17:52:28 +01:00
--folder 'INBOX.yop.yap' --f1f2 'INBOX.yop.yap=INBOX/rha/lovely' --f1f2 'lalala=lululu' --debugfolders
2015-12-03 18:16:32 +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 \
--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,/,_,'
}
2015-08-04 03:44:40 +02:00
ll_regextrans2_dot()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
--folder 'INBOX.yop.yap' \
--regextrans2 "s,\.,_,g" --dry
}
2019-07-03 01:25:47 +02:00
ll_subfolder2()
2011-03-12 03:45:04 +01:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2019-07-03 01:25:47 +02:00
--justfolders --foldersizesatend \
--subfolder2 SUB
2015-08-04 03:44:40 +02:00
}
2019-07-03 01:25:47 +02:00
ll_subfolder1()
2015-08-04 03:44:40 +02:00
{
2019-07-03 01:25:47 +02:00
# reverse of ll_subfolder2
2015-08-04 03:44:40 +02:00
$CMD_PERL ./imapsync \
2019-07-03 01:25:47 +02:00
--host1 $HOST2 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--justfolders \
--subfolder1 SUB --dry
2011-03-12 03:45:04 +01:00
}
2019-07-03 01:25:47 +02:00
ll_subfolder1_INBOX_SUB()
2015-08-04 03:44:40 +02:00
{
2019-07-03 01:25:47 +02:00
# reverse of ll_subfolder2
2015-08-04 03:44:40 +02:00
$CMD_PERL ./imapsync \
2019-07-03 01:25:47 +02:00
--host1 $HOST2 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--justfolders \
--subfolder1 INBOX.SUB --dry
}
ll_subfolder1_DOES_NOT_EXIST()
{
# --subfolder1 does not exist
! $CMD_PERL ./imapsync \
--host1 $HOST2 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--justfolders \
--subfolder1 DOES_NOT_EXIST --dry
2015-08-04 03:44:40 +02:00
}
ll_nochildren()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 w00d0310.kasserver.com --user2 m0331832 \
--passfile2 ../../var/pass/secret.kasserver \
2016-09-19 17:17:24 +02:00
--folderrec INBOX.A --subfolder2 inferior_top_level
2015-08-04 03:44:40 +02: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
2020-04-11 01:15:57 +02:00
ll_regextrans2_archive_per_year_flat_hard_year()
{
year=
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes \
--search "SENTSINCE 1-1-$year SENTBEFORE 30-12-2018" \
--sep2 _ --regextrans2 's{(.*)}{Archive_$1_2018}' --justfolders --dry
}
ll_regextrans2_archive_per_year_flat_variable_year()
{
year=2018
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes \
--search "SENTSINCE 1-1-$year SENTBEFORE 30-12-$year" \
--sep2 _ --regextrans2 's{(.*)}{Archive_$1_'"$year}" --justfolders --dry
}
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 \
--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 \
2013-12-30 03:03:13 +01:00
--host1 $HOST1 --user1 tata \
2011-03-12 03:44:47 +01:00
--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 \
2013-12-30 03:03:13 +01:00
--host1 badhost --user1 tata \
--passfile1 ../../var/pass/secret.tata \
2011-03-12 03:44:47 +01:00
--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' \
2019-07-03 01:17:46 +02:00
--debug --delete2
2011-03-12 03:45:04 +01:00
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:43:56 +01:00
2011-03-12 03:45:06 +01:00
2015-05-28 19:04:57 +02:00
ll_skipmess()
{
if can_send; then
#echo3 Here is plume
sendtestmessage tata
fi
2017-09-23 23:54:48 +02:00
sendtestmessage tata
2015-05-28 19:04:57 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2017-09-23 23:54:48 +02:00
--folder INBOX --nofoldersizes \
2015-05-28 19:04:57 +02:00
--skipmess 'm{.*}ism'
}
ll_skipmess_8bits()
{
if can_send; then
#echo3 Here is plume
SUBJ="`echo -e 'xFF:\0277'`"
sendtestmessage tata "$SUBJ"
fi
#return
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --nofoldersizes --noreleasecheck \
--skipmess 'm/[\x80-\xff]/'
}
ll_skipmess_Content_Type_Message_partial()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.partial --nofoldersizes --noreleasecheck \
--skipmess 'm{\A((?:[^\n]+\r\n)+|)^Content-Type: Message/Partial;[^\n]*\n(?:\r\n|.*\r\n\r\n)}ism' --dry --addheader
echo "sudo rm -rf /home/vmail/titi/.partial/cur/*"
# --skipmess 'm{\A((?:[^\n]+\n)+|)^Content-Type: Message/Partial;[^\n]*\n(?:\r?\n|.*\r?\n\r?\n)}ism' --dry --addheader
}
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' \
2015-05-28 19:04:57 +02: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
}
2017-09-23 23:54:48 +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'
}
2015-05-28 19:04:57 +02:00
ll_regexmess_trailing_NUL()
{
if can_send; then
rm -fv /home/vmail/titi/.NUL_char/cur/*
echo /home/vmail/tata/.NUL_char/cur/*
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.NUL_char \
--debugcontent \
--regexmess 's/(\x00)+\Z//g'
if can_send; then
file=`ls -t /home/vmail/titi/.NUL_char/cur/* | tail -1`
diff ../../var/imapsync/tests/ll_regexmess/dest_02_null_removed $file
#echo 'sudo rm -fv /home/vmail/titi/.NUL_char/cur/*'
fi
}
2020-04-11 01:15:57 +02:00
ll_regexmess_add_header()
2013-07-25 23:42:01 +02:00
{
2017-09-23 23:54:48 +02:00
if at_home; then
rm -f /home/vmail/titi/.yop.yap/cur/*
fi
$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 's/\A/X-migrated-from-foo: 20100617\n/' \
2020-04-11 01:15:57 +02:00
--search 'SUBJECT add_some_header_please' \
--debugcontent
2017-09-23 23:54:48 +02:00
2020-04-11 01:15:57 +02:00
if at_home; then
file=`ls -t /home/vmail/titi/.yop.yap/cur/* | tail -1`
diff W/t/07_ll_regexmess_add_header.txt $file || return 1
2017-09-23 23:54:48 +02:00
echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
2020-04-11 01:15:57 +02:00
fi
}
ll_regexmess_add_header_path()
{
if at_home; then
rm -fv "/home/vmail/titi/.yop.blanc blanc/cur/"*
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder "INBOX.yop.blanc blanc" \
--regexmess 's/\A/X-ImapSync-OriginalPath-$sync->{user1}: $sync->{ h1_current_folder }\n/' \
--search 'SUBJECT add_some_header_please' \
--debugcontent
if at_home; then
file=`ls -t "/home/vmail/titi/.yop.blanc blanc/cur/"* | tail -1`
diff W/t/08_ll_regexmess_add_header_path.txt "$file" || return 1
echo 'sudo rm -fv "/home/vmail/titi/.yop.blanc blanc/cur/"*'
fi
}
ll_regexmess_add_header_path_verif()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder "INBOX.yop.blanc blanc" \
--search1 'HEADER X-ImapSync-OriginalPath-tata ""' \
--debugcontent --dry --useuid --debugimap1
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder "INBOX.yop.blanc blanc" \
--search1 'HEADER X-ImapSync-OriginalPath-tata "INBOX.yop.blanc blanc"' \
--debugcontent --dry --useuid --debugimap1
2017-09-23 23:54:48 +02:00
}
2020-04-11 01:15:57 +02:00
2017-09-23 23:54:48 +02:00
ll_regexmess_change_header()
{
#
if at_home; then
rm -f /home/vmail/titi/.yop.yap/cur/*
fi
$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 's{\A(.*?(?! ^$))^Date:\ \(Invalid\)(.*?)$}{$1Date: Thu, 1 Jun 2017 23:59:59 +0000}xms' \
--search "HEADER Date Invalid" \
--debugcontent --dry
2013-07-25 23:42:01 +02:00
}
2019-07-03 01:25:47 +02:00
ll_regexmess_truncate_long_message_regex()
{
#
if at_home; then
rm -f /home/vmail/titi/.yop.yap/cur/*
fi
# Does not work
! $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 's/.{40000}\K.*//s' \
--debugcontent --minsize 100000
# Quantifier in {,} bigger than 32766 in regex; marked by <-- HERE in m/.{ <-- HERE 40000}
}
ll_regexmess_truncate_long_message_substr()
{
#
if at_home; then
rm -f /home/vmail/titi/.yop.yap/cur/*
fi
# Works well
$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 \
--pipemess 'perl -0ne "print substr \$_,0,40000" ' \
--debugcontent --minsize 100000
}
ll_regexmess_truncate_long_message_truncmess()
{
#
if at_home; then
rm -f /home/vmail/titi/.yop.yap/cur/*
fi
# Works well
$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 \
--truncmess 40000 \
--debugcontent --minsize 100000
}
2017-09-23 23:54:48 +02:00
ll_search_not_header() {
$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 \
--search "NOT HEADER Date Invalid" --debugcontent --dry
}
2013-07-25 23:42:01 +02:00
ll_regexmess_remove_header_Disposition()
{
2018-05-07 16:04:23 +02:00
#Disposition-Notification-To: Gilles LAMIRAL <gilles@lamiral.info>
2013-07-25 23:42:01 +02:00
$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/*'"
}
2014-05-30 03:56:21 +02:00
ll_disarmreadreceipts()
{
2018-05-07 16:04:23 +02:00
#Disposition-Notification-To: Gilles LAMIRAL <gilles@lamiral.info>
2014-05-30 03:56:21 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2015-05-28 19:04:57 +02:00
--folder INBOX.disarm \
2014-05-30 03:56:21 +02:00
--nofoldersizes \
--disarmreadreceipts \
2015-05-28 19:04:57 +02:00
--debugcontent --debug --dry
2016-09-19 17:17:24 +02:00
echo "sudo sh -c 'rm /home/vmail/titi/.disarm/cur/*'"
2014-05-30 03:56:21 +02:00
}
2013-07-25 23:42:01 +02:00
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 \
2018-05-07 16:04:23 +02:00
--debugflags
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
ll_resyncflags()
{
$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 --resyncflags | grep 'Host1: flags init msg' || return 1
2011-03-12 03:44:51 +01:00
2011-03-12 03:44:36 +01:00
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:29 +01:00
}
2019-07-03 01:17:46 +02:00
ll_syncflagsaftercopy()
{
# courier doesn't gives the flags just after an copy
$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 \
--debugflags --syncflagsaftercopy # | grep 'replacing h2 flags' || return 1
# | grep 'could not get its flags' || return 1
echo 'sudo rm /home/vmail/titi/.yop.yap/cur/*'
}
2018-05-07 16:04:23 +02:00
ll_noresyncflags()
{
$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 --noresyncflags | grep 'Host1: flags init msg' && return 1
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/*'
}
2020-04-11 01:15:57 +02:00
ll_regex_flag_remove()
{
$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 's/\\Indexed//gi' --debugflags
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/*'
}
2019-07-03 01:25:47 +02:00
2012-12-29 01:43:39 +01:00
ll_regex_flag6_add_SEEN()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
2017-09-23 23:54:48 +02:00
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX.flagsetSeen \
--debugflags --regexflag "s/(.*)/\$1 \\\\Seen/" --dry
2012-12-29 01:43:39 +01:00
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 \
2019-07-03 01:25:47 +02:00
--debugflags --regexflag 's,,\\Seen ,' --dry
# on windows --regexflag "s,,\\Seen ," --dry
2012-12-29 01:43:39 +01:00
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2017-09-23 23:54:48 +02:00
ll_regex_flag8_add_SEEN_if_not_here()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.flagsetSeen --nofoldersizes \
2019-07-03 01:25:47 +02:00
--debugflags --dry --regexflag 's,\\Seen,,' --regexflag 's,,\\Seen ,'
# On windows: --regexflag "s,((?!\\Seen).*),$1 \\Seen,"
}
ll_regex_flag8_add_SEEN_always()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.flagsetSeen --nofoldersizes \
--debugflags --dry --regexflag "s,,\\\\Seen ,"
2017-09-23 23:54:48 +02:00
}
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
}
2016-01-22 17:52:28 +01:00
ll_tls_justconnect_SSL_version() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--tls1 --tls2 \
--justconnect --debugimap --ssl1_SSL_version SSLv3 --ssl2_SSL_version SSLv2
}
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() {
2017-09-23 23:54:48 +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
}
2016-01-22 17:52:28 +01:00
ll_ssl_justconnect_SSL_version() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--ssl1 --ssl2 \
--justconnect --ssl1_SSL_version SSLv3 --ssl2_SSL_version SSLv2
}
ll_ssl_justconnect_sslargs() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--ssl1 --ssl2 \
2018-05-07 16:04:23 +02:00
--justconnect --sslargs1 SSL_version=SSLv23 --sslargs1 SSL_verify_mode=0
}
ll_ssl_justconnect_sslargs_SSL_verify_mode1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--ssl1 --ssl2 \
--justconnect --sslargs1 SSL_version=SSLv23 --sslargs1 SSL_verify_mode=1
2016-01-22 17:52:28 +01:00
}
2018-05-07 16:04:23 +02:00
ll_ssl_justconnect_sslargs_SSL_versionTLSv1_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--tls1 \
--justconnect --sslargs1 SSL_version=TLSv1_1 --sslargs1 SSL_verify_mode=0 --debugssl 4
}
2016-01-22 17:52:28 +01:00
2014-05-30 03:56:21 +02:00
ll_ssl1_tls2_justconnect() {
2013-07-06 00:26:28 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
2014-05-30 03:56:21 +02:00
--ssl1 --tls2 \
--justconnect --debugimap
}
ll_tls1_ssl2_justconnect() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--tls1 --ssl2 \
--justconnect --debugimap
}
ll_ssl1_tls1_justconnect() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--ssl1 --tls1 \
2013-07-06 00:26:28 +02:00
--justconnect --debugimap
}
2016-09-19 17:17:24 +02:00
ll_ssl_justconnect_SSL_VERIFY_PEER() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--ssl1 \
--justconnect \
--host2 imap.gmail.com \
--ssl2 \
--sslargs2 SSL_verify_mode=1
#--sslargs2 SSL_ca_file=/etc/ssl/certs/ca-certificates.crt
}
2013-07-06 00:26:28 +02:00
2014-05-30 03:56:21 +02:00
2013-07-06 00:26:28 +02:00
ll_justconnect_devel() {
2014-05-30 03:56:21 +02:00
ll_justconnect && ll_tls_justconnect && ll_ssl_justconnect && ll_ssl1_tls2_justconnect && ll_tls1_ssl2_justconnect && ! ll_ssl1_tls1_justconnect
2013-07-06 00:26:28 +02:00
}
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
}
2016-01-22 17:52:28 +01:00
ll_ssl_justlogin_SSL_version() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--ssl1 --ssl2 \
2018-05-07 16:04:23 +02:00
--justlogin --ssl1_SSL_version SSLv23 --ssl2_SSL_version SSLv23 --debugssl 4
2016-01-22 17:52:28 +01:00
}
ll_ssl_justlogin_sslargs() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--ssl1 --ssl2 \
--sslargs1 SSL_version=SSLv3 --sslargs1 SSL_verify_mode=1
}
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() {
2014-05-30 03:56:21 +02:00
ll_justlogin && ll_ssl_justlogin && ll_tls_justlogin && ! ll_ssl_tls_justlogin
2013-07-06 00:26:28 +02:00
}
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
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
}
2011-03-12 03:44:47 +01:00
2013-05-21 00:04:57 +02:00
ll_authmech_XOAUTH_gmail() {
2017-09-23 23:54:48 +02:00
! ping -c2 imap.gmail.com || $CMD_PERL ./imapsync \
2013-05-21 00:04:57 +02:00
--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
}
2016-01-22 17:52:28 +01:00
ll_authmech_xoauth_gmail() { ll_authmech_XOAUTH_gmail; }
2015-12-03 18:16:32 +01:00
ll_authmech_XOAUTH2_gmail() {
2016-09-19 17:17:24 +02:00
! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \
2015-12-03 18:16:32 +01:00
--host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.xoauth2 \
--host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.xoauth2 \
2016-01-22 17:52:28 +01:00
--justlogin \
2016-09-19 17:17:24 +02:00
--authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug | grep unauthorized_client ; }
2015-12-03 18:16:32 +01:00
}
2016-01-22 17:52:28 +01:00
ll_authmech_xoauth2_gmail() { ll_authmech_XOAUTH2_gmail; }
2016-09-19 17:17:24 +02:00
ll_authmech_XOAUTH2_json_gmail() {
! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
--password1 ../../var/pass/secret.xoauth2.json \
--host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
--password2 ../../var/pass/secret.xoauth2.json \
--justlogin \
--authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug | grep unauthorized_client ; }
}
ll_authmech_xoauth2_json_gmail() { ll_authmech_XOAUTH2_json_gmail; }
2020-04-11 01:15:57 +02:00
ll_authmech_XOAUTH2_json_gmail_app() {
! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
--password1 ../../var/pass/secret.xoauth2.json \
--host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
--password2 ../../var/pass/secret.xoauth2.json \
--justlogin \
--authmech1 XOAUTH2 --authmech2 XOAUTH2 --debugimap ; }
}
ll_authmech_xoauth2_json_gmail_app() { ll_authmech_XOAUTH2_json_gmail_app; }
2016-09-19 17:17:24 +02:00
2016-01-22 17:52:28 +01:00
ll_authmech_XOAUTH2_gmail_proxy() {
! ping -c1 imap.gmail.com || https_proxy=http://localhost:8080/ $CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.xoauth2 \
--host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.xoauth2 \
--justlogin \
--authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug
}
ll_authmech_xoauth2_gmail_proxy() { ll_authmech_XOAUTH2_gmail_proxy; }
2015-12-03 18:16:32 +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
}
2019-07-03 01:17:46 +02:00
ll_authmech_X_MASTERAUTH()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--authmech1 'X-MASTERAUTH' # --debugimap1
}
2011-03-12 03:45:04 +01:00
2019-07-03 01:17:46 +02:00
ll_authuser()
{
$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
}
2019-07-03 01:17:46 +02:00
ll_authuser_2()
{
$CMD_PERL ./imapsync \
2011-04-24 23:19:36 +02:00
--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
}
2019-07-03 01:17:46 +02:00
ll_delete1() {
# Sync done
test -f /home/vmail/tata/.oneemail3/cur/* || return 1
#test -f /home/vmail/titi/.oneemail3/cur/* || return 1
echo 11111111111111111111111 tata titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.oneemail3 --delete1
#find /home/vmail/titi/.oneemail3/ || :
echo After first sync, tata has none, titi has one message
! test -f /home/vmail/tata/.oneemail3/cur/* || return 1
test -f /home/vmail/titi/.oneemail3/cur/* || return 1
echo 222222222222222222222222 back: titi tata
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX.oneemail3 --delete1
test -f /home/vmail/tata/.oneemail3/cur/* || return 1
! test -f /home/vmail/titi/.oneemail3/cur/* || return 1
echo 3333333333333333333333333 initial state
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.oneemail3
#find /home/vmail/titi/.oneemail3/ || :
echo ll_delete1 finished
}
ll_delete1_twoemails()
{
# initial
ls /home/vmail/tata/.twoemails/cur/* || return 1
echo 11111111111111111111111 tata titi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.twoemails --delete1
#find /home/vmail/titi/.twoemails/ || :
echo After first sync, tata has none, titi has two messages
! ls /home/vmail/tata/.twoemails/cur/* || return 1
ls /home/vmail/titi/.twoemails/cur/* || return 1
echo 222222222222222222222222 back: titi tata
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX.twoemails --delete1
ls /home/vmail/tata/.twoemails/cur/* || return 1
! ls /home/vmail/titi/.twoemails/cur/* || return 1
echo 3333333333333333333333333 initial state
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.twoemails
#find /home/vmail/titi/.twoemails/ || :
echo ll_delete1_twoemails finished
}
ll_delete1_delete2() {
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--delete1 --delete2
}
2011-03-12 03:44:29 +01:00
ll_delete2() {
2015-05-28 19:04:57 +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 \
2019-07-03 01:17:46 +02:00
--delete2
2012-09-12 03:50:53 +02:00
}
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 \
2019-07-03 01:17:46 +02:00
--delete2
2011-03-12 03:44:29 +01:00
}
2013-12-30 03:03:13 +01:00
2017-09-23 23:54:48 +02:00
ll_delete1_reverse() {
2019-07-03 01:17:46 +02:00
ll_INBOX
2012-09-12 03:50:53 +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 \
2019-07-03 01:17:46 +02:00
--delete1 --minage 600 --maxage 999 # --dry
2012-09-12 03:50:53 +02:00
}
2017-09-23 23:54:48 +02:00
ll_delete1_reverse_useuid() {
2019-07-03 01:17:46 +02:00
ll_INBOX
2014-02-13 18:34:20 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX \
2019-07-03 01:17:46 +02:00
--delete1 --minage 100 --maxage 600 \
2014-02-13 18:34:20 +01:00
--useuid
}
2019-07-03 01:17:46 +02:00
2016-09-19 17:17:24 +02:00
ll_delself() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 delme \
--passfile2 ../../var/pass/secret.delme
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 delme \
--passfile1 ../../var/pass/secret.delme \
--host2 $HOST2 --user2 delme \
--passfile2 ../../var/pass/secret.delme \
2017-09-23 23:54:48 +02:00
--delete1 --noexpungeaftereach
2016-09-19 17:17:24 +02:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 delme \
--passfile1 ../../var/pass/secret.delme \
--host2 $HOST2 --user2 delme \
--passfile2 ../../var/pass/secret.delme \
--justfolders --delete2folders --regextrans2 "s/.*/INBOX/" --foldersizes
2014-02-13 18:34:20 +01:00
2013-12-30 03:03:13 +01:00
$CMD_PERL ./imapsync \
2019-07-03 01:17:46 +02:00
--host1 $HOST1 --user1 delme \
--passfile1 ../../var/pass/secret.delme \
--host2 $HOST2 --user2 delme \
--passfile2 ../../var/pass/secret.delme \
--justfoldersizes
2017-09-23 23:54:48 +02:00
2013-12-30 03:03:13 +01:00
}
2012-09-12 03:50:53 +02:00
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 \
2019-07-03 01:17:46 +02:00
--delete2 --minage 1
2011-06-14 13:04:24 +02:00
}
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
2013-12-30 03:03:13 +01:00
ll_duplicates_across_folders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.zz_1 \
--folder INBOX.zz_2 \
--folder INBOX.zz_3 \
--skipcrossduplicates --debugcrossduplicates
}
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
}
2019-07-03 01:17:46 +02:00
ll_maxmessagespersecond() {
2020-04-11 01:15:57 +02:00
ll_delete1_reverse
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 \
2019-07-03 01:17:46 +02:00
--folder INBOX \
2020-04-11 01:15:57 +02:00
--maxmessagespersecond 3.3
2019-07-03 01:17:46 +02:00
}
2012-04-17 00:31:15 +02:00
2019-07-03 01:17:46 +02:00
ll_maxbytespersecond() {
2020-04-11 01:15:57 +02:00
ll_delete1_reverse
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
2019-07-03 01:17:46 +02:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
2020-04-11 01:15:57 +02:00
--maxbytespersecond 2000 --nofoldersizes
2019-07-03 01:17:46 +02:00
}
2012-04-17 00:31:15 +02:00
2019-07-03 01:17:46 +02:00
ll_maxbytesafter() {
2020-04-11 01:15:57 +02:00
ll_delete1_reverse
2012-04-17 00:31:15 +02:00
$CMD_PERL ./imapsync \
2019-07-03 01:17:46 +02:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
2020-04-11 01:15:57 +02:00
--maxbytespersecond 1000 --maxbytesafter 20000 --nofoldersizes
2011-03-12 03:44:51 +01:00
}
2012-04-17 00:31:15 +02:00
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 \
2016-09-19 17:17:24 +02:00
--folder INBOX.bigmail --debugmemory --nofoldersizes
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/*"'
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2018-05-07 16:04:23 +02:00
memory_stress() {
free
$CMD_PERL ./imapsync --testsunit tests_memory_stress && free
}
2012-04-17 00:27:13 +02:00
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
}
2015-08-04 03:44:40 +02:00
ll_change_characters_doublequotes() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --dry --nofoldersizes \
--regextrans2 's,\",_,g'
}
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'
}
2013-12-30 03:03:13 +01:00
ll_blanc_vs_hyphen_gmail() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder "INBOX.A-B" --folder "INBOX.A B" --folder "INBOX.A.B" --justfolders
}
2019-07-03 01:25:47 +02:00
# Gmail tests
# A big mess!
2013-09-27 00:00:32 +02:00
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
2015-12-03 18:16:32 +01:00
xxxxx_gmail_02() {
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 \
--nofoldersizes \
--regextrans2 's,(.*),SMS,'
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_03() {
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 \
--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
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_03_Received() {
2012-12-29 01:43:39 +01: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 \
--nofoldersizes \
--folder INBOX.few_emails --debug --useheader Received --delete2 --dry
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_04_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 \
2014-11-19 23:16:16 +01:00
--regextrans2 's{Sent}{[Gmail]/Messages envoy&AOk-s}' \
--debugflags
2012-04-17 00:31:15 +02:00
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_05_justfolders() {
2012-04-17 00:31:15 +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 \
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
2015-12-03 18:16:32 +01:00
xxxxx_gmail_05_justlogin() {
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 \
--justlogin
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_05_justlogin_exe() {
2014-05-30 03:56:21 +02:00
! ping -c1 imap.gmail.com || ./imapsync_elf_x86.bin \
--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
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_05_justlogin_SSLv3() {
2014-05-30 03:56:21 +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 \
--justlogin --ssl2_SSL_version SSLv3 --justconnect
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_05_justlogin_SSLv2() {
2014-05-30 03:56:21 +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 \
--justlogin --ssl2_SSL_version SSLv2
}
2015-12-03 18:16:32 +01:00
xxxxx_gmail_05_justlogin_SSLv23() {
2014-05-30 03:56:21 +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 \
--justlogin --ssl2_SSL_version SSLv23
}
2019-07-03 01:25:47 +02:00
xxxxx_gmail_trailing_blanks() {
2012-04-17 00:31:15 +02:00
! 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 \
2019-07-03 01:25:47 +02:00
--nofoldersizes \
--justfolders \
--include "[ ]" \
--regextrans2 's,^ +| +$,,g' --regextrans2 's,/ +| +/,/,g'
}
2012-04-17 00:31:15 +02:00
2019-07-03 01:25:47 +02:00
xxxxx_gmail_trailing_blanks_gmail2() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--justfolders \
--include "[ ]" \
--gmail2 --dry
2012-04-17 00:31:15 +02:00
}
2019-07-03 01:25:47 +02:00
xxxxx_gmail_delete2folders() {
2012-04-17 00:34:41 +02:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
2019-07-03 01:25:47 +02:00
--nofoldersizes \
--justfolders \
--include "[ ]" \
--gmail2 --delete2foldersonly "m, ," --delete2foldersbutnot 'm,Gmail,'
2012-04-17 00:34:41 +02:00
}
2011-04-24 23:19:36 +02:00
2019-07-03 01:25:47 +02:00
xxxxx_gmail_07_hierarchy() {
2015-12-03 18:16:32 +01: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 \
--nofoldersizes \
2019-07-03 01:25:47 +02:00
--folder INBOX.yop.yup.yip.yap.yep --justfolders
2015-12-03 18:16:32 +01:00
}
2019-07-03 01:25:47 +02:00
xxxxx_gmail_07_subfolder() {
2012-11-27 23:32:36 +01: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 \
2019-07-03 01:25:47 +02:00
--nofoldersizes \
--justfolders --subfolder2 BBB
2012-11-27 23:32:36 +01:00
}
2019-07-03 01:25:47 +02:00
2015-12-03 18:16:32 +01:00
xxxxx_gmail_09_via_stunnel() {
2014-11-19 23:08:41 +01:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 localhost \
--port2 9993 \
--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 \
2015-12-03 18:16:32 +01:00
--dry --justfolders --exclude "\[Gmail\]/All Mail"
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 \
2013-12-30 03:03:13 +01:00
--exclude Gmail --exclude "blanc\ $"
2011-03-12 03:44:43 +01:00
}
2011-03-12 03:44:40 +01:00
2013-12-30 03:03:13 +01:00
gmail_l_tata() {
! 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 \
--folder INBOX
}
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 \
2013-12-30 03:03:13 +01:00
--justfolders --exclude Gmail --exclude "blanc\ $"
2011-09-25 22:31:48 +02:00
}
2015-12-03 18:16:32 +01:00
gmail_justfolders_remove_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 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--regextrans2 "s,\[Gmail\].,," --dry --justfolders
}
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
}
2017-09-23 23:54:48 +02:00
easygmail_gmail1_gmail2() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--gmail1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--gmail2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justfolders
}
easygmail_gmail2() {
$CMD_PERL ./imapsync \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host1 imap.gmail.com --ssl1 \
--gmail2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justfolders
}
2011-03-12 03:44:47 +01:00
2017-09-23 23:54:48 +02:00
gmail_gmail() {
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 \
2013-12-30 03:03:13 +01:00
--justfolders --exclude Gmail --exclude "blanc\ $"
2015-12-03 18:16:32 +01:00
}
gmail_gmail_ipv6() {
! ping6 -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 2a00:1450:400c:c0a::6c \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 wl-in-x6c.1e100.net. \
--ssl2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justlogin
}
2019-07-03 01:17:46 +02:00
2015-12-03 18:16:32 +01:00
gmail_gmail_automap() {
$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 \
--justfolders --dry --automap --justautomap --f1f2 Junk=Junk --f1f2 Trash=Cake
}
gmail_gmail_noautomap() {
2013-12-30 03:03:13 +01:00
2015-12-03 18:16:32 +01:00
$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 \
--justfolders --dry --noautomap
2013-12-30 03:03:13 +01:00
}
2015-12-03 18:16:32 +01:00
2014-05-30 03:56:21 +02:00
gmail_gmail_justconnect() {
! 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 \
2016-01-22 17:52:28 +01:00
--justconnect --timeout 1
2015-12-03 18:16:32 +01:00
}
gmail_gmail_justlogin() {
2014-05-30 03:56:21 +02:00
2015-12-03 18:16:32 +01: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 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2016-09-19 17:17:24 +02:00
--justlogin --id --debugimap
2014-05-30 03:56:21 +02:00
}
2015-12-03 18:16:32 +01:00
2019-07-03 01:17:46 +02:00
gmail_gl_gl2_justfolders() {
2013-12-30 03:03:13 +01:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justfolders --exclude Gmail --exclude "blanc\ $" --dry
}
2019-07-03 01:25:47 +02:00
2019-07-03 01:17:46 +02:00
gmail_gl_gl2() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--folder INBOX --dry
}
2014-05-30 03:56:21 +02:00
gmail_gl_gl2_SUB() {
! 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 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justfolders --nofoldersizes --exclude Gmail --regextrans2 "s,(.*),SUB/\$1,"
}
2019-07-03 01:17:46 +02:00
gmail_gl2_gl2_selectable()
{
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl2@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl2_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--dry --justautomap
}
2014-05-30 03:56:21 +02:00
2013-12-30 03:03:13 +01:00
gmail_gl_gl2_create_folder_old() {
! 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 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justfolders --exclude Gmail --exclude "blanc\ $" \
--create_folder_old --dry --nofoldersizes
}
gmail_gmail_folderfirst() {
! 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 \
--exclude "blanc\ $" --exclude Gmail \
2015-05-28 19:04:57 +02:00
--justfolders --folderfirst INBOX --folderfirst zz --folderlast "[Gmail]/All Mail" --debug
2011-03-12 03:44:43 +01:00
}
2012-07-21 04:18:22 +02:00
2013-12-30 03:03:13 +01:00
gmail_gmail_INBOX() {
2019-07-03 01:17:46 +02:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:43 +01:00
--host1 imap.gmail.com \
--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 \
--user2 imapsync.gl@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2019-07-03 01:17:46 +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 \
2017-09-23 23:54:48 +02:00
--folder '[Gmail]/All Mail' --delete1
2012-07-21 04:18:22 +02:00
# '[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() {
2016-01-22 17:52:28 +01:00
! ping -c1 imap.gmail.com || ! $CMD_PERL ./imapsync \
2012-07-21 04:18:22 +02:00
--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\]$"
2016-01-22 17:52:28 +01:00
}
gmail_gmail_6_search() {
2017-09-23 23:54:48 +02:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--gmail1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--gmail2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--folder INBOX --search 'X-GM-RAW "has:attachment"'
}
2016-01-22 17:52:28 +01:00
2017-09-23 23:54:48 +02:00
gmail_gmail_7_search() {
2016-01-22 17:52:28 +01:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2017-09-23 23:54:48 +02:00
--folder "[Gmail]/All Mail" --search 'X-GM-RAW "Analysez lalala performances"'
2016-01-22 17:52:28 +01:00
}
2019-07-03 01:17:46 +02:00
gmail_gmail_8_search() {
2017-09-23 23:54:48 +02:00
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--gmail1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--gmail2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2019-07-03 01:17:46 +02:00
--folder Test --nofoldersizes --debugimap \
2017-09-23 23:54:48 +02:00
--search 'X-GM-RAW "label:Important label:Test"'
2019-07-03 01:17:46 +02:00
2017-09-23 23:54:48 +02:00
}
2019-07-03 01:17:46 +02:00
gmail_gmail_9_search_X_GM_LABELS() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--gmail1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--gmail2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--folder Test --nofoldersizes --debugimap \
--search 'X-GM-LABELS "Important"'
}
2017-09-23 23:54:48 +02:00
2013-04-22 21:50:50 +02:00
2017-09-23 23:54:48 +02:00
2019-07-03 01:17:46 +02:00
gmail_gl_gl2_sslargs()
{
$CMD_PERL ./imapsync \
2016-01-22 17:52:28 +01:00
--host1 imap.gmail.com \
--ssl1 \
--user1 imapsync.gl@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl_gmail \
--host2 imap.gmail.com \
--ssl2 \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justlogin --sslargs1 SSL_version=SSLv3 --sslargs1 SSL_verify_mode=0
2013-04-22 21:50:50 +02:00
}
2019-07-03 01:25:47 +02:00
# imapsync.gl@gmail.com
# imapsync.gl0@gmail.com == Source only account for imapsync
# imapsync.gl1@gmail.com == Source account for imapsync.gl2@gmail.com with
# --subfolder2 "Archive/Bob"
# --subfolder2 "Archive/Zuz"
# Destination account from imapsync.gl3@gmail.com with
# --subfolder1 "Archive/Bob"
# imapsync.gl2@gmail.com == Destination account --subfolder2 "Archive/Bob" from imapsync.gl1@gmail.com
# --subfolder2 "Archive/Zuz" from imapsync.gl1@gmail.com
# imapsync.gl3@gmail.com ==
sendtestmessage_gl0()
{
sendtestmessage imapsync.gl0@gmail.com
}
2019-07-03 01:17:46 +02:00
sendtestmessage_gl1()
{
sendtestmessage imapsync.gl1@gmail.com
}
gmail_gl1_gl2_labels()
{
#sendtestmessage imapsync.gl1@gmail.com
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl1@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
2019-07-03 01:25:47 +02:00
--exclude "\[Gmail\]" \
--synclabels --resynclabels --debuglabels --dry
}
gmail_gl1_gl2_labels_subfolder2()
{
#sendtestmessage imapsync.gl1@gmail.com
# The backup
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl1@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--synclabels --resynclabels --debuglabels --delete2\
--subfolder2 "Archive/Bob" --nofoldersizes --gmail1 --gmail2 --dry # --exclude "\[Gmail\]"
return
#sendtestmessage imapsync.gl1@gmail.com
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl1@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--gmail1 --gmail2 --synclabels --resynclabels --delete2 --folder INBOX --subfolder2 "Archive/Zuz"
}
gmail_gl2_gl3_labels_after_a_subfolder2_from_host1()
{
# A second backup, standard this one (no --subfolder2)
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl2@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl2_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl3@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl3_gmail \
--synclabels --resynclabels --folderrec "Archive/Bob" --gmail1 --gmail2 --dry
}
gmail_gl3_gl1_labels_subfolder1()
{
# The restoration process
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl3@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl3_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl1@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl1_gmail \
--subfolder1 "Archive/Bob" --debuglabels --resynclabels --nofoldersizes --justfolders #--dry
}
gmail_deuscustoms()
{
$CMD_PERL ./imapsync \
--host1 imap.gmail.com --user1 "test1@deuscustoms.com" --passfile1 '../../var/pass/test1@deuscustoms.com' \
--host2 imap.gmail.com --user2 "test2@deuscustoms.com" --passfile2 '../../var/pass/test2@deuscustoms.com' \
--subfolder2 "Archived accounts/Test User 1" \
--exclude "\[Gmail\]" --folderlast INBOX \
--debuglabels --resynclabels --synclabels --nofoldersizes #--dry
2019-07-03 01:17:46 +02:00
}
gmail_gl1_gl2_appendlimit()
{
#sendtestmessage imapsync.gl1@gmail.com
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl1@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--gmail1 --gmail2 --nofoldersizes --justlogin
}
2013-04-22 21:50:50 +02:00
2016-01-22 17:52:28 +01:00
2019-07-03 01:17:46 +02:00
gmail_gl1_gl2_maxsize_over_appendlimit()
{
#sendtestmessage imapsync.gl1@gmail.com
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--user1 imapsync.gl1@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
--host2 imap.gmail.com \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--gmail1 --gmail2 --nofoldersizes \
--justlogin --maxsize 999_999_999_999
}
gmail_gl2_gl2_move_All_Mail_Trash()
{
#sendtestmessage imapsync.gl1@gmail.com
$CMD_PERL ./imapsync \
--user1 imapsync.gl2@gmail.com \
--passfile1 ../../var/pass/secret.imapsync.gl2_gmail \
--user2 imapsync.gl2@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
--gmail1 --gmail2 \
--folder '[Gmail]/Tous les messages' \
--f1f2 '[Gmail]/Tous les messages=[Gmail]/Corbeille'
}
yahoo_xxxx_login()
{
2011-09-25 22:31:48 +02:00
! 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
}
2015-12-03 18:16:32 +01:00
yahoo_xxxx_login_tls() {
2017-09-23 23:54:48 +02:00
# tls1 no longer works on Yahoo
2015-12-03 18:16:32 +01:00
! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com \
2017-09-23 23:54:48 +02:00
--tls1 --timeout1 5 \
2015-12-03 18:16:32 +01:00
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin
}
2011-09-25 22:31:48 +02:00
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 \
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
2018-05-07 16:04:23 +02:00
--passfile2 ../../var/pass/secret.titi \
--addheader --exclude Archive
}
yahoo_fail_UNAVAILABLE() {
# Those are messages from yahoo:
# Err 1/11: - msg Archive/470002 {0} S[12903] F[$NotJunk] I[25-Oct-2016 00:19:28 +0000] could not be fetched: 29 NO [UNAVAILABLE] UID FETCH Server error while fetching messages
# Update 2018/5/5: it now works well on those messages
! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com \
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
--passfile2 ../../var/pass/secret.titi \
--addheader --folder Archive
2011-09-25 22:31:48 +02:00
}
2017-09-23 23:54:48 +02:00
yahoo_all() {
! yahoo_xxxx_login_tls || return 1
yahoo_xxxx_login || return 1
yahoo_xxxx || return 1
2018-05-07 16:04:23 +02:00
yahoo_fail_UNAVAILABLE || return 1
2017-09-23 23:54:48 +02:00
}
2011-09-25 22:31:48 +02:00
2018-05-07 16:04:23 +02: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
}
2017-09-23 23:54:48 +02:00
ll_justlogin_notls() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin --notls1 --notls2
}
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
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
}
2017-09-23 23:54:48 +02:00
ll_usecache_all() {
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 \
--usecache --nofoldersizes
}
2014-11-19 23:16:16 +01:00
ll_usecache_bracket() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes --debugcache --folder "INBOX.[bracket]"
}
2011-07-11 23:24:12 +02:00
2020-04-11 01:15:57 +02:00
# In mandatory_tests
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 \
2016-09-19 17:17:24 +02:00
--usecache \
2012-11-27 23:32:36 +01:00
--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
2019-07-03 01:25:47 +02:00
2012-11-27 23:32:36 +01:00
}
2011-03-12 03:45:06 +01:00
2020-04-11 01:15:57 +02:00
# In mandatory_tests
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
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
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
2013-12-30 03:03:13 +01:00
l_office365()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
2019-07-03 01:17:46 +02:00
--folder INBOX --tmpdir /var/tmp --usecache --regextrans2 's/INBOX/tata/' --delete2
2013-12-30 03:03:13 +01:00
}
2019-07-03 01:17:46 +02:00
l_office365_deleted_flag()
2017-09-23 23:54:48 +02:00
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
2019-07-03 01:17:46 +02:00
--folder INBOX.flags --tmpdir /var/tmp --regextrans2 's/INBOX/tata/' --debugflags
2017-09-23 23:54:48 +02:00
}
2019-07-03 01:17:46 +02:00
l_office365_flagged_flag()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--office2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--folder INBOX.flags --tmpdir /var/tmp --regextrans2 's/INBOX/tata/' --debugflags
}
l_office365_noregexmess()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--office2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justbanner --noregexmess
}
l_exchange2_flagged_flag()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 outlook.office365.com \
--exchange2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--regextrans2 's/INBOX/tata/' --nofoldersizes \
--folder INBOX.flags --debugflags
}
l_exchange2_flagged_noregexflag()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 outlook.office365.com \
--exchange2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--regextrans2 's/INBOX/tata/' --nofoldersizes \
--folder INBOX.flags --debugflags --noregexflag
}
l_exchange2_noregexmess_noregexflag()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 outlook.office365.com \
--exchange2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justbanner --noregexmess --noregexflag
}
2017-09-23 23:54:48 +02:00
2016-09-19 17:17:24 +02:00
l_office365_SSL_verify_mode()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justlogin --sslargs2 SSL_verify_mode=1
}
2017-09-23 23:54:48 +02:00
office1_office2()
{
$CMD_PERL ./imapsync \
--office1 \
--user1 gilles.lamiral@outlook.com \
--passfile1 ../../var/pass/secret.outlook.com \
--office2 \
--user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justfolders
}
2019-07-03 01:17:46 +02:00
office1_office2_noexclude()
{
$CMD_PERL ./imapsync \
--office1 \
--user1 gilles.lamiral@outlook.com \
--passfile1 ../../var/pass/secret.outlook.com \
--office2 \
--user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justfolders --noexclude
}
2017-09-23 23:54:48 +02:00
office365_justconnect_tls_SSL_verify_mode_1()
2016-09-19 17:17:24 +02:00
{
$CMD_PERL ./imapsync \
--host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
--passfile1 ../../var/pass/secret.outlook.com \
--host2 outlook.office365.com --tls2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justconnect --sslargs2 SSL_verify_mode=1
}
2017-09-23 23:54:48 +02:00
office365_justlogin_ssl1_ssl2()
2015-05-28 19:04:57 +02:00
{
$CMD_PERL ./imapsync \
2015-12-03 18:16:32 +01:00
--host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
2015-05-28 19:04:57 +02:00
--passfile1 ../../var/pass/secret.outlook.com \
--host2 imap.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justlogin
}
2017-09-23 23:54:48 +02:00
office365_justlogin_tls()
2015-08-04 03:44:40 +02:00
{
$CMD_PERL ./imapsync \
2015-12-03 18:16:32 +01:00
--host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
2015-08-04 03:44:40 +02:00
--passfile1 ../../var/pass/secret.outlook.com \
2017-09-23 23:54:48 +02:00
--host2 imap.outlook.com --tls2 --user2 gilles.lamiral@outlook.com \
2015-08-04 03:44:40 +02:00
--passfile2 ../../var/pass/secret.outlook.com \
--justlogin
}
2016-09-19 17:17:24 +02:00
2019-07-03 01:17:46 +02:00
office365_justlogin_tls2_office365()
2017-09-23 23:54:48 +02:00
{
$CMD_PERL ./imapsync \
--host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
--passfile1 ../../var/pass/secret.outlook.com \
--host2 outlook.office365.com --tls2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
2019-07-03 01:17:46 +02:00
--justlogin --ssl2
}
office365_justlogin_ssl2_tls2_office365()
{
# Should produce "BAD Command received in Invalid state."
! $CMD_PERL ./imapsync \
--host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
--passfile1 ../../var/pass/secret.outlook.com \
--host2 outlook.office365.com --tls2 --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
2017-09-23 23:54:48 +02:00
--justlogin
}
2019-07-03 01:17:46 +02:00
office365_justlogin_nossl2_notls2_office365()
{
# Should also produce "BAD Command received in Invalid state."
! $CMD_PERL ./imapsync \
--host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
--passfile1 ../../var/pass/secret.outlook.com \
--host2 outlook.office365.com --notls2 --nossl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--justlogin
}
office365_justconnect_stunnel_ks() {
2017-09-23 23:54:48 +02:00
$CMD_PERL ./imapsync \
--host1 outlook.office365.com --ssl1 \
--host2 ks.lamiral.info --port2 144 \
--justconnect
}
2016-09-19 17:17:24 +02:00
2019-07-03 01:17:46 +02:00
office365_justconnect_stunnel_i005() {
$CMD_PERL ./imapsync \
--host1 outlook.office365.com --ssl1 \
--host2 i005.lamiral.info --port2 144 \
--justconnect
}
2017-09-23 23:54:48 +02:00
office365_justconnect_inet4_inet6()
2016-09-19 17:17:24 +02:00
{
2017-09-23 23:54:48 +02:00
echo force ipv4
2016-09-19 17:17:24 +02:00
$CMD_PERL ./imapsync \
2017-09-23 23:54:48 +02:00
--host1 imap-mail.outlook.com \
--host2 outlook.office365.com \
2016-09-19 17:17:24 +02:00
--justconnect --inet4
2017-09-23 23:54:48 +02:00
echo
echo force ipv6
2016-09-19 17:17:24 +02:00
$CMD_PERL ./imapsync \
2017-09-23 23:54:48 +02:00
--host1 imap-mail.outlook.com \
--host2 outlook.office365.com \
2016-09-19 17:17:24 +02:00
--justconnect --inet6
2017-09-23 23:54:48 +02:00
echo
2016-09-19 17:17:24 +02:00
# outlook.office365.com gives ipv6 2a01:111:f400:2fa2::2
2017-09-23 23:54:48 +02:00
echo this one should fail but is does not
$CMD_PERL ./imapsync \
--host1 imap-mail.outlook.com \
--host2 2603:1026:4:51::2 \
2016-09-19 17:17:24 +02:00
--justconnect --inet4
2017-09-23 23:54:48 +02:00
echo
# outlook.office365.com gives ipv4 40.101.42.82
echo this one should fail but is does not
2016-09-19 17:17:24 +02:00
$CMD_PERL ./imapsync \
2017-09-23 23:54:48 +02:00
--host1 imap-mail.outlook.com \
--host2 40.101.42.82 \
2016-09-19 17:17:24 +02:00
--justconnect --inet6
2017-09-23 23:54:48 +02:00
echo
# outlook.office365.com gives ipv6 2603:1026:4:50::2
echo this one should succeed
$CMD_PERL ./imapsync \
--host1 2603:1026:4:51::2 \
--host2 imap-mail.outlook.com \
--justconnect
}
2016-09-19 17:17:24 +02:00
2019-07-03 01:17:46 +02:00
inet4_inet6()
2015-12-03 18:16:32 +01:00
{
2017-09-23 23:54:48 +02:00
echo
# outlook.office365.com gives ipv6 2603:1026:4:50::2
2019-07-03 01:17:46 +02:00
# outlook.office365.com gives ipv4 52.97.129.66
2017-09-23 23:54:48 +02:00
echo this one should succeed
2019-07-03 01:17:46 +02:00
$CMD_PERL ./imapsync \
2017-09-23 23:54:48 +02:00
--host1 2603:1026:4:50::2 \
2019-07-03 01:17:46 +02:00
--host2 52.97.129.66 \
--justconnect
echo this one should do ipv6
$CMD_PERL ./imapsync \
--host1 outlook.office365.com \
--host2 outlook.office365.com \
--justconnect --inet6
echo this one should do ipv4
$CMD_PERL ./imapsync \
--host1 outlook.office365.com \
--host2 outlook.office365.com \
--justconnect --inet4
2015-12-03 18:16:32 +01:00
}
2015-05-28 19:04:57 +02:00
2017-09-23 23:54:48 +02:00
2014-02-13 18:34:20 +01:00
l_office365_bigfolders()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--tmpdir /var/tmp --useuid --include Junk.20
}
l_office365_maxline()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--tmpdir /var/tmp --usecache --include Junk.2013 --maxlinelength 16000 --debugmaxlinelength
}
l_office365_maxline_2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--folder INBOX --regextrans2 's/INBOX/tata/' \
--minmaxlinelength 8000 --debugmaxlinelength
}
2019-07-03 01:25:47 +02:00
l_office365_maxline_3()
{
# It fails at 10240. So the fix is to cut at 10239
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 longlines \
--passfile1 ../../var/pass/secret.longlines \
--host2 imap-mail.outlook.com --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--tmpdir /var/tmp --usecache \
--folder INBOX --regextrans2 's/INBOX/longlines/' \
--debugmaxlinelength --errorsmax 1 --regexmess 's,(.{10239}),$1\r\n,g'
}
ll_empty_longlines()
{
./imapsync \
--host1 $HOST1 --user1 longlines --passfile1 ../../var/pass/secret.longlines \
--host2 $HOST1 --user2 longlines --passfile2 ../../var/pass/secret.longlines \
--delete1 --noexpungeaftereach --delete1emptyfolders
}
2014-02-13 18:34:20 +01:00
# Only available on ks2 (filtered by a firewall)
l_exchange_maxline()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 correu.quopiam.com --ssl2 --user2 utest@quopiam.com \
--passfile2 ../../var/pass/secret.quopiam.com \
--tmpdir /var/tmp --usecache \
--folder INBOX --regextrans2 's/INBOX/longlines/' \
--minmaxlinelength 10000 --maxlinelength 11000 --debugmaxlinelength
}
2013-12-30 03:03:13 +01:00
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
fuzz_basic() {
zzuf -E '^' $CMD_PERL ./imapsync
}
2020-04-11 01:15:57 +02:00
# In mandatory_tests
2017-09-23 23:54:48 +02:00
fuzz_network() {
zzuf -E '^' -d -n $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--timeout 5
}
# general tests end
2011-03-12 03:44:29 +01:00
##########################
# specific tests
##########################
2017-09-23 23:54:48 +02:00
free_ssl() {
$CMD_PERL ./imapsync \
--host1 imap.free.fr --user1 gilles.lamiral@free.fr --passfile1 ../../var/pass/secret.gilles_free \
--host2 imap.free.fr --user2 gilles.lamiral@free.fr --passfile2 ../../var/pass/secret.gilles_free \
--justlogin --ssl1 --ssl2
}
2019-07-03 01:25:47 +02:00
# xgenplus still ok on Wed Apr 3 15:36:09 CEST 2019
2014-11-19 23:16:16 +01:00
xgenplus() {
$CMD_PERL ./imapsync \
--host1 imap.dataone.in --user1 imapsynctest@dataone.in \
--passfile1 ../../var/pass/secret.xgenplus \
--host2 imap.dataone.in --user2 imapsynctest@dataone.in \
--passfile2 ../../var/pass/secret.xgenplus \
2019-07-03 01:25:47 +02:00
--sep1 / --sep2 / --prefix1 "" --prefix2 "" --dry
2014-11-19 23:16:16 +01:00
}
xgenplus_feed() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.dataone.in --user2 imapsynctest@dataone.in \
--passfile2 ../../var/pass/secret.xgenplus \
--sep2 / --prefix2 "" \
2019-07-03 01:25:47 +02:00
--include "Junk.2013" --regextrans2 "s,Junk.2013,Junk," --dry
2014-11-19 23:16:16 +01:00
}
xgenplus_few() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.dataone.in --user2 imapsynctest@dataone.in \
--passfile2 ../../var/pass/secret.xgenplus \
--sep2 / --prefix2 "" \
2019-07-03 01:25:47 +02:00
--include "few_emails" --dry
2014-11-19 23:16:16 +01:00
}
2020-04-11 01:15:57 +02:00
firstclass() {
$CMD_PERL ./imapsync \
--host1 mail.una.ab.ca \
--user1 glamiral --passfile1 ../../var/pass/secret.firstclass \
--host2 mail.una.ab.ca \
--user2 glamiral --passfile2 ../../var/pass/secret.firstclass \
--dry --useuid --debugcontent
}
2014-11-19 23:16:16 +01:00
2020-04-11 01:15:57 +02:00
firstclass_fullfill() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.una.ab.ca \
--user2 glamiral --passfile2 ../../var/pass/secret.firstclass \
--debugcontent \
--folder INBOX.few_emails --f1f2 'INBOX.few_emails=INBOX'
}
2014-11-19 23:16:16 +01:00
2019-07-03 01:25:47 +02:00
# End of specific tests
2011-03-12 03:45:04 +01:00
2015-05-28 19:04:57 +02:00
huge_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 \
2018-05-07 16:04:23 +02:00
--include INBOX.Junk.2010 \
--usecache --tmpdir /var/tmp || \
2011-03-12 03:44:01 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2018-05-07 16:04:23 +02:00
huge_folder_headers_ALL()
{
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 \
--include INBOX.Junk.2010 \
--tmpdir /var/tmp --useheader ALL || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2019-07-03 01:17:46 +02:00
huge_folder_2018()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 gilles@est.belle \
--passfile2 ../../var/pass/secret.gilles_mbox \
--folder INBOX.Junk \
--f1f2 INBOX.Junk=INBOX.Junk.2018 \
--search "SENTBEFORE 1-Jan-2019" \
--tmpdir /var/tmp --usecache --delete1
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2018-05-07 16:04:23 +02:00
2016-09-19 17:17:24 +02:00
huge_message_ks()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 tete \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX --minsize 100000000 \
--tmpdir /var/tmp --debugmemory --nofoldersizes
}
date2=`date`
echo3 "[$date1] [$date2]"
echo3 'rm -f /home/tete/Maildir/cur/*'
}
2015-05-28 19:04:57 +02:00
huge_folder_ks()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 tete \
--passfile2 ../../var/pass/secret.tete \
--include Junk.2010 \
--tmpdir /var/tmp
}
date2=`date`
echo3 "[$date1] [$date2]"
2016-09-19 17:17:24 +02:00
echo3 'rm -f /home/tete/Maildir/.Junk.2010/cur/*'
2015-05-28 19:04:57 +02:00
}
2016-09-19 17:17:24 +02:00
2015-05-28 19:04:57 +02:00
huge_folder_useuid()
2012-04-17 00:31:15 +02: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 \
2014-02-13 18:34:20 +01:00
--include INBOX.Junk.20 --foldersizes \
--useuid --tmpdir /var/tmp --delete2 || \
2012-04-17 00:31:15 +02:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
2015-05-28 19:04:57 +02:00
huge_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
2015-05-28 19:04:57 +02:00
huge_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]"
}
2015-05-28 19:04:57 +02:00
huge_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]"
2015-05-28 19:04:57 +02:00
echo3 'rm -f /home/vmail/tete/.Junk/cur/*'
2011-03-12 03:45:06 +01:00
}
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 \
2019-07-03 01:17:46 +02:00
--nofoldersizes --folder INBOX.03_imapsync.imapsync_list || \
2011-03-12 03:44:57 +01:00
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
}
2019-07-03 01:17:46 +02:00
dprof_bigmail()
2011-03-12 03:45:02 +01:00
{
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 \
2019-07-03 01:17:46 +02:00
--folder INBOX.bigmail --dry --maxlinelength 8888
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]"
2016-09-19 17:17:24 +02:00
mv tmon.out W/dprof_bigmail_tmon.out
dprofpp -O 30 W/dprof_bigmail_tmon.out
dprofpp -O 30 -I W/dprof_bigmail_tmon.out
}
2019-07-03 01:17:46 +02:00
nytprof_bigmail()
{
date1=`date`
{ $CMD_PERL -d:NYTProf ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.bigmail --dry --maxlinelength 8888
echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
ll_nytprof()
{
date1=`date`
2020-04-11 01:15:57 +02:00
# one time without NYTProf
{ $CMD_PERL ./imapsync \
2019-07-03 01:17:46 +02:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi
}
date2=`date`
2020-04-11 01:15:57 +02:00
# then one time with NYTProf
{ $CMD_PERL -d:NYTProf ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi
}
date3=`date`
echo3 "begin: [$date1]"
echo3 "first: [$date2]"
echo3 "end: [$date3]"
2019-07-03 01:17:46 +02:00
}
2016-09-19 17:17:24 +02:00
dprof2_bigmail()
{
date1=`date`
{ $CMD_PERL -d:Profile ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.bigmail --debugmemory --dry
echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
mv prof.out W/dprof2_bigmail_tmon.out
2011-03-12 03:45:02 +01:00
}
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='
2015-05-28 19:04:57 +02:00
no_args
2012-12-29 01:43:39 +01:00
option_version
option_tests
2017-09-23 23:54:48 +02:00
option_tests_in_var_tmp
option_tests_in_var_tmp_sub
2018-05-07 16:04:23 +02:00
option_testsdebug
option_releasecheck
option_noreleasecheck
2017-09-23 23:54:48 +02:00
option_bad_delete2
2018-05-07 16:04:23 +02:00
option_extra_arguments
2017-09-23 23:54:48 +02:00
passfile1_noexist
passfile2_noexist
2011-03-12 03:44:57 +01:00
passwords_masked
2012-11-27 23:32:36 +01:00
passwords_not_masked
2019-07-03 01:25:47 +02:00
ll_authentication_failure
2011-03-12 03:44:56 +01:00
first_sync_dry
first_sync
2015-12-03 18:16:32 +01:00
ll
2019-07-03 01:25:47 +02:00
pidfile_well_removed
pidfile_bad
2012-11-27 23:32:36 +01:00
ll_pidfilelocking
2020-04-11 01:15:57 +02:00
test_tail
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-12-30 03:03:13 +01:00
gmail_gmail_INBOX
gmail_gmail_folderfirst
2017-09-23 23:54:48 +02:00
yahoo_all
free_ssl
office365_justconnect_inet4_inet6
office365_justconnect_tls_SSL_verify_mode_1
2012-12-29 01:43:39 +01:00
ll_unknow_option
2017-09-23 23:54:48 +02:00
ll_ask_password
ll_env_password
2011-03-12 03:44:56 +01:00
ll_bug_folder_name_with_blank
ll_timeout
2011-03-12 03:45:04 +01:00
ll_folder
ll_folder_noexist
2014-11-19 23:16:16 +01:00
ll_folder_mixfolders
2018-05-07 16:04:23 +02:00
ll_nocheckselectable
ll_checkselectable
ll_nocheckfoldersexist
ll_checkfoldersexist
ll_subfolder2
2019-07-03 01:25:47 +02:00
ll_subfolder1
ll_subfolder1_INBOX_SUB
ll_subfolder1_DOES_NOT_EXIST
2011-03-12 03:45:01 +01:00
ll_oneemail
2011-03-12 03:44:56 +01:00
ll_buffersize
2016-09-19 17:17:24 +02:00
ll_justfolders
ll_justfolders_delete1emptyfolders
2014-11-19 23:16:16 +01:00
ll_justfolders_skipemptyfolders
2011-03-12 03:44:56 +01:00
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
2020-04-11 01:15:57 +02:00
ll_justfoldersizes
ll_justfoldersizes_noexist
2011-03-12 03:44:56 +01:00
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
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
2020-04-11 01:15:57 +02:00
ll_regexmess_add_header
ll_regexmess_add_header_path
2011-03-12 03:44:56 +01:00
ll_regexmess_scwchu
2015-05-28 19:04:57 +02:00
ll_skipmess
ll_skipmess_8bits
ll_skipmess_Content_Type_Message_partial
2016-09-19 17:17:24 +02:00
ll_pipemess_nocmd
ll_pipemess_false
ll_pipemess_true
ll_pipemess
ll_pipemess_catcat
2018-05-07 16:04:23 +02:00
ll_flags
ll_resyncflags
ll_noresyncflags
2019-07-03 01:17:46 +02:00
ll_syncflagsaftercopy
2011-03-12 03:44:56 +01:00
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
2017-09-23 23:54:48 +02:00
ll_justconnect
ll_justconnect_ipv6
ll_justconnect_ipv6_nossl
2019-07-03 01:25:47 +02:00
ll_justhost1
ll_justhost2
2011-03-12 03:44:56 +01:00
ll_justlogin
2014-05-30 03:56:21 +02:00
ll_justconnect_devel
2011-03-12 03:44:56 +01:00
ll_ssl
ll_ssl_justconnect
ll_ssl_justlogin
2018-05-07 16:04:23 +02:00
ll_ssl_justconnect_sslargs
2011-03-12 03:44:56 +01:00
ll_tls_justconnect
ll_tls_justlogin
ll_tls
ll_authmech_PLAIN
2016-09-19 17:17:24 +02:00
ll_authmech_xoauth2_gmail
ll_authmech_xoauth2_json_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
2019-07-03 01:17:46 +02:00
ll_delete1_delete2
2011-03-12 03:44:56 +01:00
ll_delete2
2019-07-03 01:17:46 +02:00
ll_delete1
ll_delete1_twoemails
2011-03-12 03:44:56 +01:00
ll_folderrec
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
2020-04-11 01:15:57 +02:00
ll_delete2foldersonly_dry
ll_delete2foldersonly_subfolder2
2011-03-12 03:45:04 +01:00
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
2017-09-23 23:54:48 +02:00
ll_domino1_domino2
ll_domino2
fuzz_basic
fuzz_network
testslive
2020-04-11 01:15:57 +02:00
ll_abort_pidfile_no_exist
2018-05-07 16:04:23 +02:00
ll_abort_noprocess
ll_abort
2020-04-11 01:15:57 +02:00
ll_abort_cgi_context_tail
ll_abort_no_pidfile_option
2019-07-03 01:25:47 +02:00
ll_sigreconnect_INT
ksks_reset_test1
2018-05-07 16:04:23 +02:00
memory_stress
2011-03-12 03:45:02 +01:00
'
2011-03-12 03:44:56 +01:00
2020-04-11 01:15:57 +02:00
# 2019_12 Removed
# ks_justconnect_ipv6_nossl testslive6
# ks_justconnect_ipv6
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
'
2011-03-12 03:44:56 +01:00
l() {
echo "$mandatory_tests" "$other_tests"
}
2011-03-12 03:44:23 +01:00
2016-09-19 17:17:24 +02:00
# minimal and fatal tests
2011-03-12 03:39:59 +01:00
2016-09-19 17:17:24 +02:00
run_tests perl_syntax || exit 1
2011-03-12 03:44:11 +01:00
2019-07-03 01:25:47 +02:00
set_return_code_variables
2011-03-12 03:39:59 +01:00
2016-09-19 17:17:24 +02:00
if test $# -eq 0; then
# mandatory tests
if run_tests $mandatory_tests; then
./i3 --version >> .test_3xx
return 0
fi
else
# selective tests
run_tests "$@"
return $?
fi
2011-03-12 03:39:59 +01:00