PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > comp.mail.imap > getting sequence number from UID
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.mail.imap Discussion of IMAP-based mail systems.

getting sequence number from UID

Réponse
 
LinkBack Outils de la discussion
Vieux 05/09/2006, 23h23   #1 (permalink)
macie.korte@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut getting sequence number from UID

using raw IMAP commands:
I understand how to get the UID of a message from that message's
sequence number:
( "123 FETCH 1 UID" )

but how do you get a sequence number given the UID??? The map between
the two is not static during the life of a connection, so obviously
just keeping track of the two isn't much use, but I've been pouring
over the spec (3501) and can't figure out how to get sequence number
from UID.

  Réponse avec citation
Vieux 05/09/2006, 23h50   #2 (permalink)
Pete Maclean
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: getting sequence number from UID

<macie.korte@gmail.com> wrote in message
news:1157494996.236587.282150@e3g2000cwe.googlegro ups.com...
> using raw IMAP commands:
> I understand how to get the UID of a message from that message's
> sequence number:
> ( "123 FETCH 1 UID" )
>
> but how do you get a sequence number given the UID??? The map between
> the two is not static during the life of a connection, so obviously
> just keeping track of the two isn't much use, but I've been pouring
> over the spec (3501) and can't figure out how to get sequence number
> from UID.


This should do it:

123 SEARCH UID 456

Pete Maclean


  Réponse avec citation
Vieux 06/09/2006, 00h35   #3 (permalink)
Mark Crispin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: getting sequence number from UID

On Tue, 5 Sep 2006, Pete Maclean wrote:
> This should do it:
> 123 SEARCH UID 456


Better is
tag UID FETCH 456 UID
(or any other fetch item for the second UID).

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
  Réponse avec citation
Vieux 06/09/2006, 04h48   #4 (permalink)
Pete Maclean
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: getting sequence number from UID

"Mark Crispin" <MRC@CAC.Washington.EDU> wrote in message
news:Pine.WNT.4.65.0609051634230.3332@Tomobiki-Cho.CAC.Washington.EDU...
> On Tue, 5 Sep 2006, Pete Maclean wrote:
>> This should do it:
>> 123 SEARCH UID 456

>
> Better is
> tag UID FETCH 456 UID
> (or any other fetch item for the second UID).


Mark, Why do you think the FETCH is better? Because it rates to be more
efficient? I chose SEARCH because it's cleaner in the sense that, if the
message with the given UID does not exist, the client does not have to deal
with a NO response.

Pete


  Réponse avec citation
Vieux 06/09/2006, 06h21   #5 (permalink)
Mark Crispin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: getting sequence number from UID

On Wed, 6 Sep 2006, Pete Maclean wrote:
>>> This should do it:
>>> 123 SEARCH UID 456

>> Better is
>> tag UID FETCH 456 UID
>> (or any other fetch item for the second UID).

> Mark, Why do you think the FETCH is better?


The FETCH result definitely associates the UID with the sequence number.
With SEARCH, the application has to do so manually.

The FETCH can be pipelined with other fetches.
The SEARCH can not be (not safely, anyway).

> I chose SEARCH because it's cleaner in the sense that, if the
> message with the given UID does not exist, the client does not have to deal
> with a NO response.


What makes you think that you would get a NO response? Any server that
returns a NO response in this case is broken.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
  Réponse avec citation
Vieux 06/09/2006, 15h39   #6 (permalink)
Pete Maclean
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: getting sequence number from UID

"Mark Crispin" <mrc@CAC.Washington.EDU> wrote in message
news:Pine.OSX.4.64.0609052218560.8219@pangtzu.pand a.com...
> On Wed, 6 Sep 2006, Pete Maclean wrote:
>>>> This should do it:
>>>> 123 SEARCH UID 456
>>> Better is
>>> tag UID FETCH 456 UID
>>> (or any other fetch item for the second UID).

>> Mark, Why do you think the FETCH is better?

>
> The FETCH result definitely associates the UID with the sequence number.
> With SEARCH, the application has to do so manually.


That seems rather minor..

> The FETCH can be pipelined with other fetches.
> The SEARCH can not be (not safely, anyway).


.... but this is a good point.

>> I chose SEARCH because it's cleaner in the sense that, if the
>> message with the given UID does not exist, the client does not have to
>> deal
>> with a NO response.

>
> What makes you think that you would get a NO response? Any server that
> returns a NO response in this case is broken.


Nothing other than my broken memory. Sorry!

Pete


  Réponse avec citation
Vieux 06/09/2006, 21h36   #7 (permalink)
macie.korte@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: getting sequence number from UID

Thanks for your replies and sorry for the question with the obvious
answer. I had actually already tried "tag UID FETCH 456 UID" and got
back "* 1 FETCH (UID 456)". Somehow I was experiencing a mental block
that wouldn't let me think of anything before the "FETCH" in the
response as actual useful parseable content, so I didn't even notice
the '1' was the msg sequence number, I only noticed that the server was
giving me the UID I just supplied it with. Anyway, thanks for clearing
that up.

- Macie

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h27.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 1,54100 seconds with 15 queries