#!/bin/sh
if [ -z "$1" -o "$1" = "--help"  -o "$1" = "-h" -o -z "$2" ]; then
    PROGRAM=`basename $0`
    fmt <<EOF

Usage: $PROGRAM FROM TO [IFILEOPTIONS].

Standard-in should be an email (see RFC822).  The email is
MIME-decoded and inserted into ifile's database (~/.idata) under
category TO, and removed from category FROM.  If present, IFILEOPTIONS
are passed on to ifile.

EOF
    exit 1 
fi

FROM="$1"
TO="$2"
shift 2
mail-preprocess | \
ifile -w -d "$FROM" -u "$TO" $@ 
