global::fs

APIs to interact with the file system.

fn write

fn write(dir: String) -> ()
Export the current raw message to a file as an `eml` file. The message id of the email is used to name the file.
  • dir - the directory where to store the email. Relative to the application path.

preq and onwards.

#{
    preq: [
       action "write to file" || fs::write("archives"),
    ]
}

fn dump

fn dump(dir: String) -> ()
Write the content of the current email with it's metadata in a json file. The message id of the email is used to name the file.
  • dir - the directory where to store the email. Relative to the application path.

preq and onwards.


#{
    preq: [
       action "write to file" || fs::dump("metadata"),
    ]
}