Wednesday, September 9, 2026
1 change · 18.0
Resolved issues and error corrections
Large marketing emails with several WebP images could fail to save or silently lose the end of the message. This fix preserves the full email content by handling oversized embedded images safely during save, reducing the risk of broken campaigns and lost work.
Original PR description
Root cause: Webp images are not supported by Outlook, so the editor turns each one into an inline base64 image before the body is saved. A mailing with a few webp images ends up with a body of more…
Root cause: Webp images are not supported by Outlook, so the editor turns each one into an inline base64 image before the body is saved. A mailing with a few webp images ends up with a body of more than 10 million characters, and each background image is copied a second and a third time for the Outlook fallback. lxml stops reading a document that big and gives back what it read so far, without raising anything. The body is cut in the middle of one of those base64 images. base64.b64decode then gets a piece of an image and raises, which is the error in the ticket. When the cut lands between two elements instead, there is no error at all and the end of the body is simply gone. On the customer's mailing the body is 16.5 million characters and 6.9 million of them are dropped on save. Fix: Put the base64 images aside in _convert_inline_images_to_urls before the body is read, and leave a short placeholder in their place. lxml then only reads the tags, which stays small. The image is given back when the attachment is created, and any placeholder still in the body is put back at the end. This method is the right place because it is the one that reads the body while the images are still inside it. Steps to reproduce: 1. Install Email Marketing. 2. Go to Email Marketing > Mailings > New. 3. Set a subject, pick a mailing list, then open the Mail Body tab. 4. Pick the Start From Scratch theme. 5. Drag a Cover block and replace its background image with a webp image of about 1 MB. 6. Drag three Text - Image blocks and replace each image with a webp image of about 1 MB. 7. Type four lines of text under the last image. 8. Click Save. => Odoo Server Error, binascii.Error: Invalid base64-encoded string: number of data characters cannot be 1 more than a multiple of 4 Ticket [link](https://www.odoo.com/odoo/project.task/6450151) opw-6450151