--- src/etc/script/sympa.in.orig	2019-01-29 00:00:03.000000000 -0800
+++ src/etc/script/sympa.in	2020-05-14 11:52:47.000000000 -0700
@@ -45,10 +45,14 @@
 fi
 
 # OSTYPE *is* defined on Solaris 10! (bug #3149)
+# OSTYPE has many variants on darwin platforms
 case "$OSTYPE" in
 *solaris*)
     OSTYPE=SunOS
     ;;
+*darwin*)
+    OSTYPE=darwin
+    ;;
 Linux)
     if [ -f /etc/SuSE-release ] ; then
 	OSDIST='Suse'
@@ -66,8 +70,8 @@
     ;;
 esac
 
-##'echo -n' not supported with SH on Solaris
-if [ ${OSTYPE} = "SunOS" ]; then
+##'echo -n' not supported with SH on Solaris or darwin
+if [ "${OSTYPE}" = "SunOS" -o "${OSTYPE}" = "darwin"  ]; then
   echo_opt=""
 else
   echo_opt="-n"
@@ -98,7 +102,7 @@
 		    if [ "$OSTYPE" = "BSD" ]; then
 			running=`ps -axw | grep "^[[:space:]]*$pid[[:space:]]"`
 		    else
-			running=`ps -A | grep "$pid ..* $comm"`
+			running=`ps -A | grep "$pid.*$comm"`
 		    fi
 		    if [ "$running" != "" ]; then
 			runningpids="$runningpids $pid"
@@ -220,7 +224,7 @@
 		    if [ "$OSTYPE" = "BSD" ]; then
 			running=`ps -axw | grep "^[[:space:]]*$pid[[:space:]]"`
 		    else
-			running=`ps -A | grep "$pid ..* $comm"`
+			running=`ps -A | grep "$pid.*$comm"`
 		    fi
 		    if [ "$running" = "" ]; then
 			runcount=`expr $runcount + 1`
@@ -230,7 +234,7 @@
 		    if [ "$OSTYPE" = "BSD" ]; then
 			running=`ps -axw | grep "^[[:space:]]*$pid[[:space:]]"`
 		    else
-			running=`ps -A | grep "$pid ..* $comm"`
+			running=`ps -A | grep "$pid .*$comm"`
 		    fi
 		    if [ "$running" = "" ]; then
 			runcount=`expr $runcount + 1`
@@ -258,7 +262,7 @@
 
 
 # Check that networking is up.
-if [ ${OSTYPE} != "Linux" -a ${OSTYPE} != "BSD" -a ${OSTYPE} != "SunOS" -a ${OSTYPE} != "Darwin" ]; then
+if [ ${OSTYPE} != "Linux" -a ${OSTYPE} != "BSD" -a ${OSTYPE} != "SunOS" -a ${OSTYPE} != "darwin" ]; then
     if [ "${NETWORKING}" = "no" ]
     then
 	    exit 0
