canvas-lms/app/models/incoming_mail
Jason Gillett 9a351454a3 Default to plain text if incoming html is too long
There are cases where an incoming reply to a canvas message
has html that is too long when the plain text content is not too long.

Submission and inbox messages do NOT use the HTML at all
Discussion entry replies can use it, but if it is nil, then it defaults to
use the plaintext over the html.

example in discussion entry reply_from
    if opts[:html]
      message = opts[:html].strip
    else
      message = opts[:text].strip
      message = format_message(message).first
    end

This should allow our users to send messages even if they have an
email signature that contains lots of html

refs VICE-3773
flag=none

Test Plan
1. Verify specs
2. Once deployed to an environment with email setup do:
2a. Send a message that contains html that is longer than 64kb
2b verify the message sent in canvas but only with plaintext contents

Change-Id: If1d90e8e63c9d333f005827839b5d2aaa0a1d4cb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/327236
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
2023-09-11 15:42:10 +00:00
..
errors.rb bounce incoming mail when user is suspended 2023-05-16 15:36:06 +00:00
message_handler.rb Default to plain text if incoming html is too long 2023-09-11 15:42:10 +00:00
reply_to_address.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00