aboutsummaryrefslogtreecommitdiffstats
path: root/mail/biabam/files/patch-biabam
blob: aa6a16ac80a67690774700b2aaf3dffb9967e7f7 (plain) (blame)
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
73
74
75
76
77
78
79
80
81
82
83
--- biabam.orig Tue Dec 21 00:08:38 2004
+++ biabam  Tue Dec 21 00:10:02 2004
@@ -33,15 +33,15 @@
   exit 1
 fi
 
-if ! which uuencode > /dev/null; then
-  echo "This program needs the uuencode utility to perform base64 encoding."
+if ! which b64encode > /dev/null; then
+  echo "This program needs the b64encode utility to perform base64 encoding."
   exit 1
 fi
 
 # Find out the number of files to attach
 TOTAL_ATTACHMENTS=`echo "$1" | awk -F$SP '{print NF}'`
 
-for i in `seq 1 $TOTAL_ATTACHMENTS`;
+for i in `jot $TOTAL_ATTACHMENTS 1`;
 do
   STR="'{print \$$i}'"
   # store filenames in an array
@@ -55,7 +55,7 @@
 
 BASETEMP="`basename $TEMPFILE`"
 
-for i in `seq 1 $TOTAL_ATTACHMENTS`; do
+for i in `jot $TOTAL_ATTACHMENTS 1`; do
   # array for attachments basename
   BASEATTACHMENT[$i]="`basename \"${ARR_ATTACHMENTS[$i]}\"`"
   # test if file exists
@@ -78,7 +78,7 @@
     TYPE[$i]=${MIME:-application/unknown}
   fi
 
-  uuencode --base64 -- "${ARR_ATTACHMENTS[$i]}" "${BASEATTACHMENT[$i]}" | \
+  b64encode -- "${ARR_ATTACHMENTS[$i]}" "${BASEATTACHMENT[$i]}" | \
   sed '1d;$d' > ${TEMPUUENCODED[$i]}
 done
 
@@ -97,7 +97,7 @@
 # Find out the number of recipients to send the email
 TOTAL_EMAILS=`echo "$1" | awk -F$SP '{print NF}'`
 
-for i in `seq 1 $TOTAL_EMAILS`; do
+for i in `jot $TOTAL_EMAILS 1`; do
   STR="'{print \$$i}'"
   # store recipients in an array
   ARR_EMAILS[$i]=`sh -c "echo "$1" | awk -F$SP $STR" `
@@ -105,7 +105,7 @@
 
 TO="To:"
 
-for i in `seq 1 $TOTAL_EMAILS`; do
+for i in `jot $TOTAL_EMAILS 1`; do
   # write the 'To:' field with all recipients previously stored in the array
   TO="$TO <${ARR_EMAILS[$i]}>,"
 done
@@ -129,7 +129,7 @@
 cat >> $TEMPFILE
 echo >> $TEMPFILE
 
-for i in `seq 1 $TOTAL_ATTACHMENTS`; do
+for i in `jot $TOTAL_ATTACHMENTS 1`; do
   echo "--$BOUNDARY" >> $TEMPFILE
   echo "Content-Type: ${TYPE[$i]}" >> $TEMPFILE
   echo "Content-Disposition: attachment; filename=\"${BASEATTACHMENT[$i]}\"" >> $TEMPFILE
@@ -143,14 +143,14 @@
 echo "--$BOUNDARY--" >> $TEMPFILE
 echo >> $TEMPFILE
 
-for i in `seq 1 $TOTAL_EMAILS`; do
+for i in `jot $TOTAL_EMAILS 1`; do
   # put all recipients together to call sendmail below
   RECIPIENTS="$RECIPIENTS ${ARR_EMAILS[$i]}"
 done
 
 cat $TEMPFILE | $SENDMAIL $SENDMAIL_OPTS $RECIPIENTS # here we call sendmail
 
-for i in `seq 1 $TOTAL_ATTACHMENTS`; do
+for i in `jot $TOTAL_ATTACHMENTS 1`; do
   /bin/rm -f ${TEMPUUENCODED[$i]} # remove all temp files created
 done