Subject: imapflags is sticky?

From: Scott Russell <[email-masked]>
Date: Tue, 23 Jul 2002 12:31:08 -0400

Greets.

If this is not the right list please direct me to the right list. I
have a cyrus 2.1.5 box with sieve scripts. I'm wondering a bit about
the functionality of imapflags and fileinto.

It appears as if setflag is sticky for all subsequent fileinto or keep
actions regardless of where the setflag was set in the script. For
example:

require ["fileinto", "imapflags"];

if header "subject" :contains "test1" {
   setflag "\\Seen";
   fileinto "test1 folder";
}

if header "subject" :contains "test2" {
   redirect "[email-masked]";
   keep;
}

In this case if the header was "Subject: test1 test2" would the
following actions happen:

1) message flagged "Answered"
2) message filed into folder "test1 folder"
3) message forwarded to "[email-masked]"
4) message filed into INBOX and NOT flagged as seen.

-- 
  Scott Russell ([email-masked])
  Linux Technology Center, System Admin, RHCE.
  Call 711 then ask for 919-543-9289 (TTY/TTD)

---

From: Ken Murchison <[email-masked]>
Date: Tue, 23 Jul 2002 20:28:59 -0400

> the functionality of imapflags and fileinto.

Note that Cyrus implements draft -03 of imapflags in which the imapflags 
list is essentially a global variable.  The latest draft makes an 
attempt to have both per action flags and global flags.  The subsequent 
draft(s) make dispose of the global flags.

> 1) message flagged "Answered"

How would this happen?  You never set this flag.

> 2) message filed into folder "test1 folder"

The filed message would be marked as seen.

> 4) message filed into INBOX and NOT flagged as seen.

The kept message would also be marked as seen.

-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp

---

From: Scott Russell <[email-masked]>
Date: Tue, 23 Jul 2002 20:55:02 -0400

> draft(s) make dispose of the global flags.

Noted. Thanks, this is important.

> How would this happen?  You never set this flag.

It wouldn't a typo on my part. :)

> The kept message would also be marked as seen.

Okay, given that, here is a revised script that I think would work the
way I think it would. Am I right?

   removeflag "\\Seen";   
}

With a header of "Subject: test1 test2" the following events happen
with the above script:

1) message is flagged as seen
2) message is filed into 'test1 folder'
3) flag state 'seen' is unset
4) message is forwarded to [email-masked]'
5) message is filed into INBOX and seen flag is NOT set

---

From: Ken Murchison <[email-masked]>
Date: Tue, 23 Jul 2002 21:04:47 -0400

> 5) message is filed into INBOX and seen flag is NOT set

Correct.