Usually people using git send-email has git config sendmail.to
configured to the usual mailing list or person so we harness that
here.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
     harvest_recipients CC "^.*-[Bb][Yy]: *"
 fi
 
-if [ -z "$TO" ] && [ -z "$CC" ]; then
-    echo "ERROR: you have not specified any recipients."
-    usage
-    exit 1
-fi
-
 case "$PULL_MTA" in
     git)
         FROM="$(git config sendemail.from)"
+       AUTO_TO="$(git config sendemail.to)"
+       if [ -n "$AUTO_TO" ]; then
+           if [ -n "$TO" ]; then
+               TO="$TO,$AUTO_TO"
+           else
+               TO="$AUTO_TO"
+           fi
+       fi
         ;;
     sendmail)
         if [ -z "$FROM" ]; then
         ;;
 esac
 
+if [ -z "$TO" ] && [ -z "$CC" ]; then
+    echo "ERROR: you have not specified any recipients."
+    usage
+    exit 1
+fi
+
+
 # Generate report for the user and require confirmation before sending
 cat <<EOM
 The following patches: