5 echo "Usage: $0 command"
9 echo " send [sendargs]"
15 echo " refile +folder"
24 echo "$0 has no own version number, thus this instead:"
28 echo "$0 has no own version number, thus this instead:" 1>&2
46 if [ -f "$mhmetafile" ]
48 lasteditor=`anno -list -component 'last-editor' $mhmetafile`
49 if [ -n "$lasteditor" ]
51 editor=`echo $lasteditor | cut -d ' ' -f 1`
52 mheditor=`mhparam "$editor-next"`
53 [ -n "$mheditor" ] && return
58 if [ -n "$MMHEDITOR" ]
63 mheditor=`mhparam 'Editor'`
68 mhshowproc=`mhparam 'listproc'`
75 filename=`basename "$1"`
83 anno -delete -number all -component 'last-editor' $mhmetafile
84 anno -nodate -component 'last-editor' -text "$1" $mhmetafile
93 mhmetafile=$mhdraft.meta
103 if [ -n "$mhaltmsg" ]
105 anno -nodate -component 'mhaltmsg' -text "$mhaltmsg" $mhmetafile
109 anno -nodate -component 'mhdist' -text "$mhdist" $mhmetafile
111 if [ -n "$mhfolder" ]
113 anno -nodate -component 'mhfolder' -text "$mhfolder" $mhmetafile
115 if [ -n "$mhmessages" ]
117 anno -nodate -component 'mhmessages' -text "$mhmessages" $mhmetafile
119 if [ -n "$mhannotate" ]
121 anno -nodate -component 'mhannotate' -text "$mhannotate" $mhmetafile
123 set_lasteditor "$mheditor"
124 exec $mheditor $mhdraft
136 set_lasteditor "$mheditor"
137 exec $mheditor $mhdraft
143 exec $mhshowproc -file $mhdraft
148 export mhaltmsg=`anno -list -component 'mhaltmsg' "$mhmetafile"`
149 export mhdist=`anno -list -component 'mhdist' "$mhmetafile"`
150 export mhfolder=`anno -list -component 'mhfolder' "$mhmetafile"`
151 export mhmessages=`anno -list -component 'mhmessages' "$mhmetafile"`
152 export mhannotate=`anno -list -component 'mhannotate' "$mhmetafile"`
153 send "$@" "$mhdraft" || exit $?
160 folder -push "$draftfolder" >/dev/null 2>&1
162 folder -pop >/dev/null 2>&1
168 header=`mhparam 'Attachment-Header'`
173 echo "file not found: $1" 1>&2
175 echo -n "folloing files are not attached: " 1>&2
180 file=`get_realpath "$1"`
181 anno -nodate -append -component "$header" -text "$file" "$mhdraft"
188 header=`mhparam 'Attachment-Header'`
189 anno -list -number -component "$header" "$mhdraft"
194 header=`mhparam 'Attachment-Header'`
197 anno -delete -component "$header" -number "$1" "$mhdraft"
200 echo "can't delet attachment $1" 1>&2
209 mhaltmsg=`anno -list -component 'mhaltmsg' "$mhmetafile"`
211 if [ -z "$mhaltmsg" ]
213 echo "no altmsg" 1>&2
216 exec $mhshowproc -file "$mhaltmsg"
228 draftfolder=`mhparam draftfolder`
230 mhdraft=`mhpath "$draftfolder" c 2>/dev/null`
237 -V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version)
241 echo "no current message in $draftfolder" 1>&2
246 mhmetafile="$mhdraft".meta
255 [ $# -eq 0 ] || usage 1
261 del|dele|delet|delete)
262 [ $# -eq 0 ] || usage 1
265 di|dis|disp|displ|displa|display)
266 [ $# -eq 0 ] || usage 1
269 at|att|atta|attac|attach)
273 [ $# -eq 0 ] || usage 1
276 det|deta|detac|detach)
279 r|re|ref|refi|refil|refile)
280 refile -file "$mhdraft" "$@"
288 -V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version)