UW toolkit

UW toolkit

Post by clynx123 » Tue, 28 Sep 2004 20:28:39


Hello,

About the keywords support of UW toolkit. I realize that the
current version of UW toolkit 2004 supports append new keywords (max
30) only but not updating the keywords previously set in the MBX. I am
interested in changing the codes to make the update or delete keywords
possible. Could any of the gurus here care to shed a light or hint me
which part of the codes should I start to look for, any references on
the MBX formating and material that I need. thanks in advance.


Regards,
Clynx
 
 
 

UW toolkit

Post by Mark Crisp » Tue, 28 Sep 2004 23:07:16


There is no operation in the IMAP protocol to change or delete existing
mailbox keywords. Such an operation is a pre-requisite.

-- Mark --

http://www.yqcomputer.com/
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

 
 
 

UW toolkit

Post by Timo Sirai » Wed, 29 Sep 2004 03:16:05


Isn't server allowed to delete unused keywords automatically?
 
 
 

UW toolkit

Post by Mark Crisp » Wed, 29 Sep 2004 05:20:11


The IMAP protocol is silent on this matter.

Note that only STORE is defined by the protocol as creating a keyword;
COPY and APPEND are not. This makes the possibility of auto-deleting an
"unused" keyword dangerous.

-- Mark --

http://www.yqcomputer.com/
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
 
 
 

UW toolkit

Post by Sam » Wed, 29 Sep 2004 08:15:17

This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.

Mark Crispin writes:




Only if the server cannot create a new keyword with COPY or APPEND.

If the server can autocreate new keywords with COPY and APPEND, then it can
automatically delete unused keywords without any ill effects.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBBWJ8Ex9p3GYHlUOIRAtNlAJ9H5mzPaBKo1OvDsICKAXq355zj7QCfTGmF
HkY8bVBgZmRBJlxliKb3zY0=
=DCQH
-----END PGP SIGNATURE-----
 
 
 

UW toolkit

Post by Mark Crisp » Wed, 29 Sep 2004 09:17:00


Not quite. If the client does the create-dummy-message/STORE/EXPUNGE
trick to create a keyword in a mailbox, then a server which automatically
deletes unused keywords may automatically delete the just-created keyword.
This may surprise the client at next SELECT time.

Given the right circumstances of client and server behavior, a loop can
theoretically result. It's not clear that an autocreate/autodelete server
can anticipate all possible client behaviors to avoid the loop; nor is it
clear that a client which uses the trick can anticipate all possible
autocreate/autodelete server behaviors to avoid to the loop.

Note that I said "dangerous". I did not say "non-compliant" or "broken".
The IMAP protocol is silent on this matter, and it is possible that client
and server strategies exist that would avoid the loop regardless of bad
behavior at the other end.

I have not thoroughly examined this matter. I am not saying that there
are no ways around the pitfalls; just that there are pitfalls and thus it
is "dangerous". A server implementor purposing to add this type of
functionality should consider these pitfalls carefully, and as there are
multiple clients out there now which do the trick, the burden is likely to
be on the server.

-- Mark --

http://www.yqcomputer.com/
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
 
 
 

UW toolkit

Post by Sam » Wed, 29 Sep 2004 10:29:51

This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.

Mark Crispin writes:



If the client properly implements IMAP it won't be surprised, since the
EXPUNGE message will include unsolicited "* FLAGS" and "* PERMANENTFLAGS"
messages informing the client that the newly unused keyword has been
removed, following the expunge of the last message that used it.

And if the client just tries again in response, leading to an infinite loop
then it's fully responsible for it anyway, because the create/STORE/EXPUNGE
"trick" is sloppy in many other ways and can result in infinite loops in any
case, so clients must be prepared for that eventuality. For starters, unless
the server advertizes UIDPLUS the client will not have a certain a fix on
the correct message to tag, and expunge. Even if this client uses the
Message-ID: as a fallback mechanism (and even if it gets the UID, with
UIDPLUS), there's always a race condition where some other client, for some
ostensible purpose, deleted and expunged the message before this client had
the opportunity to tag it.

So right here you have a theoretical possibility of an infinite loop even if
the server does not autodelete keywords; so I see no worthwhile reason to be
concerned about sloppily-designed clients that are not prepared to follow
through on the eventual consequences of their broken design. But I don't
think that all is lost >> I have not thoroughly examined this matter. I am not saying that there >> are no ways around the pitfalls; just that there are pitfalls and thus it >> is "dangerous". A server implementor purposing to add this type of >> functionality should consider these pitfalls carefully, and as there are >> multiple clients out there now which do the trick, the burden is likely to >> be on the server.

ecause the client presumably tries to do this to prevent the rejection of
COPY and APPEND due to a nonexistent keyword. Such a sloppy client will
likely to simply forge ahead with a COPY and APPEND after the EXPUNGE,
without paying attention to what exactly happened. The COPY/APPEND will
create the keyword again, and everyone will live happily ever after.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBBWL6Nx9p3GYHlUOIRAte/AJ9Y+9Jga/wWM8E8cHFU4U+KdeSSfgCfUTd+
IFmtQtPStr25DlowRlXAtq0=
=Bs6O
-----END PGP SIGNATURE-----
 
 
 

UW toolkit

Post by Mark Crisp » Wed, 29 Sep 2004 12:46:28


You misunderstand the intended meaning of "surprise".

The surprise here is that the server is, for some reason unknown to the
client, removing the flag that the client went to some effort to create.


That's only if the server autodeletes keywords.

The IMAP specification does not prohibit a server from autodeleting
keywords, but it does not permit or encourage it either. It is silent on
the subject.

This is an example in which Postel's oft-quoted principle of "be liberal
in what you accept, and conservative in what you send" applies. Many
people incorrectly interpret Postel's principle as meaning that
implementations should accept arbitrary protocol syntax errors. The
correct interpretation is the robustness principle of avoiding unusual
behavior that is likely surprise existing deployed implementations.


That is a large presumption. A client that does a known workaround to
avoid a known problem is not necessarily "sloppy". In fact, the more
attentive the client is to being non-"sloppy", the more likely it is to
get itself into trouble.

I would recommend, as a robustness measure, that any server contemplating
implementing the autodelete of keywords assign a "last used" timestamp to
any unused keyword, and only autodelete unused keywords that are older
than a certain period of time.

-- Mark --

http://www.yqcomputer.com/
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
 
 
 

UW toolkit

Post by Timo Sirai » Wed, 29 Sep 2004 18:18:02


I was actually only going to do the deleting when client is attempting to
add a new keyword, and when doing so would exceed the maximum number of
available keywords. Or even if there is no limit, it could check them
every 8 additions or so to avoid wasting space.

I guess timestamps could still be a useful with that.
 
 
 

UW toolkit

Post by Mark Crisp » Thu, 30 Sep 2004 00:47:53


Sounds good to me!

-- Mark --

http://www.yqcomputer.com/
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
 
 
 

UW toolkit

Post by clynx123 » Thu, 30 Sep 2004 12:12:39


A lengthy debate which I do not expect this in the first place, but
thanks to you guys for the enligthenment. Now, I have few questions,
as how or where do the server silently auto delete the keywords in the
codes? I am refering the MBX format (mbxnt.c). Second question, in
Win2000, I notice that the IMAPD will do listing based on what is in
the
\\Document and Settings\UserLoginName\My Document\*

Is there a way for me to set it to do listing on say
\\Document and Settings\UserLoginName\My Document\MyListings\*
instead.

I know that I should use LSUB and SUBSCRIBE to filter out what are
needed and what are not but having to do filtering inside My Document
is just no no in my opinion.


thanks in advance.
 
 
 

UW toolkit

Post by Mark Crisp » Thu, 30 Sep 2004 13:13:23


Since it doesn't do so now, you're going to have to write the code to do
it.


The routine that you need to modify/rewrite is win_homedir() in env_nt.c.

-- Mark --

http://www.yqcomputer.com/
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.