SugarCRM - Incoming emails stripped outside body tag
Asked Answered
L

1

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

Lazy answered 28/7, 2017 at 9:7 Comment(4)
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?Aplomb
@Aplomb 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.Lazy
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.Aplomb
Can SugarCRM's incoming mailflow be filtered, e.g. through procmail? If so, please provide a full sample email and I'll give you a procmail filter using awk that can "fix" those bodies.Bast
V
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.

Verne answered 3/8, 2017 at 7:44 Comment(4)
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.Lazy
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 ? :)Verne
Tell that to our customer :-)Lazy
We asked them to fix it on their side after fighting their lazy-*** technical support. But the pollMonitoredInboxes was very instructive anyway :-) Thanks !Lazy

© 2022 - 2024 — McMap. All rights reserved.