From c6326a6524e6d71d23bc2c256f3f9416c38b0846 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Sat, 10 Feb 2024 23:39:38 +0000 Subject: [PATCH] style(rubocop): Style/MultilineBlockChain --- config/initializers/mail_extensions.rb | 6 +++--- lib/postal/dkim_header.rb | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/initializers/mail_extensions.rb b/config/initializers/mail_extensions.rb index a64974d9..c109fa73 100644 --- a/config/initializers/mail_extensions.rb +++ b/config/initializers/mail_extensions.rb @@ -115,10 +115,10 @@ class AttachmentsList < Array def initialize(parts_list) @parts_list = parts_list @content_disposition_type = "attachment" - parts_list.map do |p| + parts = parts_list.map do |p| p.parts.empty? && p.attachment? ? p : p.attachments - end.flatten.compact.each { |a| self << a } - self + end.flatten.compact + parts.each { |a| self << a } end # rubocop:enable Lint/MissingSuper diff --git a/lib/postal/dkim_header.rb b/lib/postal/dkim_header.rb index 3721e32d..36f7094d 100644 --- a/lib/postal/dkim_header.rb +++ b/lib/postal/dkim_header.rb @@ -34,14 +34,15 @@ def header_names def normalized_headers [].tap do |new_headers| - headers.select { |h| + dkim_headers = headers.select { |h| h.match(%r{ ^( from|sender|reply-to|subject|date|message-id|to|cc|mime-version|content-type|content-transfer-encoding| resent-to|resent-cc|resent-from|resent-sender|resent-message-id|in-reply-to|references|list-id|list-help| list-owner|list-unsubscribe|list-subscribe|list-post ):}ix) - }.each do |h| + } + dkim_headers.each do |h| new_headers << normalize_header(h) end end