3 # Test illegal or questionable behaviors of GMail.
5 if test -z "$MH_OBJ_DIR"; then
6 srcdir
=`dirname "$0"`/..
/..
7 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
10 .
"${srcdir}/test/oauth/common.sh"
12 # common.sh sets this to something crazy; did i do that?!
13 testname
=${0#$srcdir/}
15 setup_test_without_data Mail
19 access-testuser: test-access
20 refresh-testuser: test-refresh
21 expire-testuser: 2000000000
25 #### Save exit status to use as status for this program.
31 [ -n "$imapd_pid" ] && kill $imapd_pid
32 "$MH_OBJ_DIR/target/debug/mhimap" imap shutdown
34 # TODO have cleanup allow additional cleanup registration?
35 # Or just allow it to accept status as argument.
41 covdir
="$MH_OBJ_DIR/covdata/${MH_COVERAGE_PROFILE:-default}/$testname"
43 export LLVM_PROFILE_FILE
="$covdir/$profile-%m.profraw"
45 imapd
="$MH_TEST_DIR/$$.imapd"
46 start_fakeinetd
"$imapd"
47 imapd_pid
=$fakeinetd_pid
51 imap-manager: $MH_OBJ_DIR/target/debug/imap-folder-manager
52 imap-socket: $MH_TEST_DIR/Mail/imap.d/socket
53 imap-db: $MH_TEST_DIR/Mail/imap.d
55 imap-port: $fakeinetd_port
56 imap-tls: don't protect my data i know what i'm doing
59 imap-saslmech: xoauth2
60 imap-authservice: test
62 if [ -n "$MH_TEST_IMAP_LOG_LEVEL" ]; then
63 echo "imap-log-level: $MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
64 echo "imap-log-$MH_TEST_IMAP_LOG_LEVEL-to: $MH_TEST_DIR/$profile/imap.d/log.$MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
67 # It's the "* OK [HIGHESTMODSEQ 8869]" that's illegal: a space is required after the close bracket.
68 cat > "$imapd" <<EOSCRIPT
71 * OK Gimap ready for requests
72 * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER AUTH=XOAUTH
73 1 OK capability response
74 * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
75 1 OK authenticate response
77 * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)
78 * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing \*)] Flags permitted.
79 * OK [UIDVALIDITY 62] UIDs valid.
82 * OK [UIDNEXT 1] Predicted next UID.
83 * OK [HIGHESTMODSEQ 8869]
84 1 OK [READ-WRITE] imap/foo selected. (Success)
85 1 OK Returned to authenticated state. (Success)
87 while read line; do :; done
91 folder
-create +imap
/foo