[MlMt] spacebar: scroll message, or toggle headers?

Benny Kjær Nielsen mailinglist at freron.com
Mon Feb 16 02:40:56 EST 2015


Sorry about the long technical reply, but you might find it interesting.

On 16 Feb 2015, at 1:03, Allie Martin wrote:

> On 15 Feb 2015, at 15:06, Shoshanna Green wrote:
>
>> I'm currently trying out MailMate; though I can't switch to it until 
>> it has a "correspondent" column,
>
> I'm wondering what I'm missing here. :)  I've found useful features by 
> simple exploration.  However, the help is not being very helpful on 
> exactly what a 'correspondent' is in the context of received messages 
> or threads.

It's not documented except for what I wrote in the release notes when I 
released r5056 as a test version.

The “Correspondent” feature was requested by Shoshanna and I 
implemented it, because it was an interesting generalization of what 
MailMate can already do. Internally, MailMate has a system of 
“specifiers”. It's based on regular expressions and it's what allows 
you to match on a specific part of a header. For example:

	To ▸ Domain

The above is actually an abbreviated form. The “real” specifiers in 
use are:

	To ▸ Split ▸ Address ▸ Domain

This is all defined in a text file within the application bundle named 
`specifiers.plist`. (Hardcore users can define more specifiers in a file 
in the app support folder although I don't make any promises that I 
won't change how this works some day.)

The limitation of the above is that it cannot use information unrelated 
to the header name/value. For example, it cannot change behaviour 
depending on whether or not a given address is a user identity. This is 
what I changed with the introduction of the “Correspondent” and 
“Identity” specifiers. These are **hardcoded** functions which can 
be applied to various address related headers. For example, given this 
header,

	To: someoneelse at example.com, me at example.org

the various specifiers would result in these values:

	To ▸ Domain:                  example.com, example.org
	To ≫ Identity ▸ Domain:       example.org
	To ≫ Correspondent ▸ Domain:  example.com

Most importantly, these function specifiers can be used to separate 
email addresses into user identities and correspondents. This allows a 
message list column which only lists the correspondent when both sent 
and received messages are present in the current (smart) mailbox. This 
also requires (the already existing) feature of the specifier system 
which allows matching on multiple headers. In `specifiers.plist` it 
looks like this:

	"#any-address" = {
			specifiers = ( "from", "to.split", "cc.split", "bcc.split" );
	};

Given the features above, the configuration file for message list 
columns (`outlineColumns.plist`) defines a “Correspondent” column 
which uses the following format string:

	formatString = "${from.#identity:?➜ 
:}${#any-address.#correspondent.name:${#any-address.#correspondent.address}}";

In English: If the from header is an identity address then prefix “➜ 
”. This is followed by the first name of an address found in 
from/to/cc/bcc which is a correspondent. (The name is preferred, but if 
it doesn't exist then the email address is used instead).

I wrote “if the from header is an identity address”, but it's really 
more like “if a from value exists after the from header has been 
filtered through the identity function”.

This feature can also be useful when searching for messages to be able 
to do things like “To ≫ Identity does not exist”. This limits the 
search to messages not sent directly to a known identity of the user.

Finally, this feature might be most useful when used with the 
“Submailboxes” feature in the mailbox editor. If both received and 
sent messages exist in a mailbox then it might make more sense to 
partition messages based on Correspondent or Identity than to do it 
based on any specific address header.

Sorry if this turned into an explanation of how it works instead of how 
it is supposed to be used :-)

(Since I have just implemented this feature I do not claim it works 
exactly as explained above, but let me know if it doesn't.)

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20150216/82a62e6f/attachment.html>


More information about the mailmate mailing list