There is an updated pull request by nmeum against master on the mblaze repository https://github.com/nmeum/mblaze mblaze-error-handling https://github.com/leahneukirchen/mblaze/pull/265 Exit with a non-zero exit status if a given mail does not exist Sadly, the diff is quite large as we will have to change the API of `blaze822_loop` to differentiate the number of processed messages and a status code indicating a missing mail. Note that currently execution is not aborted upon encountering the first non-existent mail; hence, we can't do both via the return value. Surprisingly, very few utilities actually use the number of processed messages as returned by `blaze822_loop`. Therefore, we could reduce the diff quite a bit by differentiating the two use cases through separate functions (e.g. `blaze822_loop` and `blaze822_loop_num`), which would allow the API of blaze822_loop to remain largely unchanged. The new `blaze822_loop` API would also allow us to improve error handling for `blaze822_seq_next` but I haven't done this so far… There are also some tests, but these should be expanded. Fixes #264 A patch file from https://github.com/leahneukirchen/mblaze/pull/265.patch is attached