Hi all, I was wondering what the best way to edit the email that calibre generates when sending to Kindle is?

My use case is that I organise all my collection with calibre on an always on server at home. It runs in a docker container that also runs vnc so I can access the calibre GUI from anywhere via an OpenVPN connection. I'd like to be able to add books to calibre from anywhere without opening much up to the Internet, this works great so far.

The problem is that the Amazon email to Kindle is crap, I need to convert the books to mobi and then they become personal docs instead. I've found a plugin for my Kindle which uses IMAP to check an email address for attachments and downloads them to the Kindle but they miss the cover art because it doesn't sideload the cover like calibre would over USB.

So.... Ideally it'd fit my use perfectly if I could generate the email with the ebook and cover image with the same filename that calibre would use when transferring over USB. I can then tweak the IMAP plugin to download the cover image and copy that to the right place and all would be right with the world.

If anyone has any recommendations on this, it'd be appreciated. I thought I could write a plugin that extracted the mobi asin metadata, extracted the cover and sent the email using existing settings already set on calibre. Possible? Any better ways I'm not thinking of?

Cheers!

P.S. I realise this is a somewhat long winded way of doing things but life is boring without some challenges!

Since you already plan to modify the BooksByMail extension on your Kindle, another possible approach would be to do the cover extraction there and leave calibre unchanged. You could borrow Python code from Extract Cover Thumbs to accomplish this.

For what its worth. The newer version of ExtractThumbs needed pillow installed which I don't think is possible on Kindle (at least not by me, compiling the library for kindle). Ended up using KindleUnpack which is prehaps a bit heavy for my use, but does the job.

Also, BooksByMail ended up crashing out on me with out of memory error, so I rewrote that functionality with imaplib instead, rather than offlineimap.

All in all, works seamlessly now. Email myself the azw3 books and launch the KUAL extension and they appear in my library with covers. Many thanks for the pointer in the right direction!