cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]
http://cypht.org
GNU Lesser General Public License v2.1
984 stars 154 forks source link

img tag is stripped in anchor tag #391

Open lysaan opened 4 years ago

lysaan commented 4 years ago

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: `

           </span></a>`

Cypht source: <a href="https://xyz.us1.list-manage.com/track/click?u=acea0ea746a229d48d94d2d&amp;id=e51bc25443&amp;e=aa1bbf616b"> <span style="text-decoration:none;"> </span> </a>

jasonmunro commented 4 years ago

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!

marclaporte commented 3 years ago

Related: https://github.com/jasonmunro/cypht/issues/269

red3333 commented 3 years ago

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 ?

jasonmunro commented 3 years ago

@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?

red3333 commented 3 years ago

Yes, it is the same with many other messages. As described @lysaan , the img tag is just missing (empty line instead of tag).

marclaporte commented 2 years ago

@red3333 @lysaan Any chance you could pop over into https://gitter.im/cypht-org/community and we try to find a solution together?

marclaporte commented 9 months ago

@red3333 @lysaan please

marclaporte commented 9 months ago

Related: https://github.com/cypht-org/cypht/issues/861

marclaporte commented 5 months ago

@lysaan

Please retest, as a lot has changed since you reported this issue. Notably, we now have 3 active branches and recently released Cypht 2.0.0