diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2014-01-09 15:28:05 -0800 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-02-03 12:36:26 +0200 |
commit | 3aa1a18313b173865903d9605ed0ada52579cd42 (patch) | |
tree | e364112257ff250bd13811e680375bf9907edf13 | |
parent | 7a853631541f4d87aba94b4cebdc35017bfd1d2e (diff) | |
download | aiaiai-3aa1a18313b173865903d9605ed0ada52579cd42.tar.gz |
email-test-patchset: fix a bug when project is unknown
This patch corrects an issue due to attempting to use cfg_reply_to_all (a
per-project configuration option) before we have checked whether the project
is valid. This causes the whole aiaiai-email service to die. To fix this, move
the checks for no project and unknown project above the cfg_reply_to_all use.
Also unassign the to variable when sending these emails so that we don't spam
everyone, (regardless of the reply_to_all setting). This restores the behavior
to the previous default.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rwxr-xr-x | email/aiaiai-email-test-patchset | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset index 83eff04..b32ab16 100755 --- a/email/aiaiai-email-test-patchset +++ b/email/aiaiai-email-test-patchset @@ -201,18 +201,9 @@ verbose "Project \"$prj\"" # Fetch project configuration parse_prj_config "$cfgfile" "$prj" -# Merge the "To" and "Cc" addresses -to="$(merge_addresses "$to" "$cc")" - -if [ "$cfg_reply_to_all" != "1" ]; then - to= -else - # Strip own address - to=$(strip_address "$to" "$cfg_ownmail") -fi - # Reject the e-mail if the project has not been specified if [ -z "$prj" ]; then + to= send_email <<EOF Sorry, but you have not specified the project name. Please, specify it using symbol "+" in the e-mail address of $ownname. @@ -228,6 +219,7 @@ fi # Check if we have this project in our config file if [ -z "$cfg_name" ]; then + to= send_email <<EOF Sorry, but project "$prj" is not supported. List of projects $cfg_ownname supports: @@ -238,6 +230,16 @@ EOF exit 0 fi +# Merge the "To" and "Cc" addresses +to="$(merge_addresses "$to" "$cc")" + +if [ "$cfg_reply_to_all" != "1" ]; then + to= +else + # Strip own address + to=$(strip_address "$to" "$cfg_ownmail") +fi + # Notify the sender that the patches have been accepted if [ "$cfg_accept_notify" = "1" ]; then message "Sending \"accepted\" e-mail" |