2011-03-12 03:39:59 +01:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
2011-03-12 03:44:26 +01:00
|
|
|
|
# $Id: tests.sh,v 1.53 2006/06/08 00:53:21 gilles Exp $
|
2011-03-12 03:39:59 +01:00
|
|
|
|
|
|
|
|
|
#### Shell pragmas
|
|
|
|
|
|
2011-03-12 03:43:43 +01:00
|
|
|
|
exec 3>&2 #
|
|
|
|
|
#set -x # debug mode. See what is running
|
|
|
|
|
set -e # exit on first failure
|
2011-03-12 03:39:59 +01:00
|
|
|
|
|
|
|
|
|
#### functions definitions
|
|
|
|
|
|
|
|
|
|
echo3() {
|
|
|
|
|
#echo '#####################################################' >&3
|
|
|
|
|
echo "$*" >&3
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
run_test() {
|
|
|
|
|
echo3 "#### $test_count $1"
|
|
|
|
|
$1
|
|
|
|
|
if test x"$?" = x"0"; then
|
|
|
|
|
echo "$1 passed"
|
|
|
|
|
else
|
|
|
|
|
echo "$1 failed" >&2
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
run_tests() {
|
|
|
|
|
for t in $*; do
|
|
|
|
|
test_count=`expr 1 + $test_count`
|
|
|
|
|
run_test $t
|
|
|
|
|
sleep 1
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Variable definitions
|
|
|
|
|
|
|
|
|
|
test_count=0
|
|
|
|
|
|
|
|
|
|
##### The tests functions
|
|
|
|
|
|
|
|
|
|
perl_syntax() {
|
2011-03-12 03:43:46 +01:00
|
|
|
|
perl -c ./imapsync
|
2011-03-12 03:39:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
no_args() {
|
2011-03-12 03:43:46 +01:00
|
|
|
|
./imapsync
|
2011-03-12 03:39:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
first_sync() {
|
|
|
|
|
./imapsync \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host1 localhost --user1 toto@est.belle \
|
|
|
|
|
--passfile1 /var/tmp/secret1 \
|
|
|
|
|
--host2 localhost --user2 titi@est.belle \
|
2011-03-12 03:43:56 +01:00
|
|
|
|
--passfile2 /var/tmp/secret2 \
|
|
|
|
|
--noauthmd5
|
2011-03-12 03:39:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:48 +01:00
|
|
|
|
sendtestmessage() {
|
|
|
|
|
rand=`pwgen 16 1`
|
|
|
|
|
mess='test:'$rand
|
|
|
|
|
cmd="echo $mess""| mail -s ""$mess"" tata"
|
|
|
|
|
echo $cmd
|
|
|
|
|
ssh gilles@loul $cmd
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:39:59 +01:00
|
|
|
|
loulplume() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
2011-03-12 03:43:48 +01:00
|
|
|
|
sendtestmessage
|
2011-03-12 03:39:59 +01:00
|
|
|
|
./imapsync \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--passfile2 /var/tmp/secret.tata
|
2011-03-12 03:39:59 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:12 +01:00
|
|
|
|
loulloul() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
sendtestmessage
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--host2 loul --user2 titi \
|
2011-03-12 03:44:21 +01:00
|
|
|
|
--passfile2 /var/tmp/secret.tata
|
2011-03-12 03:44:12 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:39:59 +01:00
|
|
|
|
plumeloul() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host1 plume --user1 tata@est.belle \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--host2 loul --user2 tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--passfile2 /var/tmp/secret.tata
|
2011-03-12 03:39:59 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:43 +01:00
|
|
|
|
lp_folder() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
2011-03-12 03:43:45 +01:00
|
|
|
|
--folder INBOX.yop --folder INBOX.Trash \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host1 loul --user1 tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--passfile1 /var/tmp/secret.tata
|
2011-03-12 03:43:43 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:15 +01:00
|
|
|
|
lp_buffersize() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--buffersize 8
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:08 +01:00
|
|
|
|
lp_justfolders() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.yop --folder INBOX.Trash \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--justfolders
|
2011-03-12 03:44:08 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:48 +01:00
|
|
|
|
|
|
|
|
|
pl_folder_qqq() {
|
2011-03-12 03:43:47 +01:00
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
2011-03-12 03:43:48 +01:00
|
|
|
|
--host1 plume --user1 tata@est.belle \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:43:47 +01:00
|
|
|
|
--folder INBOX.qqq \
|
2011-03-12 03:43:48 +01:00
|
|
|
|
--host2 loul --user2 tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--passfile2 /var/tmp/secret.tata
|
2011-03-12 03:43:47 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:19 +01:00
|
|
|
|
pl_prefix12() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host1 plume --user1 tata@est.belle \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.qqq \
|
|
|
|
|
--host2 loul --user2 tata \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--prefix1 INBOX.\
|
|
|
|
|
--prefix2 INBOX. \
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:48 +01:00
|
|
|
|
lp_internaldate() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
sendtestmessage
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--syncinternaldates
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:43 +01:00
|
|
|
|
pl_folder() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host1 plume --user1 tata@est.belle \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:43:43 +01:00
|
|
|
|
--folder INBOX.yop \
|
2011-03-12 03:43:46 +01:00
|
|
|
|
--host2 loul --user2 tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--passfile2 /var/tmp/secret.tata
|
2011-03-12 03:43:43 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
2011-03-12 03:39:59 +01:00
|
|
|
|
|
2011-03-12 03:43:48 +01:00
|
|
|
|
lp_subscribed()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--subscribed
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
2011-03-12 03:43:49 +01:00
|
|
|
|
}
|
2011-03-12 03:43:48 +01:00
|
|
|
|
|
2011-03-12 03:39:59 +01:00
|
|
|
|
|
2011-03-12 03:43:49 +01:00
|
|
|
|
lp_subscribe()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--subscribed --subscribe
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
2011-03-12 03:43:48 +01:00
|
|
|
|
}
|
2011-03-12 03:43:47 +01:00
|
|
|
|
|
2011-03-12 03:43:50 +01:00
|
|
|
|
lp_justconnect()
|
2011-03-12 03:44:20 +01:00
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume \
|
|
|
|
|
--host1 loul \
|
|
|
|
|
--justconnect
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lp_justfoldersizes()
|
2011-03-12 03:43:50 +01:00
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:44:20 +01:00
|
|
|
|
--justfoldersizes
|
2011-03-12 03:43:50 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:20 +01:00
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:53 +01:00
|
|
|
|
lp_authmd5()
|
2011-03-12 03:43:50 +01:00
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--justfoldersizes
|
2011-03-12 03:43:50 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:53 +01:00
|
|
|
|
lp_noauthmd5()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--justfoldersizes --noauthmd5
|
2011-03-12 03:43:53 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:50 +01:00
|
|
|
|
|
2011-03-12 03:43:50 +01:00
|
|
|
|
lp_maxage()
|
|
|
|
|
{
|
|
|
|
|
sendtestmessage
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--maxage 1
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:54 +01:00
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:50 +01:00
|
|
|
|
lp_maxsize()
|
|
|
|
|
{
|
|
|
|
|
sendtestmessage
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--maxsize 10
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
2011-03-12 03:43:47 +01:00
|
|
|
|
|
2011-03-12 03:43:54 +01:00
|
|
|
|
lp_skipsize()
|
|
|
|
|
{
|
|
|
|
|
sendtestmessage
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--skipsize --folder INBOX.yop.yap
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lp_skipheader()
|
|
|
|
|
{
|
|
|
|
|
sendtestmessage
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--skipheader 'X-.*' --folder INBOX.yop.yap
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:51 +01:00
|
|
|
|
lp_include()
|
|
|
|
|
{
|
|
|
|
|
sendtestmessage
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:44:21 +01:00
|
|
|
|
--include '^INBOX.yop'
|
2011-03-12 03:43:51 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:55 +01:00
|
|
|
|
lp_regextrans2()
|
|
|
|
|
{
|
|
|
|
|
sendtestmessage
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--regextrans2 's/yop/yopX/' --dry
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:06 +01:00
|
|
|
|
lp_sep2()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.yop.yap \
|
|
|
|
|
--sep2 '\\' --dry
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:55 +01:00
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:53 +01:00
|
|
|
|
bad_login()
|
|
|
|
|
{
|
|
|
|
|
! ./imapsync \
|
|
|
|
|
--host1 localhost --user1 toto@est.belle \
|
|
|
|
|
--passfile1 /var/tmp/secret1 \
|
|
|
|
|
--host2 localhost --user2 notiti@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret2
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bad_host()
|
|
|
|
|
{
|
|
|
|
|
! ./imapsync \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--host1 badhost --user1 toto@est.belle \
|
2011-03-12 03:43:53 +01:00
|
|
|
|
--passfile1 /var/tmp/secret1 \
|
|
|
|
|
--host2 badhost --user2 titi@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret2
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:43:56 +01:00
|
|
|
|
|
2011-03-12 03:43:56 +01:00
|
|
|
|
foldersizes()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--justfoldersizes
|
2011-03-12 03:43:56 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:43:55 +01:00
|
|
|
|
big_transfert()
|
|
|
|
|
{
|
|
|
|
|
date1=`date`
|
|
|
|
|
{ ./imapsync \
|
|
|
|
|
--host1 louloutte --user1 gilles \
|
|
|
|
|
--passfile1 /var/tmp/secret \
|
|
|
|
|
--host2 plume --user2 tete@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tete \
|
2011-03-12 03:44:11 +01:00
|
|
|
|
--subscribed --foldersizes --noauthmd5 \
|
2011-03-12 03:44:15 +01:00
|
|
|
|
--fast --folder INBOX.Backup \
|
|
|
|
|
--useheader Message-ID --useheader Received || \
|
2011-03-12 03:44:01 +01:00
|
|
|
|
true
|
|
|
|
|
}
|
|
|
|
|
date2=`date`
|
|
|
|
|
echo3 "[$date1] [$date2]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
big_transfert_sizes_only()
|
|
|
|
|
{
|
|
|
|
|
date1=`date`
|
|
|
|
|
{ ./imapsync \
|
|
|
|
|
--host1 louloutte --user1 gilles \
|
|
|
|
|
--passfile1 /var/tmp/secret \
|
|
|
|
|
--host2 plume --user2 tete@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tete \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--subscribed --noauthmd5 \
|
|
|
|
|
--justfoldersizes || \
|
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
|
|
|
|
|
2011-03-12 03:44:01 +01:00
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:06 +01:00
|
|
|
|
dprof()
|
2011-03-12 03:44:01 +01:00
|
|
|
|
{
|
|
|
|
|
date1=`date`
|
|
|
|
|
{ perl -d:DProf ./imapsync \
|
|
|
|
|
--host1 louloutte --user1 gilles \
|
|
|
|
|
--passfile1 /var/tmp/secret \
|
|
|
|
|
--host2 plume --user2 tete@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tete \
|
|
|
|
|
--subscribed --foldersizes --noauthmd5 \
|
2011-03-12 03:44:06 +01:00
|
|
|
|
--folder INBOX.Trash || \
|
2011-03-12 03:44:01 +01:00
|
|
|
|
true
|
|
|
|
|
}
|
|
|
|
|
date2=`date`
|
|
|
|
|
echo3 "[$date1] [$date2]"
|
|
|
|
|
dprofpp tmon.out
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:06 +01:00
|
|
|
|
essnet_justconnect()
|
|
|
|
|
{
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host1 mail2.softwareuno.com \
|
|
|
|
|
--user1 gilles@mail2.softwareuno.com \
|
|
|
|
|
--passfile1 /var/tmp/secret.prw \
|
|
|
|
|
--host2 mail.softwareuno.com \
|
|
|
|
|
--user2 gilles@softwareuno.com \
|
|
|
|
|
--passfile2 /var/tmp/secret.prw \
|
|
|
|
|
--dry --noauthmd5 --sep1 / --foldersizes --justconnect
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
essnet_mail2_mail()
|
|
|
|
|
{
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host1 mail2.softwareuno.com \
|
|
|
|
|
--user1 gilles@mail2.softwareuno.com \
|
|
|
|
|
--passfile1 /var/tmp/secret.prw \
|
|
|
|
|
--host2 mail.softwareuno.com \
|
|
|
|
|
--user2 gilles@softwareuno.com \
|
|
|
|
|
--passfile2 /var/tmp/secret.prw \
|
|
|
|
|
--noauthmd5 --sep1 / --foldersizes \
|
2011-03-12 03:44:11 +01:00
|
|
|
|
--prefix2 "INBOX/" --regextrans2 's<>INBOX/INBOX<4F>INBOX<4F>'
|
2011-03-12 03:44:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
essnet_mail2_mail_t123()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
for user1 in test1 test2 test3; do
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host1 mail2.softwareuno.com \
|
|
|
|
|
--user1 ${user1}@mail2.softwareuno.com \
|
|
|
|
|
--passfile1 /var/tmp/secret.prw \
|
|
|
|
|
--host2 mail.softwareuno.com \
|
|
|
|
|
--user2 gilles@softwareuno.com \
|
|
|
|
|
--passfile2 /var/tmp/secret.prw \
|
|
|
|
|
--noauthmd5 --sep1 / --foldersizes \
|
2011-03-12 03:44:11 +01:00
|
|
|
|
--prefix2 "INBOX/" --regextrans2 's<>INBOX/INBOX<4F>INBOX<4F>' \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
--debug \
|
2011-03-12 03:44:06 +01:00
|
|
|
|
|| true
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
essnet_plume2()
|
|
|
|
|
{
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host1 mail2.softwareuno.com \
|
|
|
|
|
--user1 gilles@mail2.softwareuno.com \
|
|
|
|
|
--passfile1 /var/tmp/secret.prw \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
2011-03-12 03:44:11 +01:00
|
|
|
|
--noauthmd5 --sep1 / --foldersizes \
|
2011-03-12 03:44:14 +01:00
|
|
|
|
--prefix2 INBOX. --regextrans2 's<>INBOX.INBOX<4F>INBOX<4F>'
|
2011-03-12 03:44:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:17 +01:00
|
|
|
|
dynamicquest_1()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
perl -I bugs/lib ./imapsync \
|
|
|
|
|
--host1 69.38.48.81 \
|
|
|
|
|
--user1 testuser1@dq.com \
|
|
|
|
|
--passfile1 /var/tmp/secret.dynamicquest \
|
|
|
|
|
--host2 69.38.48.81 \
|
|
|
|
|
--user2 testuser2@dq.com \
|
|
|
|
|
--passfile2 /var/tmp/secret.dynamicquest \
|
|
|
|
|
--noauthmd5 --sep1 "/" --sep2 "/" \
|
|
|
|
|
--justconnect --dry
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dynamicquest_2()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
perl -I bugs/lib ./imapsync \
|
|
|
|
|
--host1 mail.dynamicquest.com \
|
|
|
|
|
--user1 gomez \
|
|
|
|
|
--passfile1 /var/tmp/secret.dynamicquestgomez \
|
|
|
|
|
--host2 69.38.48.81 \
|
|
|
|
|
--user2 testuser2@dq.com \
|
|
|
|
|
--passfile2 /var/tmp/secret.dynamicquest \
|
|
|
|
|
--noauthmd5 \
|
|
|
|
|
--justconnect --dry
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dynamicquest_3()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
perl -I bugs/lib ./imapsync \
|
|
|
|
|
--host1 loul \
|
|
|
|
|
--user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--host2 69.38.48.81 \
|
|
|
|
|
--user2 testuser2@dq.com \
|
|
|
|
|
--passfile2 /var/tmp/secret.dynamicquest \
|
|
|
|
|
--noauthmd5 --sep2 "/" --debug --debugimap
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:15 +01:00
|
|
|
|
useheader()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.yop.yap \
|
|
|
|
|
--useheader 'Message-ID' \
|
|
|
|
|
--dry --debug
|
|
|
|
|
|
|
|
|
|
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:11 +01:00
|
|
|
|
regexmess()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.yop.yap \
|
2011-03-12 03:44:12 +01:00
|
|
|
|
--regexmess 's/\157/O/g' \
|
|
|
|
|
--regexmess 's/p/Z/g' \
|
|
|
|
|
--dry --debug
|
|
|
|
|
|
|
|
|
|
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
|
2011-03-12 03:44:11 +01:00
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
2011-03-12 03:44:06 +01:00
|
|
|
|
|
2011-03-12 03:44:01 +01:00
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
|
flags()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.yop.yap \
|
|
|
|
|
--dry --debug
|
|
|
|
|
|
|
|
|
|
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:26 +01:00
|
|
|
|
regex_flag()
|
|
|
|
|
{
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX.yop.yap \
|
|
|
|
|
--dry --debug --regexflag 's/\\Answered//g'
|
|
|
|
|
|
|
|
|
|
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
|
|
|
|
|
|
lp_ssl() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--ssl1 --ssl2
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lp_authmech_PLAIN() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--justfoldersizes --nofoldersizes \
|
|
|
|
|
--authmech1 PLAIN --authmech2 PLAIN
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lp_authuser() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--justfoldersizes --nofoldersizes \
|
|
|
|
|
--authuser2 tata@est.belle
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
|
lp_authmech_LOGIN() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--justfoldersizes --nofoldersizes \
|
|
|
|
|
--authmech1 LOGIN --authmech2 LOGIN
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lp_authmech_CRAMMD5() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--justfoldersizes --nofoldersizes \
|
|
|
|
|
--authmech1 CRAM-MD5 --authmech2 CRAM-MD5
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:25 +01:00
|
|
|
|
lp_delete2() {
|
|
|
|
|
if test X`hostname` = X"plume"; then
|
|
|
|
|
echo3 Here is plume
|
|
|
|
|
./imapsync \
|
|
|
|
|
--host2 plume --user2 tata@est.belle \
|
|
|
|
|
--passfile2 /var/tmp/secret.tata \
|
|
|
|
|
--host1 loul --user1 tata \
|
|
|
|
|
--passfile1 /var/tmp/secret.tata \
|
|
|
|
|
--folder INBOX \
|
|
|
|
|
--delete2 --expunge2
|
|
|
|
|
else
|
|
|
|
|
:
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
|
|
|
|
|
|
|
2011-03-12 03:39:59 +01:00
|
|
|
|
# mandatory tests
|
|
|
|
|
|
|
|
|
|
run_tests perl_syntax
|
|
|
|
|
|
|
|
|
|
# All tests
|
2011-03-12 03:43:56 +01:00
|
|
|
|
# lp : louloutte -> plume
|
|
|
|
|
# pl : plume -> louloutte
|
2011-03-12 03:39:59 +01:00
|
|
|
|
|
|
|
|
|
test $# -eq 0 && run_tests \
|
|
|
|
|
no_args \
|
|
|
|
|
first_sync \
|
|
|
|
|
loulplume \
|
2011-03-12 03:43:43 +01:00
|
|
|
|
plumeloul \
|
|
|
|
|
lp_folder \
|
2011-03-12 03:44:15 +01:00
|
|
|
|
lp_buffersize \
|
2011-03-12 03:43:47 +01:00
|
|
|
|
pl_folder \
|
2011-03-12 03:43:48 +01:00
|
|
|
|
pl_folder_qqq \
|
2011-03-12 03:44:19 +01:00
|
|
|
|
pl_prefix12 \
|
2011-03-12 03:43:48 +01:00
|
|
|
|
lp_internaldate \
|
2011-03-12 03:43:49 +01:00
|
|
|
|
lp_subscribed \
|
|
|
|
|
lp_subscribe \
|
2011-03-12 03:43:50 +01:00
|
|
|
|
lp_justconnect \
|
2011-03-12 03:44:20 +01:00
|
|
|
|
lp_justfoldersizes \
|
2011-03-12 03:43:53 +01:00
|
|
|
|
lp_authmd5 \
|
2011-03-12 03:43:50 +01:00
|
|
|
|
lp_maxage \
|
2011-03-12 03:43:51 +01:00
|
|
|
|
lp_maxsize \
|
2011-03-12 03:43:53 +01:00
|
|
|
|
lp_include \
|
|
|
|
|
bad_login \
|
|
|
|
|
bad_host \
|
2011-03-12 03:43:54 +01:00
|
|
|
|
lp_noauthmd5 \
|
|
|
|
|
lp_skipsize \
|
2011-03-12 03:43:55 +01:00
|
|
|
|
lp_skipheader \
|
2011-03-12 03:43:56 +01:00
|
|
|
|
lp_regextrans2 \
|
2011-03-12 03:44:06 +01:00
|
|
|
|
foldersizes \
|
2011-03-12 03:44:11 +01:00
|
|
|
|
regexmess \
|
2011-03-12 03:44:15 +01:00
|
|
|
|
useheader \
|
2011-03-12 03:44:23 +01:00
|
|
|
|
lp_ssl \
|
|
|
|
|
lp_authmech_LOGIN \
|
|
|
|
|
lp_authmech_CRAMMD5 \
|
|
|
|
|
lp_authmech_PLAIN \
|
|
|
|
|
lp_authuser
|
|
|
|
|
|
2011-03-12 03:44:15 +01:00
|
|
|
|
|
2011-03-12 03:44:11 +01:00
|
|
|
|
|
2011-03-12 03:39:59 +01:00
|
|
|
|
|
|
|
|
|
# selective tests
|
|
|
|
|
|
|
|
|
|
test $# -gt 0 && run_tests $*
|
|
|
|
|
|
|
|
|
|
# If there, all is good
|
|
|
|
|
|
|
|
|
|
echo3 ALL $test_count TESTS SUCCESSFUL
|
|
|
|
|
|