#1373 accepted
Vadim Belobrovka

Regular Expressions for Conditions and Submailboxes

Reported by Vadim Belobrovka | January 6th, 2016 @ 02:41 PM

Hi,

  1. Please provide support for Regex in Smart Mailbox Conditions. "Contains" is just not cutting it.

  2. Another huge one is Regex support in Submailboxes - I would like to be able to group by unique value that is extracted via a REGEX. For example github emails that are coming in due to a given pull request communication come in this format:

    "[repo name] pull request name"

I would like to be able to extract repo name and group all the github communication emails by those repo names via Submailboxes.

All hail MailMate!
Thank you very much!
Vadim

Comments and changes to this ticket

  • Chris

    Chris February 8th, 2017 @ 12:41 AM

    Hi, I endorse the request for regex support in conditions.

    In addition, I suggest the following:

    1) add condition "Value in Header"
    2) allow user to enter header elements (e.g., custom x-headers) not found in current mails while setting up rules
    3) interface to manage, import and export rules or rulesets, so that you can easily assign them to different folders

    Fortunately, one can edit the relevant config files; that helps a lot with 2) and 3).

    May I use the opportunity to ask what "any address" includes?

  • Muescha
  • Tee Yen Ng

    Tee Yen Ng November 29th, 2017 @ 06:01 AM

    FWIW, I was just looking for a way to do just this. Turned up this ticket, but found a semi-solution subsequent. Thought it best to leave a bread crumb for anyone else searching :)

    You can use regexp in the Mailbox name format: entry under sub-mailboxes.

    I still end up with a submailbox for each individual subject, but the mailbox names are displayed as per the regexp. For example:

    ${subject.body/(.*)RFI[ -]*([0-9]+)\s*(.*)/RFI-${2} - ${3}/}
    

    Would be curious if there is a way to use the custom mailbox name format as the unique value!

    Found this over here:
    http://blog.froztbyte.net/2016/12/mailmate-submailbox-snr-hack/

  • Tee Yen Ng
  • benny

    benny November 29th, 2017 @ 12:35 PM

    • State changed from “new” to “accepted”

    @Tee Yen Ng: Thanks for the updates and for finding the relevant information yourself. The low-level editing of custom specifiers is still the only way to get regular expressions. I'm thinking it'll stay this way, but I might eventually add a GUI for creating new specifiers more easily. This is what the “accepted” state is for in this ticket.

    Sorry for not replying to this ticket earlier on.

  • Muescha

    Muescha January 25th, 2018 @ 12:58 AM

    i tried all rules for submailbox:

    ${subject.body/([\[\]a-zA-Z]*).*/${1}/}

    but for a "[abc] Subject" i always get an list of unique folders with always one entry (like the screenshot)

    i get it not working

    But i find out just Change it to "subject -> blob" i get a list of the [abc] selectors.

    BTW:

    • i think there should be a better documentation of all the hidden features
    • editing the plist fildes are to complicated just now :(
  • Mike K

    Mike K November 20th, 2019 @ 04:26 AM

    +1 for a GUI for this, or some easier way, or clear documentation of some sort. I'm trying to create a smart mailbox condition that matches all emails addressed to /john[0-9a-f]+\@smith.com/

    I'm totally fine with editing .plist files, I just need to know how to do what I want. All the above seems to solve the problem for submailboxes, but not for smart mailbox conditions.

    I sure wish I could just make a rule that says "To" "matches Regex" "john[0-9a-f]+\@smith.com"

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

Pages