3 # Send multiples files and/or directories as a tar/compressed
4 # image, in a MIME message.
9 # compression method (none, gzip or compress)
13 # uncompression filter
15 # compression description to append to content-type
18 # default compression method based on installed software
19 # prefer compress over gzip for backward compatibility
20 if command -v compress >/dev/null 2>&1 ; then
22 elif command -v gzip >/dev/null 2>&1 ; then
26 # handle command-line options to override compression method
27 while [ $# -gt 3 ]; do
47 # set variables based on chosen compression method
48 if [ $METHOD = compress ]; then
51 CONVERSION="; x-conversions=compress"
52 elif [ $METHOD = gzip ]; then
55 CONVERSION="; x-conversions=gzip"
58 if [ ! -z "$PERSON" ]; then
63 echo 'usage: sendfiles: "mailpath" "subject-string" directory-or-file ...' 1>&2
68 echo "mailpath = $mailpath" 1>&2
72 echo "subject-string = $subject" 1>&2
75 echo "files = $*" 1>&2
77 tar cvf - "$@" | $COMPRESS | \
78 %libdir%/viamail -to "$mailpath" -subject "$subject" \
79 -parameters "type=tar$CONVERSION" \
80 -comment "extract with $UNCOMPRESS | tar xvpf -" \