From 18e103e50d5b8579dc630933bda21edda010a352 Mon Sep 17 00:00:00 2001
From: Matthew Saunders Brown <msb@stackaas.com>
Date: Wed, 20 Apr 2022 11:56:19 -0700
Subject: [PATCH] remove unneeded --shell option from sudo, fix
 mbox_ratelimit_default

---
 bin/vmail-domains-add.sh | 6 +++---
 bin/vmail.sh             | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/vmail-domains-add.sh b/bin/vmail-domains-add.sh
index 7dd800d..fe06f68 100755
--- a/bin/vmail-domains-add.sh
+++ b/bin/vmail-domains-add.sh
@@ -31,8 +31,8 @@ vmail:getoptions "$@"
 
 # check for domain
 if [[ -z $domain ]]; then
-  echo "domain name is required"
-  exit
+  echo "ERROR: domain name is required"
+  exit 1
 fi
 
 # set initial db query data
@@ -85,7 +85,7 @@ if [ "$rowcount" -eq '0' ] ; then
     if [[ "$ratelimit" == "NULL" ]]; then
       dbquery="$dbquery, mbox_ratelimit_default=NULL"
     elif [[ "$ratelimit" =~ ^[0-9]+$ ]]; then
-      dbquery="$dbquery, mbox_quota_default='$ratelimit'"
+      dbquery="$dbquery, mbox_ratelimit_default='$ratelimit'"
     else
       echo "ERROR: ratelimit (-r) must numeric or NULL"
       exit 1
diff --git a/bin/vmail.sh b/bin/vmail.sh
index 007af19..c6ebf67 100755
--- a/bin/vmail.sh
+++ b/bin/vmail.sh
@@ -13,15 +13,15 @@ readonly MYSQL_CONNECTION_INFO_FILE=$VMAIL_DIR/.my.cnf
 # switch to required user
 if [[ $(basename $0) == "vmail-dkim-"* ]]; then
   if [[ "$USER" != "Debian-exim" ]]; then
-    exec sudo -u Debian-exim -g ssl-cert --shell /bin/bash $0 $@
+    exec sudo -u Debian-exim -g ssl-cert $0 $@
   fi
 elif [[ $(basename $0) == "vmail-purge-spool.sh" ]]; then
   if [[ "$USER" != "Debian-exim" ]]; then
-    exec sudo -u Debian-exim --shell /bin/bash $0 $@
+    exec sudo -u Debian-exim $0 $@
   fi
 else
   if [[ "$USER" != "vmail" ]]; then
-    exec sudo -u vmail --shell /bin/bash $0 $@
+    exec sudo -u vmail $0 $@
   else
     # check that MYSQL_CONNECTION_INFO_FILE exists and is readable
     if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then