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"`
81 get_attachmentheader()
83 header=`mhparam 'Attachment-Header'`
88 anno -delete -number all -component 'last-editor' $mhmetafile
89 anno -nodate -component 'last-editor' -text "$1" $mhmetafile
98 mhmetafile=$mhdraft.meta
104 if [ -n "$mhaltmsg" ]
106 anno -nodate -component 'mhaltmsg' -text "$mhaltmsg" $mhmetafile
110 anno -nodate -component 'mhdist' -text "$mhdist" $mhmetafile
114 anno -nodate -component 'mhuse' -text "$mhuse" $mhmetafile
116 if [ -n "$mhfolder" ]
118 anno -nodate -component 'mhfolder' -text "$mhfolder" $mhmetafile
120 if [ -n "$mhmessages" ]
122 anno -nodate -component 'mhmessages' -text "$mhmessages" $mhmetafile
124 if [ -n "$mhannotate" ]
126 anno -nodate -component 'mhannotate' -text "$mhannotate" $mhmetafile
128 set_lasteditor "$mheditor"
129 exec $mheditor $mhdraft
141 set_lasteditor "$mheditor"
142 exec $mheditor $mhdraft
148 exec $mhshowproc -file $mhdraft
153 export mhaltmsg=`anno -list -component 'mhaltmsg' $mhmetafile`
154 export mhdist=`anno -list -component 'mhdist' $mhmetafile`
155 export mhuse=`anno -list -component 'mhuse' $mhmetafile`
156 export mhfolder=`anno -list -component 'mhfolder' $mhmetafile`
157 export mhmessages=`anno -list -component 'mhmessages' $mhmetafile`
158 export mhannotate=`anno -list -component 'mhannotate' $mhmetafile`
160 exec send "$@" $mhdraft
165 folder -push $draftfolder >/dev/null 2>&1
167 folder -pop >/dev/null 2>&1
178 echo "file not found: $1" 1>&2
180 echo -n "folloing files are not attached: " 1>&2
185 file=`get_realpath "$1"`
186 anno -nodate -append -component $header -text "$file" $mhdraft
194 anno -list -number -component $header $mhdraft
202 anno -delete -component $header -number "$1" $mhdraft
205 echo "can't delet attachment $1" 1>&2
214 mhaltmsg=`anno -list -component 'mhaltmsg' $mhmetafile`
216 if [ -n "$mhaltmsg" ]
218 echo "no altmsg" 1>&2
221 exec $mhshowproc -file $mhaltmsg
233 draftfolder="mhparam draftfolder"
235 mhdraft=`mhpath $draftfolder c 2>/dev/null`
246 echo "no current message in $draftsfolder" 1>&2
251 mhmetafile=$mhdraft.meta
260 [ $# -eq 0 ] || usage 1
267 [ $# -eq 0 ] || usage 1
270 di|dis|disp|displ|displa|display)
271 [ $# -eq 0 ] || usage 1
274 at|att|atta|attac|attach)
278 [ $# -eq 0 ] || usage 1
281 det|deta|detac|detach)
284 r|re|ref|refi|refil|refile)
285 refile -file $mhdraft "$@"
293 -V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version)