use anno and mhparam in sendfiles
authorPhilipp Takacs <philipp@bureaucracy.de>
Wed, 23 Sep 2015 11:15:31 +0000 (13:15 +0200)
committerPhilipp Takacs <philipp@bureaucracy.de>
Sun, 11 Oct 2015 14:37:47 +0000 (16:37 +0200)
uip/sendfiles.sh

index 40d8f72..66fc7ec 100755 (executable)
@@ -3,7 +3,7 @@
 # Send multiples files non-interactively
 
 # adjust if needed
-attachment_header='Attach'
+attachment_header=`mhparam Attachment-Header`
 
 
 if [ $# -lt 3 ]; then
@@ -24,12 +24,11 @@ Files:     $*
 
 draft=`mktemp /tmp/sendfiles.XXXXXX`
 trap 'rm -f "$draft"' 1 2 3 15
-cat >"$draft" <<!
-To: $rcpt
-Subject: $subject
-!
+
+anno "$draft" -component To -text "$rcpt" -nodate
+anno "$draft" -component Subject -text "$subject" -nodate
 for i in "$@" ; do
-       echo "$attachment_header: $i" >>"$draft"
+       anno "$draft" -component  "$attachment_header" -text "$i" -nodate
 done
 
 send "$draft"