/usr/bin/mh/sendfiles is in mmh 0.3-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
#
# Send multiples files non-interactively
# adjust if needed
attachment_header=`mhparam Attachment-Header`
if [ $# -lt 3 ]; then
echo 'usage: sendfiles RECIPIENT SUBJECT FILES...' 1>&2
exit 1;
fi
rcpt="$1"
shift
subject="$1"
shift
cat 1>&2 <<!
Recipient: $rcpt
Subject: $subject
Files: $*
!
draft=`mktemp /tmp/sendfiles.XXXXXX`
trap 'rm -f "$draft"' 1 2 15
anno "$draft" -component To -text "$rcpt" -nodate
anno "$draft" -component Subject -text "$subject" -nodate
for i in "$@" ; do
anno "$draft" -component "$attachment_header" -text "$i" -nodate
done
send "$draft"
|