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
|
#! /bin/sh -e
## 05attachfax by Joerg Dorchain
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Actually attach faxes to faxmail
## DP: (Closes: #238136)
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch) patch -f --no-backup-if-mismatch --dry-run -p1 < $0 && patch -f --no-backup-if-mismatch -p1 < $0;;
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
@DPATCH@
diff -Nuar efax-0.9a.orig/fax efax-0.9a/fax
--- efax-0.9a.orig/fax 2004-03-01 22:54:11.000000000 +0100
+++ efax-0.9a/fax 2003-08-15 17:04:47.000000000 +0200
@@ -482,13 +482,15 @@
cat $f
for f in $FILES
do
- echo "--EFAX_MAIL"
- echo "Content-Type: image/tiff; name=\"$f.tiff\""
- echo "Content-Transfer-Encoding: base64"
- echo "Content-Disposition: attachment; filename=\"$f.tiff\""
- echo ""
- $EFIX -M <$f
- # echo "--EFAX_MAIL--"
+ if [ -r $f ] ; then
+ echo "--EFAX_MAIL"
+ echo "Content-Type: image/tiff; name=\"$f.tiff\""
+ echo "Content-Transfer-Encoding: base64"
+ echo "Content-Disposition: attachment; filename=\"$f.tiff\""
+ echo ""
+ $EFIX -M <$f
+ # echo "--EFAX_MAIL--"
+ fi
done
echo "--EFAX_MAIL--"
}
@@ -525,7 +527,10 @@
0)
$RM $f
;;
- 1) FILES=`sed -n -e '/received ->/s/^.*-> \(.*\)$/\1/p' $f`
+ 1)
+# FILES=`sed -n -e '/received ->/s/^.*-> \(.*\)$/\1/p' $f`
+ FILES=`sed -n -e '/wrote /s/^.* wrote \(.*\) as .*$/\1/p' $f`
+
FILES=`echo $FILES`
REMID=`sed -n -e '/remote ID ->/s/^.*-> \(.*\)$/\1/p' \
-e tok -e b -e ':ok' -e q $f`
|