IMAP Mail question

Not a programming question, but there’s some very savvy computer folks here. Maybe one of you can help me.

I have several computers, each with mail programs. I use all IMAP mailboxes, and what I want is for my main computer to continue to download and keep messages locally on that machine, based on the rules I’ve set up and delete things again based on the rules I have set up.

On all my other computers, I ONLY want to be able to access mail that’s still on the server. Ideally, I’d like to figure out if there’s a way to have mail and outlook work like webmail where they download nothing, are simply “viewers” for e-mail.
Before you ask why I don’t just use webmail, well, I have a dozen or so e-mail addresses and I’d like to continue to use Apple Mail or Outlook to view them.

Is there any way to do this?

Thanks!

I use POP
Main machine grabs & download the mail - leaves it there for 7 days
And its the ONLY one that deletes
Others download it and read it

IMAP should be able to work similarly as long as only ONE machine does deletions

I only want one machine to download. I want all others to leave mail on the servers, but be able to read the mail and create emails/reply.

There SHOULD be an easy way to do this, but I can’t find one.

  • A mailbox is a physical storage schema.
  • POP is a store and forward protocol.
  • IMAP is a synchronisation protocol.

You might be able to achieve what you want by setting the primary client to use POP and the secondary clients to use IMAP. How successful it will be depends on your use of folders and the rules you want to impose. POP supports a limited set of server based rules that are typically configured to allow clients to request messages are not immediately deleted from the server after the forward. POP does not support folders.

The Office Outlook desktop app native protocol is MAPI, which is proprietary to Microsoft Exchange server but with more similarity to IMAP than POP. When Outlook is connected to a mail server using IMAP the folder structure and messages stored on the server are replicated to an OST file stored locally on the client - Like One Drive for mailboxes. OST files can not be opened directly for various reasons.

The Office Outlook desktop client supports a rich set of client based rules. I expect there is a way to configure a rule set to copy messages meeting a certain criteria to an archive PST file before deleting them from the server. PST files can be opened directly. PST files are also used by Outlook to provide a local storage schema for POP.

Both POP and IMAP store the messages on the local client one way or another. If you do not want the messages taking up disk space you are pretty much forced to use Webmail, where the messages take up space on someone else’s web server.

In the mists of time I spent a short time as the sysadmin for a proprietary SQL based mail system. Nothing was saved to the client but it was terrible overall and horrendously slow. Wouldn’t stand a chance with the mail volumes we are dealing with these days.

What is the purpose of these downloads on one machine?

If you truly have this setup correctly, then that’s all you need. By correctly, I mean that you have to move the messages you want to keep into local folders on the main machine, which removes them from the server (just moving them to other folders on the server won’t do that). Then all the other IMAP clients will synchronize with the server, removing messages from their local cache that are no longer on the server.

Also, you mention not using webmail because of multiple accounts. Many webmail systems (especially gmail) let you retrieve (and send) mail from other accounts as well. And with rules you can label or move messages from these accounts to make it easy to see which account they came through.

I guess I’m not explaining this well enough.
Let’s simplify the question.

How do I read IMAP mail using an app on a Mac that does not download and keep the mail on the Mac. A small cache is fine for recent emails as long as it’s configurable and small.

Configure the Account
And use it ?
An IMAP account will grab what little it needs to read the email which could be very little since its a more client-server type protocol than POP is
I have one IMAP account and unless I copy the email message to a local mail box it stays on the server and that mailbox stays very tiny (compared to a POP account which always makes copies)

And that works fine as long as the network is up :slight_smile:

Mac Mail syncs all mail.
With Gmail you can set (on the server side) how many e-mails to sync, but I want a client-side setting that works with all e-mail servers.

My Exchange account is IMAP and does not sync every last email (the contents)
I do get the mailbox update with ID’s or however IMAP tracks those
Thats probably a client side performance enhancement rather than having to ask the IMAP server for the list every time

EDIT <<

But I dont see it sync the email contents like POP does
But thats just because thats how POP works as a store & forward protocol so everything its gone through has a copy for some period of time

EDIT II

As far as I cans see on my version of MacOS Mail there is not “sync only the last N messages” setting

Exactly.
I’m hoping someone knows a hack or perhaps a different e-mail program that supports this?

Kinda like what Spark does.

October 1st, 2020
Spark is an email client which allows users to connect to an unlimited number of IMAP or EWS email accounts. Whenever you check your inbox, Spark contacts the server to connect you with your messages. When you read an email message, you aren 't actually downloading or storing it on your device; instead, you’re reading it off of the server.
Can I save emails locally?
Spark doesn’t backup emails. Therefore, emails cannot be stored locally: all the emails are located on the IMAP server and Spark provides you with access to it.
Meanwhile, Spark caches emails and attachments over the past month when connected to Wi-Fi, so that you can later look through your Inbox even offline. Cached emails can’t be saved locally as well, which means you can’t open them in a separate file, or you won’t be able to move/copy them while you don’t have access to the server.
Note: Your device should be connected to the Internet in order to take account. While offline, you can read cached emails only.```

Dont know of any way to make the default Mac email client do that
Other email clients may exist that make that possible
Or … write your own ! :stuck_out_tongue:

That was a xojo project at one time to write an email client
Dunno if those sources are still around anywhere

EDIT
seems they are reachable thorugh
Article 6304: : ZyMail

Like most all email apps, Apple Mail does not “keep” messages on the Mac, unless you move them to a local folder (those under “On My Mac”). It keeps a cache of the messages that are currently on the server to A) allow you to read messages while offline and B) to reduce the bandwidth needed to open/read/sync messages. And that’s all it is - a cache, which means the messages in it are temporary in nature - they will disappear when they are no longer on the server. If you wish to keep the size of this cache small, then either delete messages that are on the server, or move them to a local folder. You can do this manually and/or with a rule (e.g. move all messages older than X days to a local folder). You do this on your “main” computer, then all other devices will synchronize and remove those messages from their cache.

It sounds like Spark is basically a webmail app with an offline mode and some built-in integrations that a normal mail app would have. BTW, Gmail has an offline option also.

1 Like

Thank you for that information. I did not know that.

Where can I find more info on exactly how this works on Apple Mail?
Questions like:

  • Where is the cache?
  • How big is it?
  • Is there a way to change the size of the cache?
  • Are attachments stored or cached?
  • Why is mail using 5.8G on my Mac and how much of that will be downloaded on a new computer once I add the mail accounts to it?
  • Technical details of how IMAP and Apple Mail interact and work?

Start in ~/Library/Mail and explore from there. You’ll probably have a V2 or V9 folder, depending on which version of macOS you’re on.

Right-click on each mailbox in Mail and choose Get Account Info. You’ll have to add up all the folders, then add all mailboxes together. There may be other tools that will get this information for you, but I don’t know of any.

No, other than removing messages from the server as I stated before.

Again, nothing is “stored” unless you move/copy a message to a local folder. Attachments may be in the cache, depending on the Download Attachments setting for the account: Right-click on a mailbox and choose Edit "<name>...".

Why? I assume it’s because that is the total of the cache and any local folders. The info under Account Info above will tell you how much is on the server for a particular account, which is what most other IMAP clients will download (but could vary depending on the attachments setting for each client).

Good luck getting that from Apple. But I assume it works like any other IMAP client, since IMAP is an industry standard protocol (see the RFC). And this article seems to explain it (IMAP, not Apple Mail) fairly well.

2 Likes

Apple mail has the option to download all, recent or none attachments. That is all the control you have.

When you access an attachment it is downloaded and saved (stored) in the cache location. When you open the attachment a copy is made to a temporary location. The temporary file should go away when you restart MacOS but sometimes doesn’t.

The cache is the same size as the mailbox on the server more or less. There are some client fault conditions that can cause the cache to grow larger than the mailbox on the server, that are fixed by deleting the cache and resynchronising with the server.

The question you have not asked is why doesn’t IMAP work the way you want it to?

As I hinted earlier without client caching a mail system is incredibly slow. For instance. Each time a user opened an attachment the attachment would need to be downloaded. When the user opens the same attachment again it would need to be downloaded again. If the user wants to search 1000 e-mails, they would have to wait for 1000 e-mails to be downloaded before the client can carry out the search.

Mail servers that work the way you want them to have been tried before but failed to scale up. The SQL mail system I had to admin collapsed at 6 users, back in the 1990s, before GB mailboxes became common place.