#646 new
Sebastien Varrette

Support for imapfilter LUA syntax, automatic tag on reception and default layout

Reported by Sebastien Varrette | February 23rd, 2014 @ 09:25 PM

Dear Benny,

Like many before me, I discover MailMate for now a couple of days and I confess I'm rather impressed by it ;)
I just have a couple of perhaps naive questions / wishes I hope you (or others) can help me with.

Current tested version: Version 1.7.2 (3905), under Max OS 10.9.1.

1/ I use imapfilter to sort my mails - I was seduced by the LUA syntax to specify in a "generic" way (i.e. independent of a specific mail client) the sorting rules (using logical '+', '*', '!' etc. - see sample config) and to have access to "classic" regular expressions to match patterns on subject, to, from etc. fields.


    source = 'INBOX'
    function sortGenericAlerts(mbox)
       local results = UL[source]:contain_subject('[Bug ')                           +
          UL[source]:contain_subject('[Bugzilla Reminder]')                          +
          UL[source]:contain_from('logcheck')                                        +
          UL[source]:contain_from('logwatch')                                        +
          UL[source]:match_subject('^.*\\[rkhunter\\] .*$')                          +
          UL[source]:contain_subject('DenyHosts Report')                             +
          UL[source]:contain_subject('Anacron job ')                                 +
          UL[source]:contain_subject('exim paniclog on')                             +
          UL[source]:contain_subject('apt-listchanges: ')                            +
          UL[source]:contain_from('Cron Daemon')                                     +
          UL[source]:match_from('^Cron <')                                           +
          UL[source]:contain_from('Local Debian archive mirror')                     +
          UL[source]:contain_subject('package update(s) for')                        +
          UL[source]:contain_subject('*** SECURITY')                                 +
          UL[source]:contain_subject('WARNING: (yaBackup)')                          +
       results:move_messages(UL[mbox], results)

Would it be possible to somehow rely on the same syntax (or closed one) to define rules for MailMate? I could imagine a file-based structure under ~/Library/Application Support/MailMate/Resources/Rules/ (similar to the one used for keybindings) where the rule <rulename>.plist could have the content

    "rule" = {
          contain_subject('[Bugzilla Reminder]')                          +
          contain_from('logcheck')                                        +
          contain_from('logwatch')                                        +
          match_subject('^.*\\[rkhunter\\] .*$')                          +
          contain_subject('DenyHosts Report')                             +
          contain_subject('Anacron job ')                                 +
          contain_subject('exim paniclog on')                             +
          contain_subject('apt-listchanges: ')                            +
          contain_from('Cron Daemon')                                     +
          match_from('^Cron <')                                           +
          contain_from('Local Debian archive mirror')                     +
          contain_subject('package update(s) for')                        +
          contain_subject('*** SECURITY')                                 +
          contain_subject('WARNING: (yaBackup)')            
     "action" = ( "moveToMailbox:", "/INBOX/Alerts" ); 

In all cases, while I checked the "Experimental 2.0 Feature" in the General preferences of MailMate (and relaunched it), I cannot see any 'Rules' panel where I can specify my automatic actions on the incoming messages, especially for automatic tagging. Have I missed something ?

2/ I'm surprised I have to redefine by default for every mailbox the column layout I wish (to add for instance the 'Security' and 'Source Mailbox' column. Isn't there a way to precise a default layout ?

3/ How can I format the way the source mailbox is formatted ? I coun't find it in the preference pane.


Comments and changes to this ticket

  • benny

    benny February 24th, 2014 @ 10:26 AM

    1. It might be possible to do this using an external command, but it's unlikely to be a built-in feature. If you want to play with this then I can help you creating the bundle framework and how to provide it with the headers needed for each message -- and how to tell MailMate what to do with the message (it's similar to what you suggest). Send me an email (Help ▸ Send Feedback).

    The rules pane is in any mailbox editor window. Double-click a mailbox icon or right-click to choose Edit.

    1. See “Use as Default Columns” in the same menu as you use to enable/disable columns.

    2. I didn't understand this question.

    Thanks for trying out MailMate.

  • Sebastien Varrette

    Sebastien Varrette February 24th, 2014 @ 10:42 AM

    1. probably I shall better understand how you currently define and store the rules. Do you have a dev pointer on that?

    2. OK, thanks for the tip

    3. indeed, my question is badly phrased: in the "Source Mailbox" column, the default format of the displayed mailbox name seems to be (with appropriate variables names, I don't knowwhere they are all defined) ${source.path} - ${source:description}. Where is this defined and how can I alter it?

  • benny

    benny February 24th, 2014 @ 11:49 AM

    • State changed from “new” to “closed”
    1. As noted, write me an email and we'll discuss it there.

    2. The syntax is described here. The variable names are not documented. Most of them are just the header names of emails and the sub-specifiers are defined in the specifiers.plist file within the MailMate application bundle. It is probably easier to use values in the conditions of a smart mailbox and then look in this file for the corresponding variable names:

      ~/Library/Application Support/MailMate/Mailboxes.plist

    I'm sorry there is currently no easier way. Ideally, some kind of GUI would allow you to build the format string.

    I'll close the ticket, but you can still add comments.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket