6

On our system, we received an email from one of our supplier, formatted this way :

<p>
    Email content
</p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    Email signature
</body>
</html>

SugarCRM seems to be stripping everything outside the body tag. That results in an email displaying only the signature within SugarCRM itself.

Do someone know a way-around to handle this case please ?

We are using SugarCRM CE v6.5.2.

Thanks

Star
  • 3,222
  • 5
  • 32
  • 48
BMN
  • 8,253
  • 14
  • 48
  • 80
  • I can't get this to display the Email content, even before sending the email. All I see is Email signature when I attach this HTML as text in Outlook 2016. What email client is the supplier using? – Reisclef Aug 02 '17 at 08:25
  • 1
    @Reisclef I don't have this info. Anyway, I tried with a simple phpmailer script and the behaviour is the same so I don't think that's related to the customer's email client. – BMN Aug 02 '17 at 15:37
  • Understandable. I'm not saying the email client is at fault. If you say the behaviour is the same, have you tried receiving this email in a different client and seeing it show? I'm trying to replicate your scenario, but I can't *ever* seem to view the message body within any email client. I can view it in a browser, but not an email client. – Reisclef Aug 02 '17 at 18:41
  • Can SugarCRM's incoming mailflow be filtered, e.g. through [procmail](https://en.wikipedia.org/wiki/Procmail)? If so, please provide a full sample email and I'll give you a procmail filter using awk that can "fix" those bodies. – Adam Katz Aug 02 '17 at 20:07

1 Answers1

4

your provided HTML is not valid(p tag at start and then starting DOCTYPE and html tag :) ) so any email server can truncate invalid html tags but i am sure sugar is not doing it because sugarcrm store complete data of an email in side emails_text table and you can check its column raw_source for complete received data. this column contain data which is received from outside server. That might help you to use that column.

Moreover you can check scheduler job function (function::pollMonitoredInboxes) which fetch emails. That contain code which is used for email fetching. track back code and you will find everything you want.

Star
  • 3,222
  • 5
  • 32
  • 48
  • 1
    Thanks for your answer. I know the source is invalid but it's what we receive (I got the source from the original email in Gmail). In the Community Edition of Sugar (or at least ours), nothing is stored in the raw_source column :-( I'll check the scheduler task. – BMN Aug 03 '17 at 07:57
  • 1
    how can you control input? if input doesn't contain something then you need to fix that instead of changing sugar to have AI sort logic ? :) – Star Aug 03 '17 at 11:34
  • 1
    Tell that to our customer :-) – BMN Aug 03 '17 at 14:56
  • 1
    We asked them to fix it on their side after fighting their lazy-*** technical support. But the pollMonitoredInboxes was very instructive anyway :-) Thanks ! – BMN Aug 03 '17 at 14:57