salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.53k stars 2.09k forks source link

SUGGESTION: Strip Outlook HTML from emails as they are imported #4153

Closed blloyd78 closed 7 years ago

blloyd78 commented 7 years ago

Issue

Outlook inserts additional carriage returns into email text upon reply. These are invisible to the sender, but as an email chain develop, they reappear.

Expected Behavior

SuiteCRM should delete this junk at import to prevent widely spaced formatting. (see attached pics)

Actual Behavior

With every email in the chain, line spacing doubles (see attached pics).

First reply, lines 2x spaced:

screen shot 2017-08-24 at 12 20 23

Second reply, lines 4x spaced:

screen shot 2017-08-24 at 12 20 39

Possible Fix

A fix was proposed on the forums by user houlejo to strip this additional junk out at run-time here: https://www.suitecrm.com/forum/suitecrm-7-0-discussion/13016-empty-lines-in-emails-view-summary-of-history-tab#52472

Note: This code only prevents the spacing being rendered on screen - it is still stored in the database at import.

Steps to Reproduce

  1. Send an email to an Outlook user from SuiteCRM
  2. Receive and import their response. Repeat as necessary
  3. Check email details to see line spacing issue

Context

Fairly high priority - it makes businesses look bad sending crappy mail like this.

Your Environment

boombata commented 7 years ago

I Agree, thanks for reporting !

pgorod commented 7 years ago

How do you propose SuiteCRM knows when to strip email content?

A double newline is not forbidden in email content... and an email client can't just start changing email content... do you know of any way to actually pinpoint that a double newline is Outlook's fault?

blloyd78 commented 7 years ago

It is currently unclear (to me anyway) whether the line breaks are added by Outlook or SuiteCRM. What is clear is that this is a problem. The fix suggested above can prevent those additional line breaks being displayed however, making messages at least readable once they have been imported.

Perhaps this could be implemented as an on/off system setting? That way sysadmins can decide what is best for their system - my gut feel is that most will choose to switch this setting on.

pgorod commented 7 years ago

The line-breaks are added by Outlook, we don't have this problem except with Outlook users, right?

That's why you should really be making this bug known to Microsoft... except you don't have much hope of fixing it that way...

My question was meant to probe whether we can turn this hacked solution into something more elaborate. Maybe it's not possible...

blloyd78 commented 7 years ago

I think there must be a solution to this problem. As far as I can tell, other email clients, say Apple Mail, strip these double-spaces out automatically.

blloyd78 commented 7 years ago

Please see the attached screenshot - the double-spacing in this example has been created by SuiteCRM not Outlook.

Is this actually a bug, rather than an an enhancement?

screen shot 2017-09-21 at 22 37 16
pgorod commented 7 years ago

That looks interesting, we seem to be getting closer to root of the problem, can you please provide the "steps to reproduce"?

blloyd78 commented 7 years ago

@pgorod OK, further testing reveals that this is not an Outlook issue as previously thought - this is actually something to do with the way SuiteCRM/TinyMCE handle line spacing.

Steps to reproduce - Part 1:

  1. Create new email
  2. Type message body without double line spacing between paragraphs. Eg:
    Dear Sir,
    Some body text.
    Another line of body text.
    Your faithfully,
    Ben Lloyd
  3. Send email.
  4. Check email stored by SuiteCRM - all paragraphs are now double spaced.

Steps to reproduce - Part II

  1. Create new email
  2. Type message body without double line spacing between paragraphs. Eg:
    
    Dear Sir,

Some body text.

Another line of body text.

Your faithfully,

Ben Lloyd


3. Send email.
4. Check email stored by SuiteCRM - all paragraphs are now quadruple spaced as in the screenshots above.

Now that I have ruled out Outlook as the cause of poor formatting, this may need to be raised as a new bug. 

**It is worth noting that the paragraph spacing doubles every time the email is replied to/forwarded**.
Dillon-Brown commented 7 years ago

SUGGESTION: Strip Outlook HTML from emails as they are imported

Dillon-Brown commented 7 years ago

I have moved this suggestion to Trello. All github issues that are labeled 'suggestion' will be moved to the new system and closed. Thanks for the suggestion!

Announcement of moving Suggestions: https://suitecrm.com/forum/suggestion-box/13691-moving-suggestions-from-github-to

New SuiteCRM Suggestion Box https://trello.com/b/Ht7LbMqw/suitecrm-suggestion-box

blloyd78 commented 7 years ago

HI @Dillon-Brown - the latest update on this thread suggests that this issue is actually a bug, not a suggestion after all.

pgorod commented 7 years ago

I agree with @blloyd78. Anyway, as a suggestion it's proven to not make any sense, so this doesn't need to be on Trello.

The bug now has a specific description and should be something one can reproduce and debug. I didn't get a chance to do that work, but hopefully it can be done and shouldn't be too complicated.

Anyway, I wouldn't reopen this either - I would leave this Issue closed, and open a new one, just with the latest update, with no mention of Outlook, and a proper title like "Email content corruption: duplicated line breaks".

pgorod commented 7 years ago

@blloyd78 I finally got my email set up working in my test system, which now runs SuiteCRM 7.9.7. I tried reproducing this bug but couldn't: everything works for me, without any duplication of line-breaks.

The only thing I'm suspecting maybe is different from you is that you mention TinyMCE. My email options had Mozaik selected instead. Then I went into my profile, changed it to TinyMCE, but still I don't get any duplicate lines. I don't see any change in my editor, though, it looks exactly the same... I wonder if that option had any effect.

Just a question: you say in step 4: Check email stored by SuiteCRM - all paragraphs are now double spaced.. What exactly is this "email stored by SuiteCRM"? Is it going into the Sent folder to check it?