Admin/isatest/pmail
changeset 48252 e98c3d50ae62
parent 48172 41222a782780
equal deleted inserted replaced
48251:6cdcfbddc077 48252:e98c3d50ae62
    55 #
    55 #
    56 function print_body()
    56 function print_body()
    57 {
    57 {
    58     local SUBJECT=$1
    58     local SUBJECT=$1
    59     local BODY=$2
    59     local BODY=$2
    60     shift 2
    60     local TO=$3
       
    61     shift 3
    61 
    62 
    62     cat <<EOF
    63     cat <<EOF
    63 Subject: $SUBJECT
    64 Subject: $SUBJECT
       
    65 To: $TO
    64 Mime-Version: 1.0
    66 Mime-Version: 1.0
    65 Content-Type: multipart/mixed; boundary="$MIME_BOUNDARY"
    67 Content-Type: multipart/mixed; boundary="$MIME_BOUNDARY"
    66 
    68 
    67 --$MIME_BOUNDARY
    69 --$MIME_BOUNDARY
    68 Content-Type: text/plain
    70 Content-Type: text/plain
    91 
    93 
    92 shift 3
    94 shift 3
    93 
    95 
    94 [ -r "$BODY" ] || fail "could not read $BODY"
    96 [ -r "$BODY" ] || fail "could not read $BODY"
    95 
    97 
    96 case `uname` in
    98 case `hostname` in
    97 	Linux)  for F in $@; do ATTACH="$ATTACH -a $F"; done
    99 	lxbroy*)
       
   100 		print_body "$SUBJECT" "$BODY" "$TO" $@ | sendmail "$TO"
       
   101 		;;
       
   102 	macbroy*)  for F in $@; do ATTACH="$ATTACH -a $F"; done
    98 		cat "$BODY" | mail -s "$SUBJECT" $ATTACH "$TO"
   103 		cat "$BODY" | mail -s "$SUBJECT" $ATTACH "$TO"
    99 		;;
   104 		;;
   100 	SunOS)
   105 	sunbroy*)
   101 		print_body "$SUBJECT" "$BODY" $@ | mail -t "$TO"
   106 		print_body "$SUBJECT" "$BODY" "$TO" $@ | mail -t "$TO"
       
   107 		;;
       
   108 	*)
       
   109 		fail "unknown host/platform"
   102 		;;
   110 		;;
   103 esac
   111 esac