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

Filter with "Save message as File" action fails to run #270

Closed Hergeirs closed 4 weeks ago

Hergeirs commented 3 months ago

Running the same filter with any other action works perfectly. Even Save Attachments To There was no useful information in the filter log.

While looking around for the cause and ruling out encoding issues and the like I think I found the issue.

In the debug console of thunderbird I consistently got this error: image

I put a breakpoint at the failure point and saw that indeed service.SaveMessageToDisk is undefined. service does however contain the method saveMessageToDisk with a lowercase "s" . image

It seems to me like it might be a simple spelling mistake. Please correct me if i'm wrong.

I could attempt a pull request, but I'm just not sure wether changing that 1 letter would be all that's needed.

RealRaven2000 commented 3 months ago

Not a typo. But they changed the function name, see: https://searchfox.org/comm-esr115/source/mailnews/base/public/nsIMsgMessageService.idl#103 https://searchfox.org/comm-esr128/source/mailnews/base/public/nsIMsgMessageService.idl#101

that's always the risk when we use "experimental" code - meaning legacy code to get at the good Sh*t - the functions that aren't covered via the extensions API. I will write a patch shortly!

RealRaven2000 commented 3 months ago

Here is a quick fix version. It's fully backwards compatible so it can be installed in both Tb115 and Tb128 as I included both options depending on their presence.

filtaquilla-4.2pre4.zip


To try the version above download zip file and drag the file into Thunderbird Add-ons Manager (do not extract contents, it won't install like that)

Hergeirs commented 3 months ago

Thank you for the quickfix.

I didn't realize how foolish my assumption was until I saw that the code was committed 3 years ago.

Love the extension btw. Really helps my workflow immensely.

Hergeirs commented 3 months ago

The quick fix worked for saving as eml. Changing to html or txt just changes the extension of the file, but has identical content. Is this intended behaviour? I.e. creates invalid HTML files.

RealRaven2000 commented 3 months ago

https://searchfox.org/comm-esr128/source/mailnews/base/public/nsIMsgMessageService.idl#88

this is the function that is used to save a message as file:

  /**
   * When you want to spool a message out to a file on disk.
   * This is an asynch operation of course. You must pass in a
   * url listener in order to figure out when the operation is done.
   *
   * @param aMessageURI The uri representing the message to spool out to disk.
   * @param aFile The file you want the message saved to
   * @param aGenerateDummyEnvelope Usually FALSE. Set to TRUE if you want the msg
   *        appended at the end of the file.
   * @param aUrlListener
   * @param canonicalLineEnding
   * @param aMsgWindow
   */
  void saveMessageToDisk(in AUTF8String aMessageURI, in nsIFile aFile,
                         in boolean aGenerateDummyEnvelope,
                         in nsIUrlListener aUrlListener,
                         in boolean canonicalLineEnding, in nsIMsgWindow aMsgWindow);
RealRaven2000 commented 4 weeks ago

Fixed in 4.2 - Published 15/10/2024