Skip to content

Commit

Permalink
Add patch to raw email for edge case issue
Browse files Browse the repository at this point in the history
Fixes issue where spaces are included before some email headers.

See mysociety/asktheeu-theme#120
See mysociety/alaveteli#6853
  • Loading branch information
gbp committed Nov 18, 2022
1 parent f5a7415 commit dd98a90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/model_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ def is_school?
end
end

RawEmail.class_eval do
alias original_data data

def data
original_data.sub(/
^(Date: [^\n]+\n)
\s+(To: [^\n]+\n)
\s+(From: [^\n]+)
/x, '\1\2\3')
end
end

ReplyToAddressValidator.invalid_reply_addresses = %w(
[email protected]
[email protected]
Expand Down

0 comments on commit dd98a90

Please sign in to comment.