cypht
cypht copied to clipboard
img tag is stripped in anchor tag
Hi Greetings, I hope you are doing well.
Cypht is very useful for email handling. We would like to thanks you guys for this awesome software.
We are facing an issue and I am sure together we can solve this.
When we get images in outlook, it is different once it gets opened in Cypht:
and are there, but is really stripped. Also tag missed target attribute in Cypht…
Outlook source:
<a href="https://xyz.us1.list-manage.com/track/click?u=acea05dea746a229d48d94d2d&id=e51bc25443&e=aa1bbf616b" target="_blank"> <span style='text-decoration:none'> <img border=0 width=562 style='width:5.8541in' id="_x0000_i1027" src="https://mcusercontent.com/acea746a229d48d94d2d/images/a4a81466-66fc-488c-8c89-0c189ae7938e.png"> </span></a>
Cypht source:
<a href="https://xyz.us1.list-manage.com/track/click?u=acea0ea746a229d48d94d2d&id=e51bc25443&e=aa1bbf616b"> <span style="text-decoration:none;"> </span> </a>
Hi @lysaan thanks for the feedback. This is by design. Cypht is very careful with HTML formatted E-mail, especially external content. Allowing external images in an HTML message is a privacy and possible security risk, so along with a bunch of other bits we strip out of HTML messages, external images are also by default removed.
It is possible to view external images, however it's an opt-in per message and you have to change your site configuration. From the hm3.sample.ini:
; Allow remote image sources ; -------------------------- ; ; WARNING: Using this feature could leak information to external sources. ; ; By default Cypht will not allow external images to be loaded when viewing an ; HTML formatted E-mail message. A Content Security Policy header limits images ; sources to "self" only and the message content is filtered to remove any external ; resource. If you really want the ability to view external images in an E-mail, ; first you need to change the following setting to true. When viewing a HTML ; formatted message you will now have a link before the message body called "Allow ; Images" that will reload the message part with external images visible. allow_external_image_sources=false
Remember you need to rerun config_gen.php anytime you change your hm3.ini file. Hope that helps!
Related: https://github.com/jasonmunro/cypht/issues/269
I have set allow_external_image_sources=false, re-run config_gen.php, restarted the server. Now I can see a button in the mail preview : "Allow Images" But when I click on it, the message reloads, but still no image... Am I missing something else ?
@red3333 sounds like you got it covered, so either the message is broken somehow or there may be a new bug with showing inline images that I'm not aware of. Have you tried multiple messages with the same result?
Yes, it is the same with many other messages. As described @lysaan , the img tag is just missing (empty line instead of tag).
@red3333 @lysaan Any chance you could pop over into https://gitter.im/cypht-org/community and we try to find a solution together?
@red3333 @lysaan please
Related: https://github.com/cypht-org/cypht/issues/861