Using a filter for the return trip

I get mail where "From" and "Reply-to" are different from "Return-Path", "Received from", as shown in this example. How to configure a filter for such mail?

Return-Path: < cybersho@bhasha.interpole.net > Received: from bhasha.interpole.net (bhasha.interpole.net. Received: from cybersho by bhasha.interpole.net with local (Exim 4.77) (envelope-from < cybersho@bhasha.interpole.net >) From: "Gadima.com" < books@gadima.com > Reply-to: "Gadima.com" < books@gadima.com > 
+6
source share
1 answer

In Gmail, unfortunately, this is not possible.

I returned to my email client, Gnus (due to its amazing flexibility and ease) to do this. Details are explained in the section โ€œ6.3.3 Client-side IMAP Splittingโ€ in its manual.

It was surprisingly easy. In my ".gnus.el" file, I put (I use the nnimap server for Gmail) something like this:

 (setq nnimap-split-methods '(("mail-list-folder" "Return-Path: mail-list-address") ("INBOX" "")) 

You will need to adapt the parts "mail-list-folder" (label) and "Return-Path: mail-list-address" accordingly. A string containing "Return-Path: ..." is a regular expression, so you can use wildcards such as. * And even groups. For example, to filter out some of the lists that I subscribed to, I have:

 (setq nnimap-split-methods '(("list.\\1" "^Return-Path: <\\(.*\\)-bounces.*@gnu.org>") ("INBOX" "")) 

Pay attention to the capture group \\ (. * \\), which is used to form my label, as well as the adaptations necessary to match the return path generated by the mailing list program.

If you want to try, I can suggest the following wiki to get started: https://www.emacswiki.org/emacs/GnusGmail .

+1
source

Source: https://habr.com/ru/post/920876/


All Articles