#!/bin/sh dashdash="" while [ "$1" != "" ] do if [ -n ${dashdash} ] then rcpts="${rcpts} $1" else case $1 in --) dashdash=y ;; -bm|-U) ;; -f|-r) shift EMAIL=$1 ;; -*) echo "Option $1 not supported" >&2 exit 1 ;; *) rcpts="${rcpts} $1" # Might also want to support: # -t = get recipients from headers; recipients on cmdline are EXCLUDED # -i = do NOT terminate on "." on a line by itself (what does msmtp do?) # -ti = -t -i esac fi shift done # Recipients might be separated by commas ??? if [ -z ${EMAIL} ] then EMAIL=`whoami`@`hostname -f` fi trap 'rm -f ${conffile}; exit 1' 0 conffile=`mktemp` cat > ${conffile} <