rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | README | LICENSE

rprepl (450B)


      1 #!/bin/sh
      2 
      3 BASE="$(rppath -b)"
      4 
      5 if [ ! -x $BASE/tmpl/repl.sh ];
      6 then
      7 	echo "$BASE/tmpl/repl.sh does not exist. Will" \
      8 	       "not proceed."
      9 	exit 1
     10 fi
     11 
     12 tmpfile=$(mktemp)
     13 signalh() {
     14 	rm -f $tmpfile
     15 }
     16 trap 'signalh' 3 6 9 15 
     17 
     18 dfolder=$(rpcfg -v fold_drafts)
     19 
     20 $BASE/tmpl/repl.sh "$@" > $tmpfile
     21 if [ $? -gt 0 ];
     22 then
     23 	rm -f $tempfile
     24 	exit 1
     25 fi
     26 
     27 mid=$(rpadd -m $dfolder -f seen $tmpfile)
     28 signalh
     29 
     30 if [ $? -eq 0 ];
     31 then
     32 	rpedit -m $dfolder $mid 
     33 fi
     34