Yurii Sokolovskyi 2f868d0333 attachments small fix + added some documentation | il y a 2 mois | |
---|---|---|
.github | il y a 2 ans | |
async-imap-wasi | il y a 3 mois | |
sonic-channel-wasi | il y a 3 mois | |
src | il y a 2 mois | |
.gitignore | il y a 4 mois | |
Cargo.toml | il y a 3 mois | |
LICENSE | il y a 2 ans | |
README.md | il y a 2 mois | |
crabmail.conf | il y a 3 mois |
Clone the project:
git clone https://git.42d.io/reda/crabmail
Install dependencies:
cd crabmail && cargo install --path .
Add WASM target for cargo toolchain:
rustup target add wasm32-wasi
For Linux environment build and run:
cargo run --release
For WASI environment build:
cargo build --target wasm32-wasi --release
For WASI environment run: Note: To give WASI access to a directory, you need to use the --dir flag and specify the path in the {actual_path}:{virtual_path} format, where {actual_path} should be replaced with the actual path in the local file system, and {virtual_path} should represent the virtual path that WASI will use in the code.
wasmedge --dir {path with config} --dir {path to store results} --dir {path with maildir} {path to .wasm file} -h -c {path to the config file} -d {path to the result dir} -m {path to maildir}
For WASI environment run example:
wasmedge --dir /home/yura/crabmailConfig/:/home/yura/crabmailConfig/ --dir /home/yura/crabmailResult/:/home/yura/crabmailResult/ --dir /home/yura/lists/:/home/yura/lists/ ./target/wasm32-wasi/release/crabmail.wasm -h -c /home/yura/crabmailConfig/crabmail.conf -d /home/yura/crabmailResult -m /home/yura/lists/
Copy crabmail.conf
and set the variables as needed.
For Sonic Search to work, a Sonic server must be running in the background. Additionally, ensure that IPv6 is not used with WASI, as it is not yet supported.
This is a separate module
The program works on Linux and WASI. You need to use Wasmedge to run WASM code because the project uses libraries from Wasmedge for networking and asynchronous tasks
Crabmail is AGPLv3 licenses, but some files are licensed under 0BSD or other more permissive licenses. I call this out when I can.