Author Topic: Roundcube is attaching base64 encoded image in signature on replies  (Read 526 times)

Offline tomsa

  • Newbie
  • *
  • Posts: 6
Hello,

I have developed a tool at my work so that everyone can generate a corporate email signature.
The tool encodes the logo and social networks images in base64 to avoid attached files in messages.

It is working fine with every email clients. I just have a problem with the webmail powered by Roundcube (I don't know which version we use yet but I have asked for that information). When you receive a message with an html signature in Roundcube it is ok (no attached files). But when you reply or forward a message with a signature, Roundcube is adding the base64 images in the attached files of the message.

I would like to know if it is a normal behavior (or something wrong with my code) and if there is something to prevent that behavior in the configuration (or the plugins) of Roundcube.

Thank you for looking at my issue and have a nice day!

Best,

Tomsa

Offline alec

  • Hero Member
  • *****
  • Posts: 1,286
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #1 on: July 03, 2021, 03:41:33 AM »
This is normal behavior and you can't disable it. I think it was added in the days when most email clients didn't support image data: URIs. I really don't know if we can just remove this feature these days.

Offline tomsa

  • Newbie
  • *
  • Posts: 6
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #2 on: July 05, 2021, 02:02:50 AM »
This is normal behavior and you can't disable it. I think it was added in the days when most email clients didn't support image data: URIs. I really don't know if we can just remove this feature these days.

Hello Alec and thank you for your answer.

It makes sense. I now understand why the base64 image are displaying correctly when you receive a message but are then switched to attached images when replying or transferring a message.

I think this is something that can be changed because now most clients are supporting base64 images very well (even Outlook). If a company use Roundcube and a signature with base64 images, the conversation can quickly be flooded with attached images from the signature. Base64 is used to avoid that behavior in all other email clients. Is there a way to submit that change to the dev team?

Thank you for your help!


Offline tomsa

  • Newbie
  • *
  • Posts: 6
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #4 on: July 05, 2021, 02:47:58 AM »
You can send a pull request. The code is here: https://github.com/roundcube/roundcubemail/blob/78af81ed87da63048176cb8d963e2b2d49aa4080/program/include/rcmail_sendmail.php#L347

Thank you Alec, I made my first pull request :)

Is it possible to comment this line in our Roundcube application to prevent this behavior or it is more complicated?

Offline tomsa

  • Newbie
  • *
  • Posts: 6
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #5 on: July 05, 2021, 02:59:56 AM »
I see that you closed my pull request. I opened it there because I can't open a pull request in Master.



I opened a new one into release-1.4 from master. I hope this is what you expect.

Thank you!

« Last Edit: July 05, 2021, 03:04:03 AM by tomsa »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,628
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #6 on: July 05, 2021, 04:48:05 AM »
you need to create the PR using a branch in your own fork of the repo, the PR should contain only the specific commit(s) required for what you are proposing. see https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline tomsa

  • Newbie
  • *
  • Posts: 6
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #7 on: July 05, 2021, 05:33:44 AM »
Hi John,

Thank you for the explainations.
I have never used Github so the beginning is a bit difficult for me but I am going to figure out.

Offline tomsa

  • Newbie
  • *
  • Posts: 6
Re: Roundcube is attaching base64 encoded image in signature on replies
« Reply #8 on: July 05, 2021, 06:12:53 AM »
After making a fork and modifying a branch, I did another pull request and hope it is ok like this.
Thank you very much for your time.

Best,

Guillaume