3 # Send multiples files and/or directories as a tar/compressed
4 # image, in a MIME message.
10 # compression method (none, gzip or compress)
14 # uncompression filter
16 # compression description to append to content-type
19 # default compression method based on installed software
20 # prefer compress over gzip for backward compatibility
21 if command -v compress >/dev/null 2>&1 ; then
23 elif command -v gzip >/dev/null 2>&1 ; then
27 # handle command-line options to override compression method and delay
28 while [ $# -gt 3 ]; do
43 DELAY="`echo $1 | sed -e 's%-%%'`"
52 # set variables based on chosen compression method
53 if [ $METHOD = compress ]; then
56 CONVERSION="; x-conversions=compress"
57 elif [ $METHOD = gzip ]; then
60 CONVERSION="; x-conversions=gzip"
63 if [ ! -z "$PERSON" ]; then
68 echo 'usage: sendfiles: "mailpath" "subject-string" directory-or-file ...' 1>&2
73 echo "mailpath = $mailpath" 1>&2
77 echo "subject-string = $subject" 1>&2
80 echo "files = $*" 1>&2
82 tar cvf - "$@" | $COMPRESS | \
83 %libdir%/viamail -to "$mailpath" -subject "$subject" \
84 -parameters "type=tar$CONVERSION" \
85 -comment "extract with $UNCOMPRESS | tar xvpf -" \