how to limit email download to 20 mails (at a time)?

User Help for Mozilla Thunderbird
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

how to limit email download to 20 mails (at a time)?

Post by chrizoo »

Hi. Can I limit the number of [get new emails] to, say, 20 ?
Thunderbird should then download at most 20 mails and then stop.
Is there any solution ?

(The reason is that I have an address with several thousands of mails and would like to download only 20 at a time, deal with them, and when I'm finished download the next share of 20 mails.)
Last edited by chrizoo on September 16th, 2018, 10:50 am, edited 1 time in total.
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: how to limit email download to 20 mails ?

Post by DanRaisch »

Neither POP nor IMAP servers provide for that option.
How is the account set up in Thunderbird, as POP or IMAP? Find out using menu path Tools->Account Settings->Server Settings->Server Type at the top right of the dialogue.
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: how to limit email download to 20 mails ?

Post by chrizoo »

I use POP.
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: how to limit email download to 20 mails ?

Post by DanRaisch »

The POP protocol by default downloads all new messages in the server inbox each time Thunderbird checks for messages. New messages are considered those received on the server since the last time Thunderbird performed a download. The protocol offers no option for setting a specific number of messages for download or selecting messages to be downloaded by date range or other criteria.

If your purpose in seeking to restrict the number to be received is to limit band width use or data volume, you might find this article helpful -- http://kb.mozillazine.org/Download_only ... P_messages

If your purpose is simply to manage your workload, I believe that is something that would have to be done AFTER receipt of the messages, not before.
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: how to limit email download to 20 mails ?

Post by chrizoo »

Thank you for the help and the link, which certainly comes in handy for other situations, but doesn't provide a solution to restrict the download to a certain number of messages.
DanRaisch wrote:The protocol offers no option for setting a specific number of messages for download or selecting messages to be downloaded by date range or other criteria.
I don't need a date range or other criteria.
I'd just need TB to stop downloading after X messages (which TB could do, technically, regardless of protocol).

I have to disagree with your last paragraph. I love TB but from my lifetime experience, TB is very unreliable when
  • downloading too many messages at once and/or
  • accumulating too many messages in a single folder
  • especially the inbox.
In fact there are many KB articles warning not to keep to many messages in the inbox for precisely this reason!

Your suggestion to download >60.000 mails all at once into the inbox is a recipe for guaranteed failure, as it reunites all aforementioned safety hazards. I ran into this issue already too often and with much fewer emails.

A large number of mails tends to bog down TB. Compacting folders and moving of folders/messages take longer and longer, and the danger of data loss and data corruption rises.

Therefore I want to download 20 mails, read them, delete most of them, and then handle the next chunk of 20 mails.
This procedure is much safer and more reliable.
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: how to limit email download to 20 mails ?

Post by DanRaisch »

Therefore I want to download 20 mails, read them, delete most of them, and then handle the next chunk of 20 mails.
This procedure is much safer and more reliable.
Perhaps, but with a POP account there is no way to accomplish that in Thunderbird short of accessing the web mail page and moving all but 20 messages out of the server inbox folder. Which would make using Thunderbird sort of pointless if your purpose was to reduce work load or simplify access to the account.
downloading too many messages at once and/or
I've never run into those issues, but then I have never tried to download 60,000 messages into a POP type account in Thunderbird, never having had that many messages in the server inbox at one time.
accumulating too many messages in a single folder
That's manageable by creating an organization of folders, typically under Local Folders, and regularly moving messages from the Inbox folder to that structure, minimizing risk of loss and improving performance. Archiving messages chronologically would probably mean the number of messages in a given folder would never be excessive.

Better yet, does your email provider offer IMAP access to your account? If so, you could duplicate the account in Thunderbird, adding it as an IMAP account. Setting that to NOT store copies of messages on the local machine would mean the account would only download header data for each of those 60,000 messages until you opened a particular message for viewing/reading. Those you wished to retain you could move to sub-folders of Local Folders while deleting those you don't. After the number of messages in the server inbox was down to some more reasonable number you could turn on storage of messages on the local system if you wanted to have those available for off-line access. Once that IMAP set up was working you could disable/delete the POP account.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: how to limit email download to 20 mails ?

Post by tanstaafl »

There is a page in the POP account settings where you can specify download limits such as the N most recent days or up to N KB of messages. I forget what that pane is called. But try setting it to something like the most recent 7 days, read and delete the recent messages, exit, restart and repeat. If you have in the accounts server settings it configured to delete the original message on the server when you delete it from Thunderbird's inbox you should be able to work backwards, a week at a time.

An alternative is to replace it with a IMAP account. If you configure the "Synchronization & Storage" settings not to "store messages for this account on the computer" it won't create the optional offline folders on your hard disk. If you also disable global search/indexing in tools -> options -> advanced -> general it will not download any messages for the IMAP account to the hard disk. It will only download the headers needed to create a folder listing (the *.msf file). That should make it much easier/quicker to read/delete messages in a inbox with 60K messages as it will only fetch one message at a time (the one you are reading). The fetched message will only be in memory, not on the hard disk. Another advantage of a IMAP account is by default if you have a large attachment (message is at least 30KB) it won't fetch the attachment unless you explicitly open it.
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: how to limit email download to 20 mails ?

Post by DanRaisch »

There is a page in the POP account settings where you can specify download limits such as the N most recent days or up to N KB of messages. I forget what that pane is called. But try setting it to something like the most recent 7 days,
I'm not finding any such options for POP accounts under Tools->Account Settings->Server Settings and the only limit option under Tools->Account Settings->Disk Space is "...do not download: Messages larger than NN KB."
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: how to limit email download to 20 mails ?

Post by chrizoo »

DanRaisch wrote:
downloading too many messages at once and/or
I've never run into those issues, but then I have never tried to download 60,000 messages
As I said, I ran into these issues even when downloading much fewer mails. I would see "ghost messages" without content/sender and either without date or with date=1970, so we are talking data loss / data corruption here.

I'm glad you never had those issues, but they do exist. Happened to me several times over the years on different TB versions and hardware. And the various KB and other help articles warning of storing too many messages in your inbox do exist for a reason.
DanRaisch wrote:
accumulating too many messages in a single folder
That's manageable by creating an organization of folders, typically under Local Folders, and regularly moving messages from the Inbox folder to that structure, minimizing risk of loss and improving performance. Archiving messages chronologically would probably mean the number of messages in a given folder would never be excessive.
Uhm, yes ... that's exactly what I would like to do. But takes place after downloading, so it doesn't deal with my problem in the first place, because when I click "get new messages" TB would happily start downloading 60.000 messages, regardless of what sophisticated folder structure I create afterwards.
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: how to limit email download to 20 mails ?

Post by chrizoo »

@tanstaafl, @DanRaisch: Thank you both for your help.
I don't know whether I can access my emails via IMAP. I have been used to POP all my life, am familiar with it and would not have wanted to switch to another protocol. But if it turns out, there is no other way, maybe one day I'll have to. So thanks for the tip.

I like Tanstaafl's idea of downloading x days, then x+1 days, x+2 days and so on ... suffice to say that it would be quite cumbersome compared to clicking on a button to "download the next 20 emails", but it would have solved my problem. Unfortunately, as you say Dan Raisch, this setting, if it ever was there, has disappeared from the GUI. Maybe it is still there somewhere in the config editor or another location?

What I also don't understand:
Thunderbird seems to anticipate the problem of getting too many news messages at once, at least in theory. There is this command in the sandwich menu: file > get next 500 news messages. Additionally, according to http://archive.is/htJdD there options in news account > settings > server settings allowing you to set a max limit of messages to download and "Ask me before downloading more than ... messages" — in other words, exactly what I'm looking for. Unfortunately it seems as though both options have been removed from the GUI. At least, I cannot find them. Are these options still stored and configurable somewhere in the TB files?

Where I want to get at, is that there are – or at least were – options to limit the amount of news messages.
Why are these capabilities missing for email messages (at least for POP accounts) ?

If you are sure (which I obviously don't doubt) that there is currently no way to limit the download from a POP server to a specific number of emails (or any limit, really), I would file a RFE at bugzilla.mozilla.org. Do you know if such a feature ("download at most ... messages") would violate the POP protocol standards? I couldn't find any such prohibition in https://tools.ietf.org/html/rfc1939.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: how to limit email download to 20 mails ?

Post by tanstaafl »

I suspect the reason mail accounts don't have a get next 500 message feature is because few users get thousands of messages every day while it's quite common to try out a new newsgroup that has a tremendous amount of existing messages.

I don't remember anything in the rfcs that would prevent the enhancement you want but POP accounts have become a legacy feature in Thunderbird. The developers are not interested in dealing with more common problems such as the legal but different sequences of POP commands that Thunderbird uses periodically causing inter-operability problems with Outlook and Yahoo , so I think you'd have a very tough time convincing them to add a feature that a small percentage of users would ever use.

You might be able to find a program like Mailwasher , POPTrayU or PopPeeper that can be used as a proxy to preview/delete POP messages before they are downloaded by Thunderbird, but has a get next 500 messages feature. Unfortunately none of the mail notifiers/spam blockers that I'm aware of has the feature you want.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: how to limit email download to 20 mails ?

Post by tanstaafl »

You can configure a POP account to only download headers by default. You could create a message filter that downloaded the message body for 500 messages each time you ran it manually. See http://kb.mozillazine.org/Download_only ... P_messages . The problem is that you'd probably have to write some javascript code that used extra features added by the FiltaZilla add-on to do that. Since your 60K inbox is apparently a one time problem it would be much easier to clean up your inbox via webmail.
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: how to limit email download to 20 mails ?

Post by chrizoo »

DanRaisch wrote:does your email provider offer IMAP access to your account? If so, you could duplicate the account in Thunderbird, adding it as an IMAP account. Setting that to NOT store copies of messages on the local machine would mean the account would only download header data for each of those 60,000 messages until you opened a particular message for viewing/reading. Those you wished to retain you could move to sub-folders of Local Folders while deleting those you don't.

thanks, but I want to do the opposite: download (say) 20 mails, verify what they are about, deal with them (reply, etc.), delete if unnecessary, archive if important, download next 20 mails ...
I can do this step by step. Thanks for your help, but your method doesn't allow me to do that.

tanstaafl wrote:An alternative is to replace it with a IMAP account. If you configure the "Synchronization & Storage" settings not to "store messages for this account on the computer" it won't create the optional offline folders on your hard disk. If you also disable global search/indexing in tools -> options -> advanced -> general it will not download any messages for the IMAP account to the hard disk. It will only download the headers needed to create a folder listing (the *.msf file). That should make it much easier/quicker to read/delete messages in a inbox with 60K messages as it will only fetch one message at a time (the one you are reading). The fetched message will only be in memory, not on the hard disk. Another advantage of a IMAP account is by default if you have a large attachment (message is at least 30KB) it won't fetch the attachment unless you explicitly open it.
what exactly is the difference between that and a POP account configured to download headers only ?
User avatar
chrizoo
Posts: 374
Joined: October 11th, 2006, 5:58 pm

Re: how to limit email download to 20 mails ?

Post by chrizoo »

tanstaafl wrote:You can configure a POP account to only download headers by default. You could create a message filter that downloaded the message body for 500 messages each time you ran it manually.
Thanks. I am aware of that possibility, but it's still unrecommended to download tens of thousands of emails into your Inbox (even with headers only).
tanstaafl wrote:it would be much easier to clean up your inbox via webmail.
sorry, no, this would take decades via webmail (compared to Thunderbird, if you have to open all messages and delete many of them). And besides, I don't only want to "clean up" the inbox, but also deal with the messages in the process, e.g. respond to eMails, do research, etc. If I had to read the same eMail a second time later on, that would double my work.
User avatar
DanRaisch
Moderator
Posts: 127246
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: how to limit email download to 20 mails ?

Post by DanRaisch »

It seems you are looking at a niche requirement for which neither the POP nor IMAP protocol offers a solution that matches you intended procedure.
Post Reply