Re: [exim-dev] Personal condition and mailing list headers

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Michael Haardt
Dátum:  
Címzett: exim-dev
Tárgy: Re: [exim-dev] Personal condition and mailing list headers
On Fri, Sep 23, 2005 at 09:25:22AM +0100, Philip Hazel wrote:
> > In case there are more List headers than those above, it would make sense
> > to add them to the above list or even suggest to use "List-*" instead.
> > In case there are no more, I would prefer if Exim used exactly that list
>
> I imagine that I imagined that people would keep inventing new List-
> header lines, and it seemed sensible to react to any of them. The
> feature was added at 4.42 but the ChangLog doesn't give any background.


Well, List-* headers other than those documented to be used for
mailing lists may not be related to mailing lists, thus suppressing
automatic replies. So far nobody I asked could give specific examples
of additional List-* headers used for mailing lists. For that reason,
and for compliance with the Sieve vacation extension draft 3, here is
a patch for the personal condition.

It also changes how Auto-submitted is interpreted. Before, it
had to contain the value "auto-*". Now it has to contain anything
but "no".

The patch is for 4.53-RC2. In case that makes a difference, just
say so and I will send one for 4.53.

Michael
----------------------------------------------------------------------
--- src/filter.c.orig    2005-09-20 11:23:35.000000000 +0200
+++ src/filter.c    2005-09-23 11:15:46.000000000 +0200
@@ -2320,15 +2325,27 @@
 header_line *h;
 int to_count = 2;
 int from_count = 9;
+BOOL auto_submitted = FALSE;


-/* If any header line in the message starts with "List-", it is not
-a personal message. */
+/* If any header line in the message starts with one of the "List-" header
+fields, it is not a personal message. Note the use of Auto-submitted:,
+which is not unpersonal in itself, just if used with any value but "no". */

 for (h = header_list; h != NULL; h = h->next)
   {
-  if (h->type != htype_old && h->slen > 5 &&
-      strncmpic(h->text, US"List-", 5) == 0)
+  if (h->type != htype_old && (
+     (h->slen >= 8 && strncmpic(h->text, US"List-Id:", 8) == 0) ||
+     (h->slen >= 10 && strncmpic(h->text, US"List-Help:", 10) == 0) ||
+     (h->slen >= 15 && strncmpic(h->text, US"List-Subscribe:", 15) == 0) ||
+     (h->slen >= 17 && strncmpic(h->text, US"List-Unsubscribe:", 17) == 0) ||
+     (h->slen >= 10 && strncmpic(h->text, US"List-Post:", 10) == 0) ||
+     (h->slen >= 11 && strncmpic(h->text, US"List-Owner:", 11) == 0) ||
+     (h->slen >= 13 && strncmpic(h->text, US"List-Archive:", 13) == 0)))
     return FALSE;
+
+  if (h->type != htype_old && h->slen >= 15 &&
+      strncmpic(h->text, US"Auto-submitted:", 15) == 0)
+    auto_submitted = TRUE;
   }


 /* Set up "my" address */
@@ -2384,7 +2401,11 @@
     "^daemon@", "^root@", "^listserv@", "^majordomo@", "^.*?-request@",
     "^owner-[^@]+@", self, self_from, psself, psself_from) &&


-  header_match(US"auto-submitted:", FALSE, FALSE, NULL, 1, "auto-") &&
+  (
+    !auto_submitted ||
+    header_match(US"auto-submitted:", FALSE, TRUE, NULL, 1, "no")
+  ) &&
+
   header_match(US"precedence:", FALSE, FALSE, NULL, 3, "bulk","list","junk") &&


(sender_address == NULL || sender_address[0] != 0);