thestonehead / ThunderbirdAttachmentExtractor

Thunderbird add-on for extracting attachments from e-mails
Mozilla Public License 2.0
14 stars 2 forks source link

delete does create double emails #24

Open Olifair opened 6 months ago

Olifair commented 6 months ago

When trying to delete the attachments of a number of emails in an IMAP account (e.g. inbox or copy self), then all emails will appear twice : once with the attachment, and one with the attachment deleted. The one with the attachment deleted get some new text in the email body, such as : This is a multi-part message in MIME format. --------------JXh52FqqCs6JEaNkoapCx7bx Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit

Now, this does not happen for all emails, but for many, su makes the module unusable (at least for me), which is a real pity.

TB 115.8.1 (32 bits) and extractor V 1.7

Cheers

Oliver

justinmassiot commented 6 months ago

Hello,

Exact same issue for me, with TB 115.8.1 (64 bits) and AE 1.7 on Windows 10 Pro 22H2. I suppose this is because the "delete attachment" feature does a modified copy of the e-mail, then deletes the original one.

I found a (dirty) workaround by inserting a delay between the processing of two successive e-mails. I'm far from a Javascript expert but my hypothesis is that parallel/asynchronous calls of the "delete attachment" function is not managed well by Thunderbird. I inserted the following line in the implementation.js between lines 218 and 219:

Services.prompt.alert(null, "Running", "Please click");

270 messages processed without duplicate with this workaround. Unfortunately, 1 or 2 duplicates after having processed 650 messages.

Of course this in a non-sense from the automation point-of-view, but at list it does not duplicate e-mails! I let the developer find a better way to implement a fix.