3 ms·
If I had the time I'd love to simply reimplement procmail. In principal its exceedingly simple as procmail doesn't parse structured headers or entity bodies; th
by wahern 5y ago
If I had the time I'd love to simply reimplement procmail. In principal its exceedingly simple as procmail doesn't parse structured headers or entity bodies; the expressions are applied to the raw lines. The fact procmail abstains from more complex parsing is probably why it's seen as few bugs as it has given the approach to parsing--classic Unix string slicing and dicing rather than a less bug-prone stream of scalar tokens which I personally prefer when doing string processing in C. (Can't overflow buffers when you're not taking pointers into and copying fragments every which way.)
Probably a good exercise as a Rust project, but I run OpenBSD so C (or C+Perl or C+Lua--Lua making it trivial to build a single binary) would probably be a better fit--no runtime or even build dependencies. An interim measure for OpenBSD might be to apply pledge and unveil sandboxing. I keep meaning to inspect how procmail loads and parses procmailrc to see if they could be applied early enough to provide realistic mitigations.
- pabs3 5y agoprocmail is now on GitHub, so perhaps you could contribute there rather than reimplementing? https://github.com/BuGlessRB/procmail https://github.com/BuGlessRB/procmail