[LBBS-31] mod_sieve: Major Sieve filtering overhaul and improvements
Referencing Issues
[LBBS-54] mod_mailscript: Add RECIPIENT condition
[LBBS-107] mod_sieve: Segfault in lib libsieve_strbuffree during message delivery
Feature capabilities
- Check for nonexistent folders during Sieve script validation and warn if the referenced mailbox does not exist.
- Ideally, cache the filtering script in memory and don't reparse each invocation by the SMTP server
- Need to be able to move messages to remote IMAP folders (in
.imapremote). Challenge here is we can't use theimap_clientsubsystem of the BBS (or at least we don't now, maybe we should) - Client-side IMAP filtering, e.g. this kind of thing: https://github.com/lefcha/imapfilter - but fully transparent, using normal Sieve filtering script syntax, just a separate script for post-delivery processing
.forwardshould be honored: https://www.man7.org/linux/man-pages/man5/forward.5.html
Pathway:
- Likely need my own library, since libsieve is not being maintained and won't build (will need to be compiled from source to fix bugs and add features). See https://github.com/sodabrew/libsieve/issues/4
- Improve Sieve support
- For example, Sieve extension for external programs: https://github.com/dovecot/pigeonhole/blob/main/doc/rfc/spec-bosch-sieve-extprograms.txt
- All Sieve extensions: https://www.iana.org/assignments/sieve-extensions/sieve-extensions.xhtml
- Also see: https://support.tigertech.net/sieve
- MailScript: Since mproc->recipient is NULL for outgoing messages (in both mod_mailscript and mod_sieve), and is also not set in system rules (outside of per-user) rules processing, add a RECIPIENTS condition, which can be used for outgoing messages. Another niggly point - some things make more sense to do in a user rule, but if that requires network access, it can't currently run in the container
- MailScript/Sieve: Be able to have rules based on the user part of an email address only (match without the subaddress) - for example, page-me+topic1@example.com, page-me+topic2@example.com, and filter based on just the page-me part if needed
- MailScript: If a script error occurs, have the ability to email that to the user (though we don't want to generate recursive error messages, so this message should bypass filtering?...)
Links: https://github.com/simta/simvacation/blob/main/simvacation.c
Comments
You must be logged in to leave a comment.