diff -r 5f7c9c82b05e -r da313b67a04d Admin/isatest/pmail --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/isatest/pmail Mon Mar 05 22:12:20 2007 +0100 @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# +# $Id$ +# Author: Gerwin Klein, TU Muenchen +# +# DESCRIPTION: send email with text attachments. +# (works for "mail" command of SunOS 5.8) +# + +PRG="$(basename "$0")" + +MIME_BOUNDARY="==PM_=_37427935" + +function usage() +{ + echo + echo "Usage: $PRG subject recipient []" + echo + echo " Send email with text attachments. is a file." + echo + exit 1 +} + +function fail() +{ + echo "$1" >&2 + exit 2 +} + +# +# print_attachment +# +# print mime "encoded" to stdout (text/plain, 8bit) +# +function print_attachment() +{ + local FILE=$1 + local NAME=${FILE##*/} + + cat < [] +# +# prints mime "encoded" message with text attachments to stdout +# +function print_body() +{ + local SUBJECT=$1 + local BODY=$2 + shift 2 + + cat <