This patch allows to convert received faxes to multiple files, e.g.
FILETYPE="tiff pdf" # separated by whitespace
will create two attachments: one (original, unchanged) TIFF file, and a PDF
file. This is meant both as a safety belt to protect against failing
TIFF-to-something conversion, and as a convenience for users using different
fax readers.
From: Helge Oldach <hylafax@oldach.net>
.I FILETYPE
controls the filetype of the image attachment. Current
filetype options are ``ps'', ``tif'', and ``pdf''.
+Multiple values may be specified by separating them with
+whitespace. In that case a separate attachment is created
+for each filetype.
.TP
.I FROMADDR
controls the sender of the received fax notification. It is
.B SENDER
address along with the notification message. The ``original'' setting
uses the format type that was used in the submission.
+Multiple values may be specified by separating them with
+whitespace. In that case a separate attachment is created
+for each filetype.
.TP
.I RETURNTECHINFO
defaults to ``yes'' and is used to indicate whether or not technical
# Permit various types of attachment types: ps, tif, pdf
# Note that non-ASCII filetypes require an encoder.
# pdf requires tiff2ps and tiff2pdf
+# Multiple file types may be specified by separating them with
+# whitespace; in that case a separate attachment for each filetype
+# will be created.
#
FILETYPE=ps
SENDTO=
files_1=$FILE;
filetype_1=TIFF;
nfiles=1;
- ATTACH_ARGS=`BuildAttachArgs $FILETYPE`
+ for ft in $FILETYPE
+ do
+ ATTACH_ARGS="$ATTACH_ARGS "`BuildAttachArgs $ft`
+ done
eval CreateMailMessage $template $ATTACH_ARGS \
2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$SENDTO"
# If it is a pager job, and notify-$WHY-page.txt does *not* exist, it
# will use the notify-$WHY.txt template.
#
-# It honours the RETURNFILETYPE varialbe that can be set by FaxNotify.
+# It honours the RETURNFILETYPE variable that can be set by FaxNotify.
# If it is set, it will return *all* the submitted documents as attachments
# with the e-mail, converted to the RETURNFILETYPE.
+# Multiple file types may be specified by separating them with
+# whitespace; in that case a separate attachment for each filetype
+# will be created.
if [ $# != 3 ] && [ $# != 4 ]; then
echo "Usage: $0 qfile why jobtime [nextTry]"
# be set to their non-customized defaults prior to this.
#
if [ -f etc/FaxNotify ]; then
- # source notify preferecnes
+ # source notify preferences
. etc/FaxNotify
fi
if [ -n "$RETURNFILETYPE" ]; then
- ATTACH_ARGS=`BuildAttachArgs $RETURNFILETYPE`
+ for ft in $RETURNFILETYPE
+ do
+ ATTACH_ARGS="$ATTACH_ARGS "`BuildAttachArgs $ft`
+ done
fi
template="etc/templates/$TEMPLATE/notify-$WHY.txt"
# Permit various types of attachment types: ps, tif, pdf
# Note that non-ASCII filetypes require an encoder.
# pdf requires tiff2ps and tiff2pdf
+# Multiple file types may be specified by separating them with
+# whitespace; in that case a separate attachment for each filetype
+# will be created.
#
FILETYPE=ps
files_1=$FILE;
filetype_1=TIFF;
nfiles=1;
- ATTACH_ARGS=`BuildAttachArgs $FILETYPE`
+ for ft in $FILETYPE
+ do
+ ATTACH_ARGS="$ATTACH_ARGS "`BuildAttachArgs $ft`
+ done
eval CreateMailMessage "$template" $ATTACH_ARGS \
2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$SENDTO"