This commit is contained in:
Nick Bebout 2012-04-16 17:26:18 -05:00
parent 1b3773e80f
commit 1cb5bee328
98 changed files with 1701 additions and 597 deletions

165
tests.sh
View file

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.174 2011/08/24 06:48:23 gilles Exp gilles $
# $Id: tests.sh,v 1.182 2011/11/12 23:40:55 gilles Exp gilles $
# Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
@ -20,11 +20,15 @@ HOST2=${HOST2:-'localhost'}
echo HOST2=$HOST2
# most tests use:
CMD_PERL=${CMD_PERL:-'perl -I./Mail-IMAPClient-2.2.9'}
# few debugging tests use:
CMD_PERL_2xx='perl -I./Mail-IMAPClient-2.2.9'
CMD_PERL_3xx='perl -I./Mail-IMAPClient-3.28/lib'
CMD_PERL_3xx='perl -I./Mail-IMAPClient-3.30/lib'
CMD_PERL=${CMD_PERL:-$CMD_PERL_3xx}
#echo $CMD_PERL
#exit
#### Shell pragmas
@ -542,14 +546,14 @@ ll_nosyncinternaldates() {
ll_idatefromheader() {
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.oneemail \
--folder INBOX.oneemail2 \
--idatefromheader --debug --dry
}
@ -575,14 +579,14 @@ ll_subscribed()
}
ll_subscribe()
ll_nosubscribe()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--subscribed --subscribe
--subscribed --nosubscribe
}
ll_justconnect()
@ -802,6 +806,28 @@ ll_search_SENTSINCE()
--search 'SENTSINCE 11-Jul-2011' --folder INBOX
}
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 \
--search 'SENTBEFORE 2-Oct-2011' --folder INBOX --delete2
}
@ -1238,7 +1264,8 @@ ll_regex_flag4()
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap --nofoldersizes \
--regexflag 's/\$label1/\\label1/g' --debugflags
--regexflag 's/\$label1/\\label1/g' \
--regexflag "s/\\\$Forwarded//g" --debugflags
echo 'sudo rm -f /home/vmail/titi/.yop.yap/cur/*'
}
@ -1283,10 +1310,10 @@ ll_tls_justlogin() {
ll_tls_devel() {
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' ll_justlogin ll_ssl_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-3.28/lib' ll_justlogin ll_ssl_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' ll_tls_justconnect ll_tls_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-3.28/lib' ll_tls_justconnect ll_tls_justlogin
CMD_PERL=$CMD_PERL_2xx ll_justlogin ll_ssl_justlogin \
&& CMD_PERL=$CMD_PERL_3xx ll_justlogin ll_ssl_justlogin \
&& CMD_PERL=$CMD_PERL_2xx ll_tls_justconnect ll_tls_justlogin \
&& CMD_PERL=$CMD_PERL_3xx ll_tls_justconnect ll_tls_justlogin
}
ll_tls() {
@ -1346,7 +1373,7 @@ ll_authmech_PLAIN() {
}
ll_authmech_NTLM() {
$CMD_PERL -I./NTLM-1.05/blib/lib ./imapsync \
$CMD_PERL -I./NTLM-1.09/blib/lib ./imapsync \
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
@ -1357,7 +1384,7 @@ ll_authmech_NTLM() {
}
ll_authmech_NTLM_domain() {
$CMD_PERL -I./NTLM-1.05/blib/lib ./imapsync \
$CMD_PERL -I./NTLM-1.09/blib/lib ./imapsync \
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
@ -1367,13 +1394,14 @@ ll_authmech_NTLM_domain() {
}
ll_authmech_NTLM_2() {
$CMD_PERL -I./NTLM-1.05/blib/lib ./imapsync \
$CMD_PERL -I./NTLM-1.09/blib/lib ./imapsync \
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--authmech1 NTLM --dry
}
@ -1556,8 +1584,6 @@ msw2() {
}
xxxxx_gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
@ -1569,7 +1595,11 @@ xxxxx_gmail() {
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--nofoldersizes \
--justfolders --dry --prefix2 '[Gmail]/'
--justfolders \
--regextrans2 "s, +$,,g" --regextrans2 "s, +/,/,g" \
--exclude INBOX.yop.YAP
#--dry --prefix2 '[Gmail]/'
}
xxxxx_gmail_2() {
@ -1584,7 +1614,6 @@ xxxxx_gmail_2() {
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--regextrans2 's,(.*),SMS,'
#--dry --prefix2 '[Gmail]/'
}
xxxxx_gmail_3() {
@ -1641,10 +1670,8 @@ gmail_xxxxx() {
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--nofoldersizes \
--prefix1 '[Gmail]/' --dry --justfolders
--dry --justfolders
}
@ -1657,10 +1684,7 @@ gmail() {
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--regextrans2 's/\[Gmail\]/Gmail/'
--passfile2 ../../var/pass/secret.tata
}
gmail_justfolders() {
@ -1673,9 +1697,6 @@ gmail_justfolders() {
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--regextrans2 's/\[Gmail\]/Gmail/' \
--justfolders
}
@ -1704,12 +1725,9 @@ gmail_gmail() {
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--useheader 'Message-Id' --useheader="X-Gmail-Received" \
--regextrans2 's¤INBOX¤inbox_copy¤' \
--folder INBOX \
--allowsizemismatch
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--justfolders
}
@ -1723,9 +1741,7 @@ gmail_gmail2() {
--ssl2 \
--user2 imapsync.gl@gmail.com \
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--useheader 'Message-Id' --skipsize \
--folder INBOX \
--allowsizemismatch
--folder INBOX
#--dry # --debug --debugimap # --authmech1 LOGIN
}
@ -1743,8 +1759,11 @@ yahoo_xxxx_login() {
}
yahoo_xxxx() {
# Yahoo works only with ssl (november 2011)
# Could do plain port 143 before
! 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 \
@ -1752,8 +1771,6 @@ yahoo_xxxx() {
--passfile2 ../../var/pass/secret.titi \
--sep1 '.'
# Yahoo works also with ssl
# --ssl1 \
}
@ -1769,7 +1786,7 @@ allow3xx() {
}
noallow3xx() {
! perl -I./Mail-IMAPClient-3.28/lib ./imapsync \
! $CMD_PERL_3xx ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
@ -1985,6 +2002,70 @@ ll_useuid_nousecache()
# specific tests
##########################
dbmail_uid() {
# --useuid alone does not work on dbmaikl server 2.2.17 ready to run
# because uids are += 2 and uidnext is in fact uidnext + 1
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 182.236.127.31 --user2 imapsynctest \
--passfile2 ../../var/pass/secret.dbmail \
--folder INBOX --fast --delete2 --expunge2 \
--usecache --useuid --nocacheaftercopy
}
dbmail_nocacheaftercopy() {
# Does work
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 182.236.127.31 --user2 imapsynctest \
--passfile2 ../../var/pass/secret.dbmail \
--folder INBOX --fast --delete2 --expunge2 --usecache --nocacheaftercopy
}
dbmail_nocache() {
# Does work
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 182.236.127.31 --user2 imapsynctest \
--passfile2 ../../var/pass/secret.dbmail \
--folder INBOX --fast --delete2 --expunge2
}
bluehost2() {
$CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com --tls1 \
--user1 dalton@piila.com \
--passfile1 ../../var/pass/secret.bluehost2 \
--host2 box766.bluehost.com --ssl2 \
--user2 dalton@piila.com \
--passfile2 ../../var/pass/secret.bluehost2 \
--sep1 '/' --useuid --regextrans2 's/Inbox/INBOX/' --regextrans2 's,/,_,'
}
bluehost() {
$CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com --tls1 \
--user1 pii@piila.com \
--passfile1 ../../var/pass/secret.bluehost \
--host2 box766.bluehost.com --ssl2 \
--user2 pii@piila.com \
--passfile2 ../../var/pass/secret.bluehost \
--sep1 '/' --usecache --useuid --regextrans2 's/Inbox/INBOX/'
}
b2btech_1() {
$CMD_PERL ./imapsync \
@ -2410,7 +2491,7 @@ ll_nosyncinternaldates
ll_idatefromheader
ll_folder_rev
ll_subscribed
ll_subscribe
ll_nosubscribe
ll_justfoldersizes
ll_authmd5
ll_authmd51