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 bc7e29f simplify bc7e29f is described below commit bc7e29f8026e378ee360ff22227c0369adb4235b Author: Sebb <s...@apache.org> AuthorDate: Sun Mar 8 17:43:47 2020 +0000 simplify --- tools/deliver.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/deliver.rb b/tools/deliver.rb index d7f1543..1473a1f 100644 --- a/tools/deliver.rb +++ b/tools/deliver.rb @@ -27,11 +27,12 @@ hdrs = mail[/\A(.*?)\r?\n\r?\n/m, 1] || '' # extract info dest = hdrs[/^List-Id: <(.*)>/, 1] || hdrs[/^Delivered-To.* (\S+)\s*$/, 1] || 'unknown' +list = dest[/^[-\w]+/] month = Time.now.strftime('%Y%m') hash = Digest::SHA1.hexdigest(getmid(hdrs) || mail)[0..9] # build file name -file = "#{MAIL_ROOT}/#{dest[/^[-\w]+/]}/#{month}/#{hash}" +file = File.join(MAIL_ROOT,list, month, hash) File.umask 0002 FileUtils.mkdir_p File.dirname(file)