How to view the IMAP flags in an email client?
Asked Answered
N

2

6

We are are setting a the IMAP flags using the Java Mail API. Is there is a way to look at these flags in Thunderbird or other client for debugging purposes?

Noel answered 22/8, 2013 at 20:18 Comment(3)
You could always use a tool like socat or python and imap lib if you just need to check a few things out. A little understanding if RFC 3501 and you can learn anything with a couple keystrokes.Fideliafidelio
Thanks Max. Can you please give an example of the socat? thanks.Cocks
I'll add an answer with a sample session.Fideliafidelio
F
9

You can learn enough of IMAP to use socat to try yourself. Here's a sample exchange, I've marked my input with >, and responses with <:

$ socat READLINE ssl:imap.gmail.com:993,verify=0,crlf
< * OK Gimap ready for requests from [ip]
> a LOGIN [email protected] password
< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH
< a OK [email protected] User authenticated (Success)

> a SELECT INBOX
< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded)
< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded \*)] Flags permitted.
< * OK [UIDVALIDITY 7] UIDs valid.
< * 836 EXISTS
< * 0 RECENT
< * OK [UIDNEXT 36515] Predicted next UID.
< * OK [HIGHESTMODSEQ 3346208]
< a OK [READ-WRITE] INBOX selected. (Success)

> a FETCH 810:820 (FLAGS)
< * 810 FETCH (FLAGS (\Flagged))
< * 811 FETCH (FLAGS ())
< * 812 FETCH (FLAGS (\Seen))
< * 813 FETCH (FLAGS (\Seen))
< * 814 FETCH (FLAGS (\Seen))
< * 815 FETCH (FLAGS (\Seen))
< * 816 FETCH (FLAGS (\Seen))
< * 817 FETCH (FLAGS ())
< * 818 FETCH (FLAGS ())
< * 819 FETCH (FLAGS ())
< * 820 FETCH (FLAGS ())
< a OK Success

> a LOGOUT
< * BYE LOGOUT Requested
< a OK 73 good day (Success)

You will want to at least skim RFC 3501, so that you understand UIDs and message sequence numbers, and section 6.4.5 will tell you the various things you can ask for in a FETCH command, such as flags, envelope, etc.

Each command is preceded by an arbitrary tag. I've used just a in the examples. It's intended to allow pipelining of commands and responses, so that they can be matched up.

The LOGIN command is just the username and password, and SELECT INBOX chooses the mailbox for the following commands to use. FETCH takes a sequence list (in the example, I said messages with sequence numbers between 810 and 820, and a list of items to fetch, in this case, just the flags.

Fideliafidelio answered 24/8, 2013 at 4:1 Comment(0)
P
1

Get Trojitá, it shows e-mail flags by default. I have no idea how to configure other MUAs to do the same, but I suspect many of them can do this for you as well.

Proviso answered 23/8, 2013 at 9:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.