dyne / JaroMail

Terminal UI email client to download, filter, search and archive messages off-line
https://dyne.org/software/jaro-mail
GNU General Public License v3.0
105 stars 9 forks source link

Maildir hooks #8

Open jaromil opened 9 years ago

jaromil commented 9 years ago

Support a hooks file in maildirs, which may contain functions() with predefined names which will be executed by filters as maildir events occurr, i.e.

called every time a mail is added

every-new-mail() { cat $1 | distribute "Groups/close-friends" } 

the distribute function above refiles the message for the whole group.

called at end of filtering if folder changed

when-maildir-changes() { publish $1 }

the publish function above rebuilds html pages.

So basically two main events, one for each mail added the other after any number of mails have been filed into the folder, arguments will provide relative paths to new mail(s).

The first application for this will be the implementation of the "autonomous mailinglist" feature allowing anyone to setup a mailinglist on any client or server running jaromail: every-new-mail() will trigger a distribute() event to another email address or a group collecting mail addresses. The distribute() function is a standard Jaro Mail auxiliary function available in the hooks, it supports settings on the path inside the $JAROMAILDIR configuration.