docs: explain how to use `git imap-send --list` command to get a list of available folders

The output `git imap-send --list` command can be a bit confusing for new users since the IMAP LIST command output is very verbose. Help such users to analyse the same by using an example output. Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Aditya Garg committed Jul 22, 2025 at 11:48 UTC 0b8693758929e7e7797f97df43aa21257b54dd3b
1 file changed +28
Documentation/git-imap-send.adoc
+28
@@ -68,6 +68,34 @@ include::includes/cmd-config-section-rest.adoc[]
68
69 include::config/imap.adoc[]
70
71 +GETTING A LIST OF AVAILABLE FOLDERS
72 +-----------------------------------
73 +
74 +In order to send an email to a specific folder, you need to know the correct name of
75 +intended folder in your mailbox. The names like "Junk", "Trash" etc. displayed by
76 +various email clients need not be the actual names of the folders stored in the mail
77 +server of your email provider.
78 +
79 +In order to get the correct folder name to be used with `git imap-send`, you can run
80 +`git imap-send --list`. This will display a list of valid folder names. An example
81 +of such an output when run on a Gmail account is:
82 +
83 +.........................
84 +* LIST (\HasNoChildren) "/" "INBOX"
85 +* LIST (\HasChildren \Noselect) "/" "[Gmail]"
86 +* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
87 +* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
88 +* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
89 +* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
90 +* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
91 +* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
92 +* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
93 +.........................
94 +
95 +Here, you can observe that the correct name for the "Junk" folder is `[Gmail]/Spam`
96 +and for the "Trash" folder is `[Gmail]/Trash`. Similar logic can be used to determine
97 +other folders as well.
98 +
99 EXAMPLES
100 --------
101 Using tunnel mode: