Hello!
First of all, a big thank you to all contributors and maintainers, aerc
is my daily driver email client :D
Now, I prefer sorting my email list simply by newest first (sort="-r
date"). However, aerc seems to always fetch the page from oldest to
newest, which turns out to be a bit inconvenient when using slow
Internet, since it can take a hot minute to load the top messages which
are of most interest to me.
(I know I should organize my inbox email better to avoid having full
pages hehe 😅)
Is it possible to load mail in this order (perhaps a configurable or
derived from `sort`), or is there a limitation from the protocol (IMAP
in this case)?
Once again, thank you,
~tmpod
Hi,
tmpod, Aug 28, 2023 at 12:48:
> Is it possible to load mail in this order (perhaps a configurable or> derived from `sort`), or is there a limitation from the protocol (IMAP> in this case)?
did you try to comment/remove the sort configuration option from
aerc.conf?
I know that some IMAP servers don't support sorting by date and return
messages in a random order when asked to do so. I use Gmail's IMAP for
work and without sort= set to anything, the most recent messages appear
on top.
Robin
I just tried commenting that config and it surprisingly made no
difference. The message list filled from bottom to top, with the newest
mail at the top.
So does the protocol not support specifying a sort and we just get what
each implementation decides to go with?
On Mon Aug 28, 2023 at 5:48 AM CDT, tmpod wrote:
> Hello!>> First of all, a big thank you to all contributors and maintainers, aerc> is my daily driver email client :D>> Now, I prefer sorting my email list simply by newest first (sort="-r> date"). However, aerc seems to always fetch the page from oldest to> newest, which turns out to be a bit inconvenient when using slow> Internet, since it can take a hot minute to load the top messages which> are of most interest to me. > (I know I should organize my inbox email better to avoid having full> pages hehe 😅)>> Is it possible to load mail in this order (perhaps a configurable or> derived from `sort`), or is there a limitation from the protocol (IMAP> in this case)?
Hello!
It is technically possible, but would really hurt performance. The way this all
works is like so:
1. We search IMAP for all messages in the folder. IMAP responds with a list in
ascending date order. We reverse the list so that the list is in descending
order. Let's say the UIDs for this list are 1:5000, with 5000 being the
newest message. If the server supports SORT, we get the list in the order we
want and we don't have to reverse it in the '-r' case
2. We download the headers for the visible messages, let's say this is
4950:5000. IMAP will respond with the headers in 4950:5000 order. Because of
we receive 4950 before 5000. Even for IMAP servers that support SORT, they
will return headers like this (FETCH commands are unaffected by SORT)
The fix would be to request 5000, then 4999, then 4998...and so on. This adds a
lot of extra round trips and would significantly slow down the
--
Tim
tmpod, Aug 28, 2023 at 15:01:
> I just tried commenting that config and it surprisingly made no> difference. The message list filled from bottom to top, with the newest> mail at the top.
I'm confused, isn't this exactly what you wanted to do with your config?
No, I'd like to get the "-r date" sorting, but fetch/receive the newest
messages first. At the moment, the list is properly sorted, but messages
start coming in from oldest to newest (in that page).
Thank you a lot for your detailed response!
> 1. We search IMAP for all messages in the folder. IMAP responds with a list in> ascending date order. We reverse the list so that the list is in descending> order. Let's say the UIDs for this list are 1:5000, with 5000 being the> newest message. If the server supports SORT, we get the list in the order we> want and we don't have to reverse it in the '-r' case> 2. We download the headers for the visible messages, let's say this is> 4950:5000. IMAP will respond with the headers in 4950:5000 order. Because of> we receive 4950 before 5000. Even for IMAP servers that support SORT, they> will return headers like this (FETCH commands are unaffected by SORT)
I see now, IMAP doesn't support sorting in those header windows, quite
unfortunate :(
> The fix would be to request 5000, then 4999, then 4998...and so on. This adds a> lot of extra round trips and would significantly slow down the
Yeah, that would be undesirable.
Welp ¯\_(ツ)_/¯
I'll just keep doing what I was doing
Thank you!
~tmpod
On Mon Aug 28, 2023 at 9:24 AM CDT, tmpod wrote:
> Thank you a lot for your detailed response!>> > 1. We search IMAP for all messages in the folder. IMAP responds with a list in> > ascending date order. We reverse the list so that the list is in descending> > order. Let's say the UIDs for this list are 1:5000, with 5000 being the> > newest message. If the server supports SORT, we get the list in the order we> > want and we don't have to reverse it in the '-r' case> > 2. We download the headers for the visible messages, let's say this is> > 4950:5000. IMAP will respond with the headers in 4950:5000 order. Because of> > we receive 4950 before 5000. Even for IMAP servers that support SORT, they> > will return headers like this (FETCH commands are unaffected by SORT)>> I see now, IMAP doesn't support sorting in those header windows, quite> unfortunate :(>> > The fix would be to request 5000, then 4999, then 4998...and so on. This adds a> > lot of extra round trips and would significantly slow down the >> Yeah, that would be undesirable.>> Welp ¯\_(ツ)_/¯> I'll just keep doing what I was doing >> Thank you!>> ~tmpod
Do you have header caching on? This should help significantly on slow
connections. Another optimization is to set the 'headers' config key in an
account to "references". This will force aerc to only fetch a small subset of
headers (basically those required to thread + display messages).
--
Tim
On Mon Aug 28, 2023 at 11:14 AM CDT, tmpod wrote:
> No, how do I enable those?> I looked at the default config files[1] and couldn't find those keys.
'headers' is in the accounts config (man aerc-accounts). I recommend setting it
to headers=references. This will give you everything you need for threading and
nothing more.
cache-headers is in the IMAP man page (also will end up in your account config),
see man aerc-imap.
Your account config could then be like this:
[imap]
source = ....
source-cred-cmd = ....
headers = references
cache-headers = true
--
Tim