1

I have a mail provider which allows me to upload sieve scripts to it. I would like to find out if it's possible to use sieve to make mailing lists subscriptions feel more like web based forums - where I get notifications (emails to my mailbox) just for new messages in threads I have replied to / I was mentioned in / I started my self.

To be more specific, the sieve script should check if a given message is part of a thread I have any affiliation with - just as described above.

From reading sieve scripts examples and the only source of reference I could find, it seems there is no way to get information related to 'threads'. I've wrote an imapfilter script that did pretty much what I'd like to do with sieve but even with this tool, it was completely nontrivial to get a list of all messages in a thread just by a single message.

Is it even possible to read previously received messages with the sieve standard?

Doron Behar
  • 165
  • 1
  • 6

1 Answers1

0

You do not need sieve to deal with more than one message at once, because you only need to identify one reply per thread - you can leave dealing with threads to your mail client.

Your mail client knows how to display only threads with Flagged or Unseen replies. So mark mailing list content as \Seen or \Flagged using sieve, skipping/filtering on messages that mention Message-ID ending in your domain in headers.

Why can you do that? Because you are typically able to ensure that your Message-IDs contain something uniquely identifying your own messages - if that is not already the case (shared domain), the simplest approach would be to modify the domain your mail client uses to generate the Message-ID (e.g. configured as mail.smtpserver.*.hello_argument in thunderbird).

  • If you store your outgoing mail in a different folder, this approach misses threads where nobody directly replied to you. I suspect those are not the threads you are interested in anyway.
  • The advantage of this approach is that your mail client can retroactively assemble threads that only now you are interested in - you will have the entire thread highlighted, even if you replied only somewhere deeper in the reply-to-reply tree.
anx
  • 8,963
  • 5
  • 24
  • 48
  • Are you sure the `Message-ID` header should contain something that can identify my own messages? I could only see that the domain of that address has the same domain as mine. And what about replies to replies of my messages? – Doron Behar Jul 09 '19 at 09:55
  • If it is not yet doing so, you can tell your mail client to chose suitable `Message-ID` headers. How many replies down the thread does not really matter, that "unfold threads with unread/marked messages" feature only needs *one* such message. – anx Jul 14 '19 at 10:52
  • I Use [Neomutt](https://neomutt.org/) and Gmail and it seems it's not possible to automatically set the `Message-ID` with some recognizable information.. Besides that, I'm not sure what do you mean by "unfold threads with unread/marked messages". – Doron Behar Jul 15 '19 at 06:00
  • That is the combination of "by default do not show me threads" and "show me threads which contain flagged messages". I assume anything called *mutt understands configuration like `collapse_flagged` and `collapse_all` (flagged or unread depending on what you used to mark your messages in sieve) – anx Jul 24 '19 at 05:10