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 wrap: on
line diff
--- a/sendmultipart.sh	Mon Aug 03 18:00:35 2015 +0900
+++ b/sendmultipart.sh	Mon Aug 03 18:38:03 2015 +0900
@@ -1,9 +1,9 @@
 #!/bin/sh
 # send multipart message via email
-# (C)2012 by HIROSE Yuuji [yuuji(at)yatex.org]
+# (C)2012,2015 by HIROSE Yuuji [yuuji(at)yatex.org]
 # You can obtain the latest version of this script from:
 #   http://www.gentei.org/~yuuji/software/sendmultipart.sh
-# Last modified Sat Aug  1 16:00:31 2015 on firestorm
+# Last modified Mon Aug  3 18:37:19 2015 on firestorm
 #
 # Typical usage:
 #  echo "Hi, here's photo I've taken.  Enjoy" | \
@@ -79,11 +79,6 @@
   $cat $1
 }
 
-
-# if [ "$1" = "" ]; then
-#   usage
-# fi
-
 # Begin procedure
 if [ x"$rcpts" = x"" ]; then
   sendmail="cat"
@@ -114,12 +109,7 @@
 	cattextwithheader $file
 	;;
       *)
-	case `echo $file | tolower` in
-	  *.jpg|*.jpeg)	echo "Content-Type: Image/jpeg" ;;
-	  *.png)	echo "Content-Type: Image/png" ;;
-	  *.gif)	echo "Content-Type: Image/gif" ;;
-	  *)		echo "Content-Type: Application/Octet-Stream" ;;
-	esac
+	file --mime-type $file | cut -d' ' -f2
 	echo "Content-Transfer-Encoding: base64"
 	echo "Content-Disposition: inline; filename=\"$file\""
 	echo

yatex.org