I want to make a long command with FETCH that gives me :
1.What is UID ?
2.What is attachment ?
and other things
What other things? Pretty much all metadata:
tag FETCH 1 (uid flags envelope bodystructure internaldate)
you question is not clear. but i assume you want to retrieve all the data.
use following command
A FETCH 1:* ALL
Related
I have a User's information which I have stored in a Hash. I have his permission information stored in a Set.
I want to test for a condition on the Set, retrieve the Key and then fetch the actual Value using the retrieved Key from the Hash.
How can I do this?
Do I have to use Lua scripting to achieve the above goal or is there any other way?
You'll have to do it using multiple requests in that case. While Lua appears to be the way, your requirements - namely fetch a key based on the value of another key - rule out a single script since key names should be passed explicitly.
I had the same requirement and I couldn't find any other way to do this. Redis pipeline and transaction functions are other tools to execute multiple commands in single step but for your situation where you want to get a value and execute a command based on it, the only way remains is LUA!!
you can use a hash to handle user information and his permissions (in the same hash). In this case, when you have a userId you can retrieve the permissions with one shot by using userId and permissionKey. See example below, I put the permissions as string (in your case put it as Set):
redis> HSET userId permissionKey "perm1, perm2, perm3"
redis> HGET userId permissionKey
"perm1, perm2, perm3"
Hope this help you.
In IMAP it's pretty straightforward to get the UID for a single message if you happen to have a relative message number:
FETCH 1 (UID)
But suppose you had a UID and later wanted to determine the relative message number for just that message? Does IMAP provide a way to do that?
I'm not seeing anything especially obvious in the spec that would allow you to get the relative message number for a single message. I could do
UID FETCH 1:* (UID)
and then parse and search through the results to find it, but that seems like overkill (not to mention exponentially slow).
Pretty simple:
tag UID FETCH <uid> (UID)
The response will include the message number, not in the fetch information but as the initial part of the response
tag <messagenumber> FETCH (UID <uid>)
Hi I tried following IMAP commands in Gmail, It is working where as in yahoo not working.
A UID FETCH *:* (UID) (MODSEQ)
A BAD [CLIENTBUG] UID FETCH Additional arguments found after last expected argument
In gmail i am getting MODSEQ as one of the response.
FYI:
In gmail CONDSTORE is one of available capability whereas in yahoo it is not. But still yahoo providing HIGHESTMODSEQ for every SELECT/EXAMINE. if it is maintaining HIGHESTMODSEQ then there is a way to get for per-message basis. please tell me how to archive this in Yahoo....
Thanks...
When the server tells you there's a CLIENTBUG, it is usually right. The syntax for FETCH is on page 85 of RFC 3501. Read it. In this case, the correct version is:
A UID FETCH *:* (UID MODSEQ)
You could also make the list simpler, since UID implies UID and *:* means "from * to *":
A UID FETCH * (MODSEQ)
Or turn the single-item list into a single item:
A UID FETCH * MODSEQ
Using IMAP via telnet, I want to be able to extract the subject from the specific given email. Now I know that the fetch command is responsible for getting data from an email.
My question is, how do I get the subject header specifically, without using a call to BODY[HEADER.FIELDS (SUBJECT)] (which will, in the eyes of the server, 'open the email' and thus set the /seen flag, which is what I don't want to occur)?
I understand FETCH FULL returns the full header, which contains the subject but it's a nightmare to parse through and could be riddled with unseen pitfalls if I manually parse it. How would I get the server to give me just the subject from the header?
I discovered the answer:
BODY.PEEK[HEADER.FIELDS (SUBJECT)]
.PEEK tells it not open it (so /seen isn't set).
Besides BODY.PEEK, you could fetch ENVELOPE, which gives you a parsed summary of much of the message metadata.
"a1 FETCH 1:* (FLAGS BODY[HEADER.FIELDS (SUBJECT DATE FROM)])\r\n"
I am working on MailClient and I want to set Multipal Flags for Eg. SEEN, UNSEEN so how I can set in C#,
I had pass this command like this but it will give me error. like BAD command.
so the my command like this.
byte[] commandBytes = System.Text.Encoding.ASCII.GetBytes((#"$ UID SEARCH UNSEEN \SEEN" + "\r\n"));
Thanks..
Don't use backslash, this is the correct request:
A000 UID SEARCH SEEN UNSEEN
Are you sure you want write you own IMAP client from scrach? There are some opensource libraries, as well as paid ones (My Mail.dll IMAP component for example).