3

The webmail system provided by my ISP hides the folder structure from me.

I have three questions:

  1. Is there a tool (web-based or downloadable) that lets me see the actual folder structure on the IMAP server? Perhaps Telnet?

  2. Better yet, is there a generic Webmail facility hosted somewhere that doesn't try any clever stuff and would let me access the emails and see the folder structure exactly as it is on the server?

  3. Does anyone recognise the IMAP folder name "/mail/SPAM.incoming" and can tell me what email client might have created that folder and is currently putting spam messages in it?

On different clients the names and subfolder structure of the IMAP folders appear very different, and I was hoping to tidy things up and use standardised names across all clients. However I can't work out what is going on here.

I use Thunderbird 128.10.1esr on my desktop I use K-9 Mail Version 9.0 on my phone And occasionally use the Webmail 7.0 provided by my ISP (https://webmail.uwclub.net/#/login) in a browser.

In Thunderbird the root-level folders are (number of unread emails in brackets):
Inbox (63)
Drafts (16)
Sent
Junk
Deleted (757)
Deleted Items
Junk E-mail
mail (shows in grey italic font, and has subfolders)
SCRIPTS
Sent Items
Unwanted

The mail folder contains the following subfolders:
drafts
sent-mail
SPAM.incoming (4)
trash

The folders in K-9 Mail are similar to Thunderbird

The folders in Webmail are:
Inbox (63)
Drafts
Sent
Spam (4)
Trash
Folders (a collapsable folder)

The Folders folder contains
Deleted Items
Drafts (16)
Junk
Junk E-mail
SCRIPTS
Sent
Sent Items
Trash (757)
Unwanted

I have checked the folder properties of all the folders in Thunderbird, and the only one that shows a mapping is the Deleted folder, which maps to Trash in the root of the IMAP folder. The rest just follow the names and subfolder structure as seen on the display. I think the Thunderbird display must pretty much match the folder structure on the server.

So, I think the one that I find most confusing is the Webmail layout. There appears to be no way to show the subfolder structure that actually exists on the server.

I'm assuming that Folders is not really a folder but a some kind of user interface idea to separate the non-standard folders off from the rest?

IMAP folders in Thunderbird

IMAP folders in Thunderbird

IMAP folders in Webmail

IMAP folders in Webmail

Roman
  • 3

1 Answers1

1

"see the folders structure exactly as it is on the server" can be surprisingly complex when it comes to IMAP.

Connect to the IMAP server using some SSL/TLS-capable variant of Telnet:

  • gnutls-cli mail.example.com -p imaps
  • openssl s_client -connect mail.example.com:imaps

Each command has to be prefixed with a "tag" (allowing a client to send multiple commands and distinguish between interleaved responses). When typing commands manually, you can just use something like a as the tag for all commands, e.g. a login.

To log in with a password, use LOGIN:

==>  a login "my_username" "the_password"
<--  a OK

IMAP has a feature called namespaces, which allows the server to combine several separate folder trees into one (e.g. your personal folders plus some group-shared folders).

List the namespaces using NAMESPACE:

==>  a namespace
<--  * NAMESPACE (("" "/")) NIL NIL
<--  a OK Namespace completed (0.001 + 0.000 secs).

Here the server has just a single "" namespace, with "/" as the folder separator ("." is traditional but nowadays less common). Importantly, as far as I know, each namespace can have a different separator – so a folder hierarchy could actually be a mix of / and . separated levels.

In your case, it might be that the "" namespace contains your folders in the server's standard storage, while the "mail/" namespace might be a view into the plain ~/Mail/ directory on your NFS homedir.

(If that's the case, then it is possible that Thunderbird displays mail/ as gray because it is unselectable due to storage restrictions – old-style "mbox"-format storage uses an ordinary file to hold a whole IMAP folder, so it cannot be both a file and a directory at the same time.)

List all folders in the "" namespace using LIST:

==>  a list "" "*"
<--  * LIST (\HasNoChildren) "/" INBOX
<--  * LIST (\HasChildren \UnMarked \Archive) "/" Archive
<--  * LIST (\HasChildren \UnMarked) "/" Archive/Work
<--  * LIST (\HasChildren \UnMarked) "/" Historic
...
<--  a OK List completed (0.001 + 0.000 secs).

Here the first parameter is the starting path ("" means list everything, while e.g. "Archive" would only list children of that folder). The second parameter is the filter pattern ("*" lists everything, recursively, while "%" only lists one level down).

Modern servers support tagging certain folders as "special-use", e.g. the drafts folder would be tagged \Drafts no matter its actual name, and Thunderbird would always recognize it as the drafts folder. This is sometimes changeable via proprietary webmail, but usually not via IMAP itself.

You can also list subscribed folders using LSUB (using the same syntax):

==>  a lsub "" "*"

Most IMAP clients use subscriptions to decide what folders to display in the UI, and/or which folders to poll for new messages. Unsubscribing a folder effectively hides it from Thunderbird's tree. Sometimes you can end up with ghost subscriptions (a folder that no longer exists is still subscribed and shows up in Thunderbird). You can use UNSUBSCRIBE to remove those.

grawity
  • 501,077