#!/bin/sh
#set -x	###

# quick hack to catch addresses and see where to put the file

# leave all of the fcc-save-hook logic in muttrc and then pass this
# %O thanks to the fmtpipe patch and we'll strip from there

# someday we might get clever enough to move all of the logic in HERE
# and then handle the problem of
#   fcc-save-hook bob =Work/%O
#   fcc-save-hook sue =Play/%O
#   To: bob, sue ==> =Play/bob
# but let's take one thing at a time...

# how to suppress newline?
if [ "`echo -n foo`" = "-n foo" ] ; then ECHOC="\c" ; else ECHON="-n" ; fi

case $1 in
  *-dated-* )					# tmda dated addresses
    echo $ECHON "=$1$ECHOC" | sed "s/-dated.*//" 
    ;;
  * )						# everything else
    echo $ECHON "=$*$ECHOC" | tr ' ' '_'	# debugging, but just in case
    ;;
esac

