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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
sender="$SMTP_SENDER"
sendmail="$SMTP_SENDMAIL"
errors="$SMTP_ERRORS"
body="$ARGS_TMP"
to="$ARGS_TO"
cc="$ARGS_CC"
reply="$ARGS_REPLY"
dest="$to"
from="$ARGS_FROM"
subject="$ARGS_SUBJECT"
file="$ARGS_PATH"
mime=""
if test ! -z "$file" ; then
if test ! -f ${file} ; then
echo "$PORT_TSESSION error file-missing"
exit 0
fi
case ${file} in
*.au|*.au)
mime="audio/basic"
;;
*.txt|*.text|*.log)
mime="text/plain"
;;
*.wav)
mime="audio/x-wav"
;;
*.mp3)
mime="audio/mpeg"
;;
*.gif)
mime="image/gif"
;;
*.tif|*.tiff)
mime="image/tiff"
;;
*.jpg|*.jpeg)
mime="image/jpeg"
;;
*.htm|*.html)
mime="text/html"
;;
*.xml)
mime="application/xml"
;;
*.png)
mime="image/png"
;;
*.xpm)
mime="image/xpm"
;;
esac
fi
if test ! -z "$cc" ; then
$dest="$dest $cc" ; fi
if test ! -x ${sendmail} ; then
rm -f $tmp
echo "$PORT_TSESSION error sendmail-missing"
exit 0
fi
btsencode -e "$errors" -f "$from" -t "$to" -c "$cc" \
-s "$subject" -b "$body" -m "$mime" -a "$file" | \
${sendmail} -f $sender $dest
|