s4

changeset 98:70de8824f27e

sendmultipart.sh added to this repo.
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 03 Aug 2015 18:38:03 +0900
parents 7f9569a7e0ce
children 1bc7cc7487dc
files sendmultipart.sh
diffstat 1 files changed, 3 insertions(+), 13 deletions(-) [+]
line diff
     1.1 --- a/sendmultipart.sh	Mon Aug 03 18:00:35 2015 +0900
     1.2 +++ b/sendmultipart.sh	Mon Aug 03 18:38:03 2015 +0900
     1.3 @@ -1,9 +1,9 @@
     1.4  #!/bin/sh
     1.5  # send multipart message via email
     1.6 -# (C)2012 by HIROSE Yuuji [yuuji(at)yatex.org]
     1.7 +# (C)2012,2015 by HIROSE Yuuji [yuuji(at)yatex.org]
     1.8  # You can obtain the latest version of this script from:
     1.9  #   http://www.gentei.org/~yuuji/software/sendmultipart.sh
    1.10 -# Last modified Sat Aug  1 16:00:31 2015 on firestorm
    1.11 +# Last modified Mon Aug  3 18:37:19 2015 on firestorm
    1.12  #
    1.13  # Typical usage:
    1.14  #  echo "Hi, here's photo I've taken.  Enjoy" | \
    1.15 @@ -79,11 +79,6 @@
    1.16    $cat $1
    1.17  }
    1.18  
    1.19 -
    1.20 -# if [ "$1" = "" ]; then
    1.21 -#   usage
    1.22 -# fi
    1.23 -
    1.24  # Begin procedure
    1.25  if [ x"$rcpts" = x"" ]; then
    1.26    sendmail="cat"
    1.27 @@ -114,12 +109,7 @@
    1.28  	cattextwithheader $file
    1.29  	;;
    1.30        *)
    1.31 -	case `echo $file | tolower` in
    1.32 -	  *.jpg|*.jpeg)	echo "Content-Type: Image/jpeg" ;;
    1.33 -	  *.png)	echo "Content-Type: Image/png" ;;
    1.34 -	  *.gif)	echo "Content-Type: Image/gif" ;;
    1.35 -	  *)		echo "Content-Type: Application/Octet-Stream" ;;
    1.36 -	esac
    1.37 +	file --mime-type $file | cut -d' ' -f2
    1.38  	echo "Content-Transfer-Encoding: base64"
    1.39  	echo "Content-Disposition: inline; filename=\"$file\""
    1.40  	echo