[MlMt] Custom Search: remember search settings

Torsten Grust torsten.grust at gmail.com
Tue Feb 7 11:04:23 UTC 2012


Hi Benny,

thanks for the immediate feedback.

On 7 Feb 2012, at 11:41, Benny Kjær Nielsen wrote:
> On 7 Feb 2012, at 11:35, Torsten Grust wrote:
>> Could MailMate possibly remember non-default settings for `From' (and
>> `contains', I guess) between searches?
>
> Good idea: “Edit ▸ Find ▸ Use as Default Search” ;-)

Ugh.  *facepalm*.  Yes, that works just great.  Thanks.

>> P.S.: I *do* love the app and find myself adjusting/extending 
>> Mailboxes.plist
>> and specificiers.plist all the time. :-)
>
> I didn't know anyone dared to touch the specifiers.plist :-) Please 
> share if you make something that would be useful for other users. I 
> may change how it works in the future, but that is mostly related to 
> where custom specifiers can be configured (it's a bit monolithic at 
> the moment and it is possible to change/override specifiers which are 
> important to MailMate, i.e., it can make MailMate crash and behave in 
> strange ways).

My use case: I am associate editor of a database journal (TKDE, please
submit your best work there ;-) and am concurrently handling 
correspondence regarding papers under review.  The publisher's systems 
uses the subject line to include a marker that designates papers, e.g.

     "TKDE-YYYY-MM-NNNN.Rr Review Submitted ..."
     "Plese Submit Recommendation - Manuscript ID TKDE-YYYY-MM-NNNN"

(read: submitted to TKDE in _MM/YYYY_ as paper number _NNNN_ with 
optitional revision _r_).

In `specifiers.plist`, I have added a subject line parser that extracts 
the  `TKDE-YYYY-MM-NNNN`
markers and makes them available in the variables `tkde-paper` and 
`tkde-revision`:

         parsers =
         {
             subject = {
               header = "subject";
               [...]
               specifierCaptures = {
                       [...[
                       4 = { specifier = "body"; type="noTabs"; parsers 
= ( "words", "TKDE" ); };
               };
             };
             [...]
             TKDE = {
               // detect TKDE-yyyy-mm-nnnn[.Rr] TKDE submission 
identifiers (used in subject.body)
               specifierRegex = '(TKDE-\d{4}-\d{2}-\d{4})(?:\.(R\d))?';
               specifierCaptures = {
                       1 = { specifier = "tkde-paper"; };
                       2 = { specifier = "tkde-revision"; };
               };
             };
             [...]	
         }

(see the `parsers = (...)` list and the `TKDE` parser).

In `Mailboxes.plist` I then created a virtual TKDE mailbox that groups 
its messages by `tkde-paper` (and `tkde-revision`, if present):

         mailboxes = (
		      [...]
           {       filter = "subject.body.tkde-paper exists";
                   name = "TKDE";
                   parentUUID = "MAILBOXES";
                   partitioningFormatString = 
"${subject.body.tkde-paper}${subject.body.tkde-revision:+ 
(${subject.body.tkde-revision})}";
                   partitioningHeader = "subject.body.tkde-paper";
                   set = {
                           operator = "Any";
                           subSets = ( "INBOX:... at ....", "ARCHIVE" );
                   };
                   uuid = "TKDE";
           },
           [...]
         )

Effect: all correspondence regarding a specific paper grouped in its 
very own mailbox, created (and deleted) automatically as is needed.  
Wonderful.

MailMate is like SELECT-aggr-FROM-WHERE-GROUPBY for mail messages to me. 
  Insanely great.™

Cheers,
    --Torsten

P.S. I used MarkDown in this message.  Another great thing.

-- 
| Torsten "Teggy" Grust
| Torsten.Grust at gmail.com


More information about the mailmate mailing list