Re: Possible Sieve vacation bug (Was: [exim] Sieve vacation)

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Bob Johannessen
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: Possible Sieve vacation bug (Was: [exim] Sieve vacation)
Michael Haardt wrote:
>>That's too bad. Having Exim syntax check Sieve scripts is a really nice
>>feature.
>
> So that's why you would like that. I will look into it, but it is
> unlikely I can come up with a patch RSN.


No problem for me. I've implemented my suggested temporary solution and
that seems to do the trick in my environment (Sieve scripts in database
and syntax-check-on-update).

>>>No, each user must have its own vacation directory or you may run into
>>>databases being used for more than one user.
>>
>>Then isn't that a problem for aliases as well?
>
> Sieve requires that keep is equivalent to filing the message to the
> users inbox. Aliases have no inbox, so you can not run Sieve filters
> on aliases if obeying the RFC strictly.


I don't agree with that interpretation. Users have inboxes and users
have aliases. So keep should file the message to the /users/ inbox,
not the inbox of the alias.

And even if I'm wrong we'll still have a potential problem when
using :addresses (either for aliases of for forwarded messages). The
current draft doesn't go into this in detail, but the way i read it
the following script is REQUIRED to execute the second vacation
statement even if the sender is in the once file for the first:

vacation :addresses "bob@???" "I'll be back for newyears";
vacation :addresses "alias@???" "I'll be back for newyears";

I've attached a small patch that I think solves this, but I'm not
familiar with *uschar-s and Ustrlen so please have a close look at
it before considering applying it.

> In the beginning, I thought this was a restriction, because I have quite
> some role accounts all pointing to my mailbox and I wanted filters for
> all of them. By now I found it way easier to run a central filter that
> looks at the envelope recipient, where needed.


One more thing (after reading more of the vacation code):

.../src/sieve.c, line 2397:
----------------------------------------------------------------------
     days=VACATION_MIN_DAYS>7 ? VACATION_MIN_DAYS : 7;
     subject.character=(uschar*)0;
     subject.length=-1;
     aliases=NULL;
     reason_is_mime=0;
     for (;;)
       {
       if (parse_white(filter)==-1) return -1;
       if (parse_identifier(filter,CUS ":days")==1)
         {
         if (parse_white(filter)==-1) return -1;
         if (parse_number(filter,&days)==-1) return -1;
         if (days<VACATION_MIN_DAYS) days=VACATION_MIN_DAYS;
         else if (days>VACATION_MAX_DAYS) days=VACATION_MAX_DAYS;
         }
----------------------------------------------------------------------


First line; shouldn't that be VACATION_MAX_DAYS in that calculation?

draft-showalter-sieve-vacation-06.txt, 3.1. Days Parameter:
----------------------------------------------------------------------
      The ":days" argument is used to specify the period in which
      addresses are kept and are not responded to, and is always
      specified in days.  The minimum value used for this parameter is
      normally 1.  Sites MAY define a different minimum value.  Sites MAY
      also define a maximum days value, which MUST be greater than 7, and
      SHOULD be greater than 30.
----------------------------------------------------------------------



    Bob

--- src/sieve.c-orig 2005-02-17 05:20:00.000000000 +0000
+++ src/sieve.c 2005-02-17 05:22:48.000000000 +0000
@@ -2457,6 +2457,7 @@
       address_item *addr;
       int capacity,start;
       uschar *buffer;
+      uschar *delivering_to;
       int buffer_capacity;
       struct String key;
       md5 base;
@@ -2474,12 +2475,14 @@


         /* build oncelog filename */


+        delivering_to = expand_string(US"$local_part@$domain");
         key.character=(uschar*)0;
         key.length=0;
         capacity=0;
         if (subject.length!=-1) key.character=string_cat(key.character,&capacity,&key.length,subject.character,subject.length);
         key.character=string_cat(key.character,&capacity,&key.length,reason_is_mime?US"1":US"0",1);
         key.character=string_cat(key.character,&capacity,&key.length,reason.character,reason.length);
+        key.character=string_cat(key.character,&capacity,&key.length,delivering_to,Ustrlen(delivering_to));
         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]);