dovecot-sieve-1.0: Merge in changes from CMU sieve 2.3.8

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 9 15:13:06 EEST 2007


details:   http://hg.dovecot.org/dovecot-sieve-1.0/rev/5132f4b25eb0
changeset: 28:5132f4b25eb0
user:      <pod at sysdev.oucs.ox.ac.uk>
date:      Tue Aug 07 20:24:57 2007 +0100
description:
Merge in changes from CMU sieve 2.3.8

diffstat:

1 file changed, 40 insertions(+), 8 deletions(-)
src/libsieve/bc_eval.c |   48 ++++++++++++++++++++++++++++++++++++++++--------

diffs (106 lines):

diff -r 9137442dd18a -r 5132f4b25eb0 src/libsieve/bc_eval.c
--- a/src/libsieve/bc_eval.c	Wed Aug 01 15:02:51 2007 +0300
+++ b/src/libsieve/bc_eval.c	Tue Aug 07 20:24:57 2007 +0100
@@ -124,7 +124,7 @@ static int sysaddr(const char *addr)
     if (!strncasecmp(addr, "majordomo", 9))
 	return 1;
 
-    if (strstr(addr, "-request"))
+    if (strstr(addr, "-request@"))
 	return 1;
 
     if (!strncmp(addr, "owner-", 6))
@@ -186,6 +186,17 @@ static char* look_for_me(char *myaddr, i
 
     return found;
 }
+
+static char *list_fields[] = {
+    "list-id",
+    "list-help",
+    "list-subscribe",
+    "list-unsubscribe",
+    "list-post",
+    "list-owner",
+    "list-archive",
+    NULL
+};
  
 /* Determine if we should respond to a vacation message */
 static int shouldRespond(void * m, sieve_interp_t *interp,
@@ -195,14 +206,28 @@ static int shouldRespond(void * m, sieve
     const char **body;
     char buf[128];
     char *myaddr = NULL;
-    int l = SIEVE_OK;
+    int l = SIEVE_OK, j;
     void *data = NULL, *marker = NULL;
     char *tmp;
     int curra, x;
     char *found=NULL;
     char *reply_to=NULL;
   
-    /* is there an Auto-Submitted keyword other than "no"? */
+    /* Implementations SHOULD NOT respond to any message that contains a
+       "List-Id" [RFC2919], "List-Help", "List-Subscribe", "List-
+       Unsubscribe", "List-Post", "List-Owner" or "List-Archive" [RFC2369]
+       header field. */
+    for (j = 0; list_fields[j]; j++) {
+	strcpy(buf, list_fields[j]);
+	if (interp->getheader(m, buf, &body) == SIEVE_OK) {
+	    l = SIEVE_DONE;
+	    break;
+	}
+    }
+
+    /* Implementations SHOULD NOT respond to any message that has an
+       "Auto-submitted" header field with a value other than "no".
+       This header field is described in [RFC3834]. */
     strcpy(buf, "auto-submitted");
     if (interp->getheader(m, buf, &body) == SIEVE_OK) {
 	/* we don't deal with comments, etc. here */
@@ -212,6 +237,7 @@ static int shouldRespond(void * m, sieve
     }
 
     /* is there a Precedence keyword of "junk | bulk | list"? */
+    /* XXX  non-standard header, but worth checking */
     strcpy(buf, "precedence");
     if (interp->getheader(m, buf, &body) == SIEVE_OK) {
 	/* we don't deal with comments, etc. here */
@@ -282,7 +308,7 @@ static int shouldRespond(void * m, sieve
     if (l == SIEVE_OK) {
 	/* ok, we're willing to respond to the sender.
 	   but is this message to me?  that is, is my address
-	   in the TO, CC or BCC fields? */
+	   in the [Resent]-To, [Resent]-Cc or [Resent]-Bcc fields? */
 	if (strcpy(buf, "to"), 
 	    interp->getheader(m, buf, &body) == SIEVE_OK)
 	    found = look_for_me(myaddr, numaddresses ,bc, i, body);
@@ -290,6 +316,15 @@ static int shouldRespond(void * m, sieve
 		       (interp->getheader(m, buf, &body) == SIEVE_OK)))
 	    found = look_for_me(myaddr, numaddresses, bc, i, body);
 	if (!found && (strcpy(buf, "bcc"),
+		       (interp->getheader(m, buf, &body) == SIEVE_OK)))
+	    found = look_for_me(myaddr, numaddresses, bc, i, body);
+	if (!found && (strcpy(buf, "resent-to"), 
+		       (interp->getheader(m, buf, &body) == SIEVE_OK)))
+	    found = look_for_me(myaddr, numaddresses ,bc, i, body);
+	if (!found && (strcpy(buf, "resent-cc"),
+		       (interp->getheader(m, buf, &body) == SIEVE_OK)))
+	    found = look_for_me(myaddr, numaddresses, bc, i, body);
+	if (!found && (strcpy(buf, "resent-bcc"),
 		       (interp->getheader(m, buf, &body) == SIEVE_OK)))
 	    found = look_for_me(myaddr, numaddresses, bc, i, body);
 	if (!found)
@@ -1093,10 +1128,7 @@ int sieve_eval_bc(sieve_interp_t *i, con
 			/* s[0] contains the original subject */
 			const char *origsubj = s[0];
 
-			while (!strncasecmp(origsubj, "Re: ", 4)) 
-			    origsubj += 4;
-
-			snprintf(subject, sizeof(subject), "Re: %s", origsubj);
+			snprintf(subject, sizeof(subject), "Auto: %s", origsubj);
 		    }
 		} else {
 		    /* user specified subject */


More information about the dovecot-cvs mailing list