|
|
|
|
||||||
| comp.mail.imap Discussion of IMAP-based mail systems. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
<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 |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
"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 |
|
|
|
#5 (permalink) |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#6 (permalink) |
|
Messages: n/a
Hébergeur: |
"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 |
|
|
|
#7 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|