ESP Mail Client

I have an ESP32, with ESP_Mail _Client from Mobitz.
https://docs.arduino.cc/libraries/esp-mail-client/

I have some custom settings, and that can be done by placing a custom file in the src folder.
Works fine, no problems there.

But... with every update of the library this Custom_ESP_Mail_FS.h gets deleted, while the library clearly states:
"This Custom_ESP_Mail_FS.h will not change or overwrite when update the library."
Annoying when you have to reflash a bunch of boards again.
So who do I blame. The IDE (2.3.3) or the Library (3.4.22).
Leo..

Can you contact the author to see what he/she has to say about it ? What happens if you make the custom file read only ?

1 Like

Sometimes you don't see a simple solution when it's right in front of you.
Will try that first, but won't know until the next automatic update.
Leo..

Revert to a previous version using the Library Manager and let the upgrade happen again

Just tried downgrading and upgrading.
The IDE deleted the read-only file in both cases.

The main ESP_Mail_Client library folder and everything in it has a current date,
so the IDE deletes the whole library, before replacing it with a new one.
If I store that custom file anywhere in the top folder, it will be gone.
Leo..

That is a bit disrespectful !

Next step will be upgrading with the old IDE.
Because I think the author of the library would have tested with that.
Leo..

Update: Same thing with the old IDE.

If you're on a Linux box, you can try setting the 'i' attribute on the file with chattr. From man chattr:

A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file, most of the file's metadata can not be modified, and the file can not be opened in write mode. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

I have this set on all of my local desktop icons to prevent absentmindedly deleting one when I don't notice it's selected.

Win11.
Tried to add security permissions to deny full control, but the IDE still deletes that file.
This is taking too much time. I just have to keep a close eye on updates.
Leo..