[exim-cvs] cvs commit: exim/exim-doc/doc-txt README.SIEVE e…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: exim-cvs
Sujet: [exim-cvs] cvs commit: exim/exim-doc/doc-txt README.SIEVE exim/exim-src/src globals.c sieve.c version.c
ph10 2005/03/01 10:21:44 GMT

  Modified files:
    exim-doc/doc-txt     README.SIEVE 
    exim-src/src         globals.c sieve.c version.c 
  Log:
  (1) Update version number and (overlooked) copyright date.
  (2) Sieve patch for testing vacation handling with -bf.


  Revision  Changes    Path
  1.2       +4 -25     exim/exim-doc/doc-txt/README.SIEVE
  1.18      +1 -1      exim/exim-src/src/globals.c
  1.8       +90 -78    exim/exim-src/src/sieve.c
  1.7       +1 -1      exim/exim-src/src/version.c


  Index: README.SIEVE
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/README.SIEVE,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.SIEVE    7 Oct 2004 15:04:35 -0000    1.1
  +++ README.SIEVE    1 Mar 2005 10:21:43 -0000    1.2
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/README.SIEVE,v 1.1 2004/10/07 15:04:35 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/README.SIEVE,v 1.2 2005/03/01 10:21:43 ph10 Exp $


                 Notes on the Sieve implementation for Exim


@@ -363,12 +363,6 @@
the UTF-8 reason is processed to compose the resulting message.


-Envelope Sender
-
-The vacation draft does not specify the envelope sender. This
-implementation uses the empty envelope sender to prevent mail loops.
-
-
Default Subject

The draft specifies that the default message subject is "Re: "
@@ -388,25 +382,10 @@

Rate Limiting Responses

  -The draft says:
  -
  -     Vacation responses are not just per address, but are per address
  -     per vacation command.
  -
  -This is badly worded, because commands are not enumerated.  It meant
  -to say:
  -
  -     Vacation responses are not just per address, but are per address
  -     per reason string and per specified subject and ":mime" option.
  -
  -Existing implementations work that way and it makes more sense, too.
  -Including the ":mime" option is mostly for correctness, as the reason
  -strings with and without this option are rarely equal.
  -
  -This implementation hashes the reason, specified subject and ":mime"
  -option and uses the hex string representation as filename within the
  -"sieve_vacation_directory" to store the recipient addresses for this
  -vacation parameter set.
  +This implementation hashes the reason, specified subject, ":mime"
  +option and ":addresses" option and uses the hex string representation
  +as filename within the "sieve_vacation_directory" to store the recipient
  +addresses for this vacation parameter set.


The draft specifies that sites may define a minimum ":days" value than 1.
This implementation uses 1. The maximum value MUST greater than 7,

  Index: globals.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/globals.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- globals.c    17 Feb 2005 11:58:26 -0000    1.17
  +++ globals.c    1 Mar 2005 10:21:44 -0000    1.18
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/globals.c,v 1.17 2005/02/17 11:58:26 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/globals.c,v 1.18 2005/03/01 10:21:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1167,7 +1167,7 @@
   uschar *warnmsg_recipients     = NULL;
   BOOL    write_rejectlog        = TRUE;


  -uschar *version_copyright      = US"Copyright (c) University of Cambridge 2004";
  +uschar *version_copyright      = US"Copyright (c) University of Cambridge 2005";
   uschar *version_date           = US"?";
   uschar *version_cnumber        = US"????";
   uschar *version_string         = US"?";


  Index: sieve.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/sieve.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- sieve.c    17 Feb 2005 11:58:26 -0000    1.7
  +++ sieve.c    1 Mar 2005 10:21:44 -0000    1.8
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/sieve.c,v 1.7 2005/02/17 11:58:26 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/sieve.c,v 1.8 2005/03/01 10:21:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -2468,11 +2468,12 @@


         if (filter_personal(aliases,TRUE))
           {
  +        if (filter_test == FTEST_NONE)
  +          {
  +          /* ensure oncelog directory exists; failure will be detected later */


  -        /* ensure oncelog directory exists; failure will be detected later */
  -
  -        (void)directory_make(NULL, filter->vacation_directory, 0700, FALSE);
  -
  +          (void)directory_make(NULL, filter->vacation_directory, 0700, FALSE);
  +          }
           /* build oncelog filename */


           key.character=(uschar*)0;
  @@ -2489,91 +2490,102 @@
           md5_start(&base);
           md5_end(&base, key.character, key.length, digest);
           for (i = 0; i < 16; i++) sprintf(CS (hexdigest+2*i), "%02X", digest[i]);
  -        capacity=Ustrlen(filter->vacation_directory);
  -        start=capacity;
  -        once=string_cat(filter->vacation_directory,&capacity,&start,US"/",1);
  -        once=string_cat(once,&capacity,&start,hexdigest,33);
  -        once[start] = '\0';
  -
  -        /* process subject */
  -
  -        if (subject.length==-1)
  -          {
  -          expand_header(&subject,&str_subject);
  -          while (subject.length>=4 && Ustrncmp(subject.character,"Re: ",4)==0)
  -          {
  -            subject.character+=4;
  -            subject.length-=4;
  -          }
  -          capacity=6;
  -          start=6;
  -          subject.character=string_cat(US"Auto: ",&capacity,&start,subject.character,subject.length);
  -          subject.length=start;
  -          }
  -
  -        /* add address to list of generated addresses */
  -
  -        addr = deliver_make_addr(string_sprintf(">%.256s", sender_address), FALSE);
  -        setflag(addr, af_pfr);
  -        setflag(addr, af_ignore_error);
  -        addr->next = *generated;
  -        *generated = addr;
  -        addr->reply = store_get(sizeof(reply_item));
  -        memset(addr->reply,0,sizeof(reply_item)); /* XXX */
  -        addr->reply->to = string_copy(sender_address);
  -        addr->reply->from = expand_string(US"$local_part@$domain");
  -        /* Allocation is larger than neccessary, but enough even for split MIME words */
  -        buffer_capacity=16+4*subject.length;
  -        buffer=store_get(buffer_capacity);
  -        addr->reply->subject=parse_quote_2047(subject.character, subject.length, US"utf-8", buffer, buffer_capacity);
  -        addr->reply->oncelog=once;
  -        addr->reply->once_repeat=days*86400;
  +        if (filter_test != FTEST_NONE)
  +          {
  +          debug_printf("Sieve: mail was personal, vacation file basename: %s\n", hexdigest);
  +          }
  +        else
  +          {
  +          capacity=Ustrlen(filter->vacation_directory);
  +          start=capacity;
  +          once=string_cat(filter->vacation_directory,&capacity,&start,US"/",1);
  +          once=string_cat(once,&capacity,&start,hexdigest,33);
  +          once[start] = '\0';


  -        /* build body and MIME headers */
  +          /* process subject */


  -        if (reason_is_mime)
  -          {
  -          uschar *mime_body,*reason_end;
  +          if (subject.length==-1)
  +            {
  +            expand_header(&subject,&str_subject);
  +            while (subject.length>=4 && Ustrncmp(subject.character,"Re: ",4)==0)
  +            {
  +              subject.character+=4;
  +              subject.length-=4;
  +            }
  +            capacity=6;
  +            start=6;
  +            subject.character=string_cat(US"Auto: ",&capacity,&start,subject.character,subject.length);
  +            subject.length=start;
  +            }
  +
  +          /* add address to list of generated addresses */
  +
  +          addr = deliver_make_addr(string_sprintf(">%.256s", sender_address), FALSE);
  +          setflag(addr, af_pfr);
  +          setflag(addr, af_ignore_error);
  +          addr->next = *generated;
  +          *generated = addr;
  +          addr->reply = store_get(sizeof(reply_item));
  +          memset(addr->reply,0,sizeof(reply_item)); /* XXX */
  +          addr->reply->to = string_copy(sender_address);
  +          addr->reply->from = expand_string(US"$local_part@$domain");
  +          /* Allocation is larger than neccessary, but enough even for split MIME words */
  +          buffer_capacity=16+4*subject.length;
  +          buffer=store_get(buffer_capacity);
  +          addr->reply->subject=parse_quote_2047(subject.character, subject.length, US"utf-8", buffer, buffer_capacity);
  +          addr->reply->oncelog=once;
  +          addr->reply->once_repeat=days*86400;
  +
  +          /* build body and MIME headers */
  +
  +          if (reason_is_mime)
  +            {
  +            uschar *mime_body,*reason_end;
   #ifdef RFC_EOL
  -          static const uschar nlnl[]="\r\n\r\n";
  +            static const uschar nlnl[]="\r\n\r\n";
   #else
  -          static const uschar nlnl[]="\n\n";
  +            static const uschar nlnl[]="\n\n";
   #endif


  -          for
  -            (
  -            mime_body=reason.character,reason_end=reason.character+reason.length;
  -            mime_body<(reason_end-sizeof(nlnl)-1) && memcmp(mime_body,nlnl,sizeof(nlnl)-1);
  -            ++mime_body
  -            );
  -          capacity = 0;
  -          start = 0;
  -          addr->reply->headers = string_cat(NULL,&capacity,&start,reason.character,mime_body-reason.character);
  -          addr->reply->headers[start] = '\0';
  -          capacity = 0;
  -          start = 0;
  -          if (mime_body+(sizeof(nlnl)-1)<reason_end) mime_body+=sizeof(nlnl)-1;
  -          else mime_body=reason_end-1;
  -          addr->reply->text = string_cat(NULL,&capacity,&start,mime_body,reason_end-mime_body);
  -          addr->reply->text[start] = '\0';
  -          }
  -        else
  -          {
  -          struct String qp;
  +            for
  +              (
  +              mime_body=reason.character,reason_end=reason.character+reason.length;
  +              mime_body<(reason_end-sizeof(nlnl)-1) && memcmp(mime_body,nlnl,sizeof(nlnl)-1);
  +              ++mime_body
  +              );
  +            capacity = 0;
  +            start = 0;
  +            addr->reply->headers = string_cat(NULL,&capacity,&start,reason.character,mime_body-reason.character);
  +            addr->reply->headers[start] = '\0';
  +            capacity = 0;
  +            start = 0;
  +            if (mime_body+(sizeof(nlnl)-1)<reason_end) mime_body+=sizeof(nlnl)-1;
  +            else mime_body=reason_end-1;
  +            addr->reply->text = string_cat(NULL,&capacity,&start,mime_body,reason_end-mime_body);
  +            addr->reply->text[start] = '\0';
  +            }
  +          else
  +            {
  +            struct String qp;


  -          capacity = 0;
  -          start = reason.length;
  -          addr->reply->headers = US"MIME-Version: 1.0\n"
  -                                 "Content-Type: text/plain;\n"
  -                                 "\tcharset=\"utf-8\"\n"
  -                                 "Content-Transfer-Encoding: quoted-printable";
  -          addr->reply->text = quoted_printable_encode(&reason,&qp)->character;
  +            capacity = 0;
  +            start = reason.length;
  +            addr->reply->headers = US"MIME-Version: 1.0\n"
  +                                   "Content-Type: text/plain;\n"
  +                                   "\tcharset=\"utf-8\"\n"
  +                                   "Content-Transfer-Encoding: quoted-printable";
  +            addr->reply->text = quoted_printable_encode(&reason,&qp)->character;
  +            }
             }
           }
  +        else if (filter_test != FTEST_NONE)
  +          {
  +          debug_printf("Sieve: mail was not personal, vacation would ignore it\n");
  +          }
         }
       }
  +    else break;
   #endif
  -  else break;
     }
   return 1;
   }
  @@ -2613,7 +2625,7 @@


if (parse_white(filter)==-1) return -1;

  -if (exec && filter->vacation_directory != NULL)   /* 2nd test added by PH */
  +if (exec && filter->vacation_directory != NULL && filter_test == FTEST_NONE)
     {
     DIR *oncelogdir;
     struct dirent *oncelog;
  @@ -2672,7 +2684,7 @@
   #ifdef VACATION
       else if (eq_asciicase(check,&str_vacation,0))
         {
  -      if (filter->vacation_directory == NULL)
  +      if (filter_test == FTEST_NONE && filter->vacation_directory == NULL)
           {
           filter->errmsg=CUS "vacation disabled";
           return -1;


  Index: version.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/version.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- version.c    17 Feb 2005 14:53:50 -0000    1.6
  +++ version.c    1 Mar 2005 10:21:44 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/version.c,v 1.6 2005/02/17 14:53:50 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/version.c,v 1.7 2005/03/01 10:21:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -12,7 +12,7 @@
   #include "exim.h"



-#define THIS_VERSION "4.50"
+#define THIS_VERSION "4.51"


/* The header file cnumber.h contains a single line containing the