Tag-based email filtering

So I returned to my work email to discover that the site reorg broke all of the email filters I was using. Not surprising! But there’s a wrinkle. The docs say you should be able to filter on a list ID. But that seems to only work for categories, not tags.

For example, a recent reply to a thread tagged with “council” has a list ID of: List-ID: Fedora Discussion | Project Discussion <project-discussion.discussion.fedoraproject.org>.

This is a big usability regression for me personally, and probably for a lot of people who use Discussion in a variety of areas. Am I missing something?

1 Like

I’m not sure if it’s possible to put tags in headers — I’ll check with Discourse support. They should be in the headers now — the format string is:

%{optional_re}%{topic_title} [Fedora] %{optional_pm}%{optional_tags}

Although I see in practice that it makes headlines like this:

Fedora Discussion ➜ Fedora Chat bridge now active [Fedora] project-news

I could put a # in front of the tag name:

Fedora Discussion ➜ Fedora Chat bridge now active [Fedora] #project-news

… but I think that’d not work right when there’s multiple tags. So maybe also brackets of some kind? Like:

Fedora Discussion ➜ Fedora Chat bridge now active [Fedora] [project-news]

or

Fedora Discussion ➜ Fedora Chat bridge now active [Fedora] (project-news)

or

Fedora Discussion ➜ Fedora Chat bridge now active [Fedora] ⦕project-news⦖

or whatever. (Not that, probably.)

Or, we could do:

Fedora Discussion ➜ Fedora Chat bridge now active [Fedora: project-news]

?

Do you have an opinion?

For headers, it might be nice for it to be in X-Topics:, which is what Mailman uses (even though that’s a clash with how Discourse uses tags).

Okay, so, @bcottonlast time I thought about this I didn’t get a response to my public question, so I’m trying it — I set the email custom headers config option to include X-Topics: %{optional_tags}. Does that work?

1 Like

Yeah, they’re in the subject , but that can be a little hard to filter on reliably. Especially since GMail apparently doesn’t support the use of regular expressions in email filters. So where I had:

(list:"Fedora Council discussion of sensitive issues <council-private.lists.fedoraproject.org>" OR list:(Fedora-Council/council-docs) OR list:(council-discussion.project-conversations.discussion.fedoraproject.org))

I could instead do something like

(list:"Fedora Council discussion of sensitive issues <council-private.lists.fedoraproject.org>" OR list:(Fedora-Council/council-docs) OR (list:(project-discussion.discussion.fedoraproject.org) AND subject:council))

But that would also match any email from Discussion that happened to have “council” in the thread title, which is not necessarily what I want.

That should give me enough to work with. There’s a risk of mis-filtering when the desired tag is a substring of another tag (e.g. I want to match on “fedora” but the topic is “fedorable”), but I doubt we’ll see that often in practice.

However, there’s an implementation issue. I just got the email notification of your reply and it has this in the header:

X-Topics: %{optional_tags}

1 Like

That’s what I was afraid of. Okay, to support requests with me!

2 Likes