diff octave-bug.in @ 7171:9bc096bc59d4

[project @ 2007-11-13 18:02:51 by jwe]
author jwe
date Tue, 13 Nov 2007 18:02:52 +0000
parents 4270ded9ddc6
children c5a024013d2d
line wrap: on
line diff
--- a/octave-bug.in	Tue Nov 13 17:34:33 2007 +0000
+++ b/octave-bug.in	Tue Nov 13 18:02:52 2007 +0000
@@ -350,24 +350,29 @@
 
 # Now try to mail it.
 
-    ( /bin/mail $BUGADDR < $TEMP.x ) > /dev/null 2>&1
-    status=$?
+    # indicate that we have not yet sent email successfully
+    status=11
+
     if test $status -ne 0; then
-      ( Mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1
+      ( mailx -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1
       status=$?
       if test $status -ne 0; then
-	( /usr/ucb/mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1
-	status=$?
-	if test $status -ne 0; then
-	  ( mailx -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1
-	  status=$?
-	fi
+        ( Mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1
+        status=$?
+        if test $status -ne 0; then
+          ( /usr/ucb/mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1
+          status=$?
+          # make /bin/mail our last resort -- it ignores the subject line
+          if test $status -ne 0; then
+            ( /bin/mail $BUGADDR < $TEMP.x ) > /dev/null 2>&1
+            status=$?
+            if test $status -ne 0; then
+              echo "unable to send mail..."
+            fi
+          fi
+        fi
       fi
     fi
-
-    if test $status -ne 0; then
-      echo "unable to send mail..."
-    fi
   fi
 fi