crepererum-oss/tatutanatata

Errors when downloading inbox

Closed this issue · 3 comments

Getting errors when downloading inbox:

Error: execute command

Caused by:
    0: download mail
    1: decode body
    2: decompress
    3: decompression
    4: provided output is too small for the decompressed data, actual 50154, expected 50172
Error: execute command

Caused by:
    0: download mail
    1: decode body
    2: decompress
    3: decompression
    4: expected another byte, found none

Command used: cargo run --release -- download --folder Inbox --path Inbox

Looks like I misunderstood something about the compression. Could you perform the following steps to help me investigate?

  1. figure out affected email: I've just merged #170 which should now print the UI URL whenever a download / decode fails
  2. use UI: try to export that URL via the UI as EML. Does that work?

The email accessed using the link is exported successfully using the web ui

Email has an empty body

I changed the code in compression.rs to

use anyhow::{Context, Result};

pub(crate) fn decompress_value(v: &[u8]) -> Result<Vec<u8>> {
    if v.is_empty() {
        return Ok(vec![]);
    }

    lz4_flex::block::decompress(v, v.len() * 12).context("decompression")
}

and now it is working correctly.