"Detach Attachments To" failed to save attachments, corrupted(?) emails
Thunderbird 102.3.3 (64-bit) FiltaQuilla 3.6.1 Windows 10 normal Gmail account, IMAP, mbox
I will preface this by saying I did first download all messages in my "Voice Memos" folder for offline use, then unchecked "Select this folder for offline use", then moved the mbox file elsewhere. So my junk is safe... mostly
Not quite sure why (was my TBird too old?), but it all went spectacularly wrong...
Ran a simple filter: Match All: FolderName is "Voice Memos" AND Status isn't Starred Perform Actions: Detach Attachments To "C:\Users\Jeremy\Music\VoiceMemos"
Only file it output was "Wash-Wash-Machine.m4a", 0 bytes. I notice that all files in that ~~label~~ folder still show as having attachments, and aside from the aforementioned attachment, they all show with non-zero sizes. Except when I try clicking on any of them & opening in VLC, nothing happens (VLC does not even open) (I found an email outside that folder with an m4a attachment, it opens in VLC just fine). This also applies to the attachments in the two starred messages I have in that folder.
Hoping but not expecting it to work, I go ahead & change the action to "Save Attachments To", same location. It output 6 more empty files, otherwise no difference.
Find here my slightly redacted Filter Log Find here attachment filenames extracted from mbox file (i left them in the exact order & did not remove the duplicates in case that is somehow relevant to this mystery)
Not sure what happened (or what I did wrong if this is entirely user error). Quite bemystified I must say.
I will preface this by saying I did first download all messages in my "Voice Memos" folder for offline use, then unchecked "Select this folder for offline use", then moved the mbox file elsewhere. So my junk is safe... mostly
that part I am not quite sure about, what are you trying to achieve here? I guess if you do not download the full emails, maybe there is no point in detaching the attachments. Did it create all the files according to the filter log, and they were all empty?
that part I am not quite sure about, what are you trying to achieve here?
I was trying to be lazy :P I was gonna try to parse out the mbox, myself or using an NPM or PyPI package or whatever. But it looked hard to do correctly if I did it myself, and then I remembered email filters exist & thought that would be easiest & most suited to the task.
I guess if you do not download the full emails, maybe there is no point in detaching the attachments.
I forgot to mention, to be clear, this is an IMAP configuration (does gmail even support POP? I forget) Is "Detach Attachments To" not intended for use with IMAP/non-offline folders? I thought it would also rewrite the emails/delete the attachments server-side. Was that a wrong assumption?
Did it create all the files according to the filter log, and they were all empty?
No & yes; as mentioned, it only created 7 files (about 7%), but those 7 are all empty.
Oh, I guess I should mention I had also first moved "Voice Memos.mbox" to that folder? It didn't die trying to read that whole huge file for some reason, did it? I remember that the docs saying that duplicate names get renamed so I know it must read all the names in the specified folder.
Apologies in general, I am still rather new to using a non-webmail client for email so a lot of stuff which is maybe obvious to others is not to me.
that part I am not quite sure about, what are you trying to achieve here?
I was trying to be lazy :P I was gonna try to parse out the mbox, myself or using an NPM or PyPI package or whatever. But it looked hard to do correctly if I did it myself, and then I remembered email filters exist & thought that would be easiest & most suited to the task.
makes sense...
I guess if you do not download the full emails, maybe there is no point in detaching the attachments.
I forgot to mention, to be clear, this is an IMAP configuration (does gmail even support POP? I forget) Is "Detach Attachments To" not intended for use with IMAP/non-offline folders?
I don't think detaching attachments works with non-downloaded mails, it only affects your local copy. I am doubtful that the "empty" email will be synchronized back to the server (but I may be wrong). Tbh it never occurred to me to test. In my mind Thunderbird made this option to preserve local space, not space on the server... and yes gmail supports POP, I use it all the time, because it is faster and more reliable than IMAP (slow internet, lot's of network traffic). To be honest I do not trust IMAP, because I do not trust google to store my mails reliably and responsibly. I have some big local drives and a NAS so I have no problem having all my mails locally. Only use IMAP if I needed to reply something on my phone or the wife's laptop.
I thought it would also rewrite the emails/delete the attachments server-side. Was that a wrong assumption?
I need to find out.
Did it create all the files according to the filter log, and they were all empty?
No & yes; as mentioned, it only created 7 files (about 7%), but those 7 are all empty.
:(
To be honest the whole attachment hell is one of the sure fire reasons why I never thought about monetising filtaquilla. I think the Thunderbird attachment functions are highly unstable.
Oh, I guess I should mention I had also first moved "Voice Memos.mbox" to that folder? It didn't die trying to read that whole huge file for some reason, did it? I remember that the docs saying that duplicate names get renamed so I know it must read all the names in the specified folder.
if you moved the mbox file, it might have been a good idea to do a repair folder / reindex before you did any attachment work...
I thought it would also rewrite the emails/delete the attachments server-side. Was that a wrong assumption?
I need to find out.
I use the internal detach routine from Thunderbird since years on an IMAP account and can confirm that the path to the attachment is not stored locally but on the server as @jeremyredhead expected.
I thought it would also rewrite the emails/delete the attachments server-side. Was that a wrong assumption?
I need to find out.
I use the internal detach routine from Thunderbird since years on an IMAP account and can confirm that the path to the attachment is not stored locally but on the server as @jeremyredhead expected.
To rephrase, are you saying the email is synced back to the server without attachment and the local path is stored somehow in the parts? Filters currently run synchronously so I am not sure whether doing really slow operations like this can be safe or even work at all.
To rephrase, are you saying the email is synced back to the server without attachment and the local path is stored somehow in the parts?
Yes, this is how the internal detach function of Thunderbird works. (I haven't used FiltaQuilla, yet. Is FiltaQuilla just using the internal routine of Thunderbird to detach attachments?) I use this function for all emails, incoming and outgoing, to save space on the IMAP server. This way I can leave the messages for quite some time on the server, so they can accessed from several computers, and the attachments are stored on the company's NAS.
Here is an excerpt from one email where I detached an attachment as an example:
--------------030408000206080405080906
Content-Type: application/pdf;
name="Lebenslauf.pdf"
Content-Disposition: attachment; filename="Lebenslauf.pdf"
X-Mozilla-External-Attachment-URL: file:///home/share/Mailanhaenge/2016/Lebenslauf.pdf
X-Mozilla-Altered: AttachmentDetached; date="Tue Aug 30 10:40:36 2016"
You deleted an attachment from this message. The original MIME headers for the attachment were:
Content-Type: application/pdf;
name="Lebenslauf.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="Lebenslauf.pdf"
--------------030408000206080405080906
Yes, this is how the internal detach function of Thunderbird works. (I haven't used FiltaQuilla, yet. Is FiltaQuilla just using the internal routine of Thunderbird to detach attachments?) I use this function for all emails, incoming and outgoing, to save space on the IMAP server. This way I can leave the messages for quite some time on the server, so they can accessed from several computers, and the attachments are stored on the company's NAS.
makes sense, but synchronisation (uploading the detached message) may be sloppy, not sure if this will overwrite the original message on the server or create a duplicate. I am currently consolidating all issues related to attachments, it is a complicated topic because it seems that data is not available during filter run ("filter after junk controls" may help somewhat). The hard part here is expecting synchronisation during an action that is planned to be synchronous (as currently defined by Thunderbird filter architecture) but should really be async (because it handles large data).