This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 840598b Move check to location where @from is defined
840598b is described below
commit 840598bf738ca60aaaecb48c6b91ddbdee0aeeb9
Author: Sebb <[email protected]>
AuthorDate: Thu Feb 11 12:43:45 2021 +0000
Move check to location where @from is defined
Also allow '-' in email name
---
www/secretary/workbench/views/actions/icla.json.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/www/secretary/workbench/views/actions/icla.json.rb
b/www/secretary/workbench/views/actions/icla.json.rb
index efc6670..5a31fd3 100644
--- a/www/secretary/workbench/views/actions/icla.json.rb
+++ b/www/secretary/workbench/views/actions/icla.json.rb
@@ -10,8 +10,6 @@
# extract message
message = Mailbox.find(@message)
-_warn "Invalid From address '#{@from}'" unless @from =~
/\A("?[\s\w]+"?\s+<)?\w+@apache\.org>?\z/
-
# extract file extension
fileext = File.extname(@selected).downcase
@@ -128,6 +126,10 @@ task "email #@email" do
# Process podling after PMC otherwise podling applicants are directed to IPMC
@cttee = "Apache #{@podling.display_name} podling" if @podling
# build mail from template
+
+ # N.B. it appears that @from is not defined outside the task block
+ _warn "Invalid From address '#{@from}'" unless @from =~
/\A("?[\s\w]+"?\s+<)?[-\w]+@apache\.org>?\z/
+
mail = message.reply(
subject: @document,
from: @from,