2 ######################################################
6 ######################################################
12 runandcheck "rcvstore -help" <<!
13 Usage: rcvstore [+folder] [switches]
28 * ) printf '%s: rcvstore -V generated unexpected output\n' "$0" >&2
29 failed=`expr ${failed:-0} + 1`;;
33 # check unknown switch
34 runandcheck "rcvstore -nonexistent" <<!
35 rcvstore: -nonexistent unknown
39 # check with no switches and zero-length input message
40 runandcheck "rcvstore </dev/null" <<!
45 # check with no switches
46 runandcheck "rcvstore <$MH_TEST_DIR/Mail/inbox/1" <<!
48 diff -u "`mhpath +inbox f`" "`mhpath l`"
51 # check + of existing folder
52 runandcheck "rcvstore +inbox <$MH_TEST_DIR/Mail/inbox/1" <<!
54 diff -u "`mhpath f`" "`mhpath l`"
57 # check + of new folder
58 runandcheck "rcvstore +newfolder <$MH_TEST_DIR/Mail/inbox/1" <<!
60 diff -u "`mhpath +inbox f`" "`mhpath +newfolder l`"
65 runandcheck "rcvstore +newfolder -nocreate <$MH_TEST_DIR/Mail/inbox/1" <<!
66 rcvstore: folder $MH_TEST_DIR/Mail/newfolder doesn't exist
71 runandcheck "rcvstore +newfolder -nocreate -create <$MH_TEST_DIR/Mail/inbox/1" <<!
73 diff -u "`mhpath +inbox f`" "`mhpath +newfolder l`"
77 # check addition to unseen sequence
78 runandcheck "rcvstore <$MH_TEST_DIR/Mail/inbox/1" <<!
80 runandcheck 'mark -sequence u -list' <<!
83 diff -u "`mhpath +inbox f`" "`mhpath +inbox l`"
88 runandcheck "rcvstore -nounseen <$MH_TEST_DIR/Mail/inbox/1" <<!
90 runandcheck 'mark -sequence u -list' <<!
93 diff -u "`mhpath f`" "`mhpath l`"
97 runandcheck "rcvstore -nounseen -unseen <$MH_TEST_DIR/Mail/inbox/1" <<!
99 runandcheck 'mark -sequence u -list' <<!
102 diff -u "`mhpath f`" "`mhpath l`"
106 runandcheck "rcvstore -sequence newseq <$MH_TEST_DIR/Mail/inbox/1" <<!
108 runandcheck 'mark -sequence newseq -list' <<!
111 diff -u "`mhpath f`" "`mhpath l`"
114 # check that default is -nozero
115 mark -sequence newseq a
116 runandcheck "rcvstore -sequence newseq <$MH_TEST_DIR/Mail/inbox/1" <<!
118 runandcheck 'mark -sequence newseq -list' <<!
121 diff -u "`mhpath f`" "`mhpath l`"
125 mark -sequence newseq a
126 runandcheck "rcvstore -sequence newseq -zero <$MH_TEST_DIR/Mail/inbox/1" <<!
128 runandcheck 'mark -sequence newseq -list' <<!
131 diff -u "`mhpath f`" "`mhpath l`"
135 mark -sequence newseq a
136 runandcheck "rcvstore -sequence newseq -zero -nozero <$MH_TEST_DIR/Mail/inbox/1" <<!
138 runandcheck 'mark -sequence newseq -list' <<!
141 diff -u "`mhpath f`" "`mhpath l`"
144 # check that default is -public
145 runandcheck "rcvstore -sequence pubseq <$MH_TEST_DIR/Mail/inbox/1" <<!
147 runandcheck 'mark -sequence pubseq -list' <<!
150 diff -u "`mhpath f`" "`mhpath l`"
153 runandcheck "rcvstore -sequence privseq -nopublic <$MH_TEST_DIR/Mail/inbox/1" <<!
155 runandcheck 'mark -sequence privseq -nopublic -list' <<!
156 privseq (private): 21
158 diff -u "`mhpath f`" "`mhpath l`"
161 runandcheck "rcvstore -sequence pubseq -nopublic -public <$MH_TEST_DIR/Mail/inbox/1" <<!
163 runandcheck 'mark -sequence pubseq -public -list' <<!
166 diff -u "`mhpath f`" "`mhpath l`"
169 # check default Msg-Protect
170 msgprot="`mhparam msgprot`"
171 runandcheck "rcvstore <$MH_TEST_DIR/Mail/inbox/1" <<!
173 runandcheck "find $MH_TEST_DIR/Mail/inbox/23 -perm $msgprot" <<!
174 $MH_TEST_DIR/Mail/inbox/23
176 diff -u "`mhpath +inbox f`" "`mhpath +inbox l`"
179 # check Msg-Protect profile entry
181 printf 'Msg-Protect: %s\n' "$msgprot" >>"`mhparam defpath`"
182 runandcheck "rcvstore <$MH_TEST_DIR/Mail/inbox/1" <<!
184 runandcheck "find $MH_TEST_DIR/Mail/inbox/24 -perm $msgprot" <<!
185 $MH_TEST_DIR/Mail/inbox/24
187 diff -u "`mhpath +inbox f`" "`mhpath +inbox l`"