What is the use of the Subscribe and Unsubscribe commands in Imap4req1?

What is the use of the Subscribe and Unsubscribe commands in Imap4req1? I checked RFC 3501, but I could not understand its use. What happens when I write the following commands

A SUBSCRIBE "MAILBOX_NAME"

A UNSUBSCRIBE "MAILBOX_NAME"

Will the server process these mailboxes as separate ones?

Example:

please check below once and tell the difference

A LIST "" "*"
* LIST (\HasNoChildren) "/" "Bulk Mail"
* LIST (\HasNoChildren) "/" "Draft"
* LIST (\HasNoChildren) "/" "Inbox"
* LIST (\HasNoChildren) "/" "Sent"
* LIST (\HasNoChildren) "/" "Trash"
A OK LIST completed
A SUBSCRIBE INBOX
A OK SUBSCRIBE completed
A LSUB "" "*"
* LSUB (\HasNoChildren) "/" "Bulk Mail"
* LSUB (\HasNoChildren) "/" "Draft"
* LSUB (\HasNoChildren) "/" "Inbox"
* LSUB (\HasNoChildren) "/" "Sent"
* LSUB (\HasNoChildren) "/" "Trash"
A OK LSUB completed
+3
source share
1 answer

They change the output of the command LSUB. It. SUBSCRIBEAdds folders to the output of the command LSUB. UNSUBSCRIBEwill remove them from the output of the command LSUB. That is, it LSUBshows only signed folders.

LIST will always show all folders.

For example, starting with all signed folders:

a LIST "" *
* LIST (\HasNoChildren) "." "INBOX.Drafts"
* LIST (\HasNoChildren) "." "INBOX.Sent"
* LIST (\HasNoChildren) "." "INBOX.Trash"
* LIST (\Marked \HasChildren) "." "INBOX"
a OK LIST completed

a LSUB "" *
* LSUB (\Marked \HasChildren) "." "INBOX"
* LSUB (\HasNoChildren) "." "INBOX.Drafts"
* LSUB (\HasNoChildren) "." "INBOX.Sent"
* LSUB (\HasNoChildren) "." "INBOX.Trash"
a OK LSUB completed

Now unsubscribe INBOX.Sent:

a UNSUBSCRIBE INBOX.Sent
a OK Folder unsubscribed.
a LSUB "" *
* LSUB (\Marked \HasChildren) "." "INBOX"
* LSUB (\HasNoChildren) "." "INBOX.Drafts"
* LSUB (\HasNoChildren) "." "INBOX.Trash"
a OK LSUB completed

, , INBOX.Sent LSUB. , LIST .

:

a SUBSCRIBE INBOX.Sent
a OK Folder subscribed.
a LSUB "" *
* LSUB (\HasNoChildren) "." "INBOX.Sent"
* LSUB (\Marked \HasChildren) "." "INBOX"
* LSUB (\HasNoChildren) "." "INBOX.Drafts"
* LSUB (\HasNoChildren) "." "INBOX.Trash"
a OK LSUB completed

, , .

+4

All Articles