]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 379] adds NOTIFY_FAXMASTER option for FaxDispatch
authorDarren Nickerson <darren.nickerson@ifax.com>
Sun, 9 Feb 2003 02:39:33 +0000 (02:39 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Sun, 9 Feb 2003 02:39:33 +0000 (02:39 +0000)
Allow flexible control of notification to FaxMaster on inbound faxes.
Previous default would see FaxMaster being mailbombed ;-). Thanks Lee!

man/faxrcvd.1m
util/faxrcvd.sh.in

index c517623f327c83f8d3f39776c32660c9dde0d228..76f5156aa57b619914cbe73c50b0c46da784d76b 100644 (file)
@@ -132,6 +132,14 @@ is equivalent to
 .B error-msg
 above.
 .TP
+.I NOTIFY_FAXMASTER
+(an underscore ``_'' character is between NOTIFY and FAXMASTER)
+indicates whether or not the HylaFAX administrator should be notified
+regarding incoming facsimile.  Default is ``always''.  Also available are
+``never'', which means to never send any received facsimile notification,
+and ``errors'', which means to send notification only if there were
+reception errors.
+.TP
 .I SENDER
 is the received TSI of the fax sender.
 .TP
index ac39a6b96bab898fd5c4af1154f81e6e3b646bd5..dff739c8e1fc4455b8e6bbbc5d3abf0afd591972 100644 (file)
@@ -59,6 +59,7 @@ TIFF2PS=tiff2ps
 PS2PDF=ps2pdf
 TOADDR=FaxMaster
 TIFFINFO=tiffinfo
+NOTIFY_FAXMASTER=always
 
 #
 # Permit various types of attachment types: ps, tif, pdf
@@ -97,7 +98,16 @@ if [ -f $FILE ]; then
     if [ -f etc/FaxDispatch ]; then
        . etc/FaxDispatch       # NB: FaxDispatch sets SENDTO
     fi
-    if [ "$TOADDR" != "$SENDTO" ]; then # don't send FaxMaster duplicate
+    #
+    # Don't send FaxMaster duplicates, and FaxMaster may not even
+    # want a message at all, depending on NOTIFY_FAXMASTER.
+    #
+    case $NOTIFY_FAXMASTER$MSG in
+       never*)         NOTIFY_FAXMASTER=no;;
+       errors)         NOTIFY_FAXMASTER=no;;
+       *)              NOTIFY_FAXMASTER=yes;;
+    esac
+    if [ "$TOADDR" != "$SENDTO" -a "$NOTIFY_FAXMASTER" != "no" ]; then
        (echo "To: $TOADDR"
         echo "From: The HylaFAX Receive Agent <fax>"
         echo "Subject: Facsimile received from $SENDER";