RealRaven2000 / FiltaQuilla

Adds many new mail filter actions to Thunderbird
http://quickfilters.quickfolders.org/filtaquilla.html
GNU General Public License v3.0
88 stars 17 forks source link

"Save Message as File" and "Save Attachment to" creates empty files. #230

Closed benfnjovi closed 1 year ago

benfnjovi commented 1 year ago

The "Save Message as File" and "Save Attachment to" are producing files with no data as if it isn't finishing the process. Github will not allow me to attach the files with the error message, "This file is empty. Try again with a file that's not empty." Any ideas?

benfnjovi commented 1 year ago

To add: "Save Attachment to" prefixes the attachment file name with "Downloading-", but it is a zero bytes.

RealRaven2000 commented 1 year ago

which version of Thunderbird?

did it also happen when you run the filter manually? does it only happen on Thunderbird startup?

try to set the filter to run with the option "after junk controls". you can also check error console (Ctrl shift J) to check for any exceptions...

RealRaven2000 commented 1 year ago

I just checked the source code of the latest version (FiltaQuilla v4.0b2) for Thunderbird 115, the prefix "Downloading-" is definitely not added by FIltaQuilla. It looks like maybe a asynchronous function not being finished? (not sure). The saving code is very simple and uses Thunderbird's built in functions:

      file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600);
      let service = MailServices.messageServiceFromURI(msgSpec);
      let aURL = {};
      service.SaveMessageToDisk(msgSpec, file, false, _urlListener, aURL, true, null);

the code in v 3.7.1 is very similar, just uses messenger.messageServiceFromURI - which is basically the same thing.

RealRaven2000 commented 1 year ago

I checked the source code of Thunderbird in searchfox for both c-c esr 102 and 115 but I cannot find the string "Downloading" or "Downloading-" anywhere. What version of Thunderbird are you running?

benfnjovi commented 1 year ago

Thunderbird version: 102.12.0

benfnjovi commented 1 year ago

Downloading I turned all filters off except the "Save Attachment to" to try and trouble shoot the issue.

RealRaven2000 commented 1 year ago

thanks, it seems that there are mainly UPS images, are these real attachments? What happens when you save the attachments manually, do you see a connection / download popup like on a remote file service?

benfnjovi commented 1 year ago

You are correct. They are UPS labels. It downloads as a regular attachment without the "Downloading- " prefix when doing it manually. Every now and then, FiltaQuilla downloads it properly, but it's like 1 out of 10 times. This all worked fine with an earlier version of Thunderbird and FiltaQuilla, but our server hosting stopped supporting pop3 and imap and forced us to use exchange, hence my reason for having to update Thunderbird and FiltaQuilla.

benfnjovi commented 1 year ago

@RealRaven2000 any suggestions?

RealRaven2000 commented 1 year ago

@RealRaven2000 any suggestions?

the only thing I can suggest right now is to set to "execute after junk controls", the hope is that it should give Tb enough time to download this file (?)

benfnjovi commented 1 year ago

@RealRaven2000 I've confirmed that it is an issue with using exchange and 365. I found a setting with my hosting that allowed me to revert back to SMTP and everything is back to working normal.

RealRaven2000 commented 1 year ago

@RealRaven2000 I've confirmed that it is an issue with using exchange and 365. I found a setting with my hosting that allowed me to revert back to SMTP and everything is back to working normal.

thanks for reporting back. I had problems too with a mailbox hosted at godaddy.com which required Exchange (OWL) access. I finally got it reverted to POP3 and am very happy about that.