I've recently wrote SIEVE extension that allows to set IMAP flags on
delivery. I will appreciate any feedback from the mailing list.
I'm not fond of it, mainly because it's so IMAP-specific, and the idea
of allowing a filter to flag a message is too good to relegate to servers
that implement their SMTP delivery agent integrated with their IMAP server
(we do, so we could do this, but...).
I see little use for setting some of the flags, such as \Deleted and
\Draft, and other flags might be removed from the IMAP context with a
little thought. I'd rather see the idea put in a form that can go into
the base document.
We could add a "flag" action, the semantics of which are just "flag this
message in a way that makes sense to the underlying implementation." That
would correspond to the IMAP \Flagged flag.
I could see some value in providing a way to mark a message as "seen" from
a script. The "flag as interesting" and "mark as seen" ideas could be
pulled away from the IMAP context, and put in as actions that must be
implemented, but may do nothing if the SMTP delivery agent can't do
anything with them. I'm not sure how much I like that either. I guess
I'm waffling here.
I don't think there's a way, without being IMAP-specific, to add something
that will let the user set user-defined IMAP flags (ones that don't begin
with "\").
The draft is wrong to say that "forward" doesn't allow the message to be
kept, so it's wrong to prohibit setting flags on a forwarded message.
Barry Leiba, Multimedia Messaging (leiba(_at_)watson(_dot_)ibm(_dot_)com)
http://www.research.ibm.com/people/l/leiba