Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-griffen committed Jul 17, 2023
1 parent 6856f0e commit df4e8df
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/mail_handler/backends/mail_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,12 @@ def address_from_string(string)
end

def get_emails_within_received_headers(email)
received_addresses = []
received_headers = email['Received']
if received_headers
if received_headers.class == Mail::Field
received_header_string = received_headers.to_s
else
received_header_string = received_headers.
map { | header | header.to_s } * ' '
end
received_addresses = received_header_string.
scan(MySociety::Validate.email_find_regexp).flatten
end
received_addresses
received_headers = Array(email['Received'])
return [] if received_headers.empty?
received_headers.map(&:to_s).
join(' ').
scan(MySociety::Validate.email_find_regexp).
flatten
end
end
end
Expand Down

0 comments on commit df4e8df

Please sign in to comment.