File: sendfiles

package info (click to toggle)
nmh 1.0.2-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,172 kB
  • ctags: 4,449
  • sloc: ansic: 50,696; sh: 1,799; makefile: 1,192; awk: 74; sed: 17
file content (42 lines) | stat: -rwxr-xr-x 783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#
# $Id: sendfiles,v 1.1.1.1 1999/04/30 18:08:35 doug Exp $
#
# Send multiples files and/or directories as a tar/gzip
# image, in a MIME message.
#

DELAY=0
FROM=

case "$1" in
    -*)	DELAY="`echo $1 | sed -e 's%-%%'`"
	shift
	;;
esac

if [ ! -z "$PERSON" ]; then
    FROM="-from $PERSON"
fi

if [ $# -lt 3 ]; then
    echo 'usage: sendfiles: "mailpath" "subject-string" directory-or-file ...' 1>&2
    exit 1;
fi

mailpath="$1"
echo "mailpath = $mailpath" 1>&2
shift

subject="$1"
echo "subject-string = $subject" 1>&2
shift

echo "files = $*" 1>&2

tar cvf - "$@" | gzip -c | \
    /usr/lib/mh/viamail -to "$mailpath" -subject "$subject" \
	-parameters "type=tar; x-conversions=gzip" \
	-comment "extract with gzip -dc | tar xvpf -" \
	-delay "$DELAY" \
	-verbose $FROM