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'`
83 mhshowproc=`mhparam 'listproc'`
90 filename=`basename "$1"`
96 get_attachmentheader()
98 header=`mhparam 'Attachment-Header'`
103 anno -delete -number all -component 'last-editor' $mhmetafile
104 anno -nodate -component 'last-editor' -text "$1" $mhmetafile
113 mhmetafile=$mhdraft.meta
119 if [ -n "$mhaltmsg" ]
121 anno -nodate -component 'mhaltmsg' -text "$mhaltmsg" $mhmetafile
125 anno -nodate -component 'mhdist' -text "$mhdist" $mhmetafile
129 anno -nodate -component 'mhuse' -text "$mhuse" $mhmetafile
131 if [ -n "$mhfolder" ]
133 anno -nodate -component 'mhfolder' -text "$mhfolder" $mhmetafile
135 if [ -n "$mhmessages" ]
137 anno -nodate -component 'mhmessages' -text "$mhmessages" $mhmetafile
139 if [ -n "$mhannotate" ]
141 anno -nodate -component 'mhannotate' -text "$mhannotate" $mhmetafile
143 set_lasteditor "$mheditor"
144 exec $mheditor $mhdraft
156 set_lasteditor "$mheditor"
157 exec $mheditor $mhdraft
163 exec $mhshowproc -file $mhdraft
168 export mhaltmsg=`anno -list -component 'mhaltmsg' $mhmetafile`
169 export mhdist=`anno -list -component 'mhdist' $mhmetafile`
170 export mhuse=`anno -list -component 'mhuse' $mhmetafile`
171 export mhfolder=`anno -list -component 'mhfolder' $mhmetafile`
172 export mhmessages=`anno -list -component 'mhmessages' $mhmetafile`
173 export mhannotate=`anno -list -component 'mhannotate' $mhmetafile`
175 exec send "$@" $mhdraft
191 echo "file not found: $1" 1>&2
193 echo -n "folloing files are not attached: " 1>&2
198 file=`get_realpath "$1"`
199 anno -nodate -append -component $header -text "$file" $mhdraft
207 anno -list -number -component $header $mhdraft
215 anno -delete -component $header -number "$1" $mhdraft
218 echo "can't delet attachment $1" 1>&2
227 mhaltmsg=`anno -list -component 'mhaltmsg' $mhmetafile`
229 if [ -n "$mhaltmsg" ]
231 echo "no altmsg" 1>&2
234 exec $mhshowproc -file $mhaltmsg
246 draftfolder=`mhparam Draft-Folder`
247 if [ -z "$dratffolder" ]
249 draftfolder="+drafts"
251 mhdraft=`mhpath $draftfolder c 2>/dev/null`
262 echo "no current message in $draftsfolder" 1>&2
267 mhmetafile=$mhdraft.meta
276 [ $# -eq 0 ] || usage 1
283 [ $# -eq 0 ] || usage 1
287 [ $# -eq 0 ] || usage 1
294 [ $# -eq 0 ] || usage 1
301 refile -nolink -file $mhdraft "$@"