vm filters; more choices and flexibility than current auto-folder-alist

Registered by Arik

The auto-folder-alist could be improved to cover a wider range of actions. Auto archiving is nice, but filtering (like mozilla-style or gmail style) can have mail attributes set, tags (labels) applied upon arrival and even be redirected to another mailbox. We could drop the auto-folder-alist for a more advanced filter list, which could of course be used for identically the same purpose as it is now in addition to the above, and equip it with the more advanced selection criteria available for virtual folders. The list could store "actions" (e.g. add label/save to folder/skip inbox/etc.) and be scanned upon arrival, likewise it could be scanned during auto-archiving via another type of action.

Some thought would be needed to best employ such a list, but some of the tools already exist for the virtual folders lists.

Blueprint information

Not started
Uday Reddy
Series goal:
Milestone target:

Related branches



Uday: Sounds like a good direction. It should not be too hard to implement this because many of the required elements are already present, such as selectors. The actions need some careful thought. But they can be defined incrementally. There will be a lot of demand for this stuff, once it goes out! And, demands for new extensions too!

Arik: What about the following entry point:

=== modified file 'lisp/vm-folder.el'
--- lisp/vm-folder.el 2010-08-19 00:00:02 +0000
+++ lisp/vm-folder.el 2010-08-19 00:33:19 +0000
@@ -4429,6 +4429,7 @@
              (vm-run-message-hook (car new-messages)
              (setq new-messages (cdr new-messages))))
        (run-hooks 'vm-arrived-messages-hook)))
     (if (and new-messages vm-virtual-buffers)

This would behave such that the arrived-message-hook would run on all incoming messages regardless of filters, but arrived-messages-hook would only run on messages actually staying in the inbox. The code would have to be modified a little to have the new function actually change the message list if need be (e.g. filter skips inbox). I looked at it a bit and the vm-build-virtual-message-list can almost if not already do everything needed as far as selectors. The action alist would then perhaps be structured as

'(((selector) 'action "action args" 'action "action args"))

where selector is the same as virtual folder, i.e. (("folder spec") (selections spec)). I see a few actions to start with:

'move - save in another folder (this has spam filtering capability)
'add-label - set a label to the message
'set-attribute - mark message as read or whatever

Arik: see branch message-filters, which implements this for "label" and "set-attributes". An example of vm-auto-filter-alist that
takes message from me with the subject "test" and adds a label and marks as read:
    (author "arik")
    (subject "test")))
I think the "move" action is going to take a little more work, since currently in VM there seems to be no way to save a message by it's message attribute but rather only if it is selected...

Arik: I change my mind. The "save" and "skip-inbox" actions are actually easy. Expunging can occur during this assimilate process without issues (that I can see so far) and can be run on a spare message list (i.e. just one message). It is even smooth such that I do not see the message flash before going away! The thing left to do is now make sure that the vm-arrived-messages-hook (run after filtering) is modified to have "skip-inbox" messages removed.


Work Items

This blueprint contains Public information 
Everyone can see this information.