Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating filters - extracting headers can fail if msg > 16kByte #206

Closed
RealRaven2000 opened this issue Aug 12, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Aug 12, 2023

Important problem - when reading the headers (especially custom headers such as "delivered-to") from an email, adding the search term may fail if the email > 16kb. This may both happen when using the "mailing list" template and when using a custom template.

When this error condition happens, the filter assistant is not able to extract data from the headers of the original email

image

This is due to the following bug in quickFilters.clsGetHeaders.read()

      while (inputStream.available()) { 
        msgContent = msgContent + inputStream.read(2048); 
        let p = msgContent.search(/\r\n\r\n|\r\r|\n\n/); //todo: it would be faster to just search in the new block (but also needs to check the last 3 bytes)
        if (p > 0) {
          contentCache = msgContent.substr(p + (msgContent[p] == msgContent[p+1] ? 2 : 4));
          msgContent = msgContent.substr(0, p) + "\r\n";
          break;
        }
        if (msgContent.length > 2048 * 8) {
          util.logDebug('clsGetHeaders - early exit - msgContent length>16kB: ' + msgContent.length);
          return null;
        }
      }

this should not be return null but simply break - because otherwise the whole structure
CurrentHeader.headers is not initialized.

@RealRaven2000 RealRaven2000 self-assigned this Aug 12, 2023
@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Aug 12, 2023

quick fix versions:

ESR 102: quickFilters-wx-5.9.4pre3.zip

ESR 115: quickFilters-wx-6.2pre61.zip


To one of the versions above download the correct zip file and drag it into Add-ons Manager (do not extract contents or it won't install).

@RealRaven2000 RealRaven2000 pinned this issue Aug 12, 2023
@RealRaven2000 RealRaven2000 changed the title When creating new filters - Reading headers can fail if msg > 16kByte When creating new filters - extracting headers can fail if msg > 16kByte Aug 13, 2023
@RealRaven2000 RealRaven2000 changed the title When creating new filters - extracting headers can fail if msg > 16kByte Creating filters - extracting headers can fail if msg > 16kByte Aug 13, 2023
RealRaven2000 added a commit that referenced this issue Aug 13, 2023
@RealRaven2000
Copy link
Owner Author

fixed in 6.2 - Published 13/08/2023, also backported to 5.9.4, same day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant