mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: Catch UndefinedConversionError for inbound emails (#13000)
Some emails coming in via the mail receiver can still end up with bad encoding when trying to enqueue the job. This catches the last encoding issue and forces iso-8559-1 and encodes to UTF-8 to circumvent the issue.
This commit is contained in:
@ -229,6 +229,12 @@ describe Admin::EmailController do
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to eq("email has been received and is queued for processing")
|
||||
end
|
||||
|
||||
it "retries enqueueing with forced UTF-8 encoding when encountering Encoding::UndefinedConversionError" do
|
||||
post "/admin/email/handle_mail.json", params: { email_encoded: Base64.strict_encode64(email('encoding_undefined_conversion')) }
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to eq("email has been received and is queued for processing")
|
||||
end
|
||||
end
|
||||
|
||||
describe '#rejected' do
|
||||
|
Reference in New Issue
Block a user