Menu

#5607 Incorrect date sorting in Read User Mail view

2.013
open
nobody
None
5
2023-01-26
2023-01-25
No

When viewing emails in Webmin > Servers > Read User Email, messages frequently appear in the wrong date order. I would prefer them displayed latest first by default and that doesn't work nor is there any way to configure it as far as I can tell, but even with date sorting explictly selected it doesn't happen correctly, although it does seem to make a difference to the display order (see attached screenshot). The problem is somewhat intermittent but very easy to reproduce.

I've also chosen this example because the quaratined messages won't have passed through IMAP or forwarding that might complicate the diagnosis.

This doesn't seem to be a timezone issue because it affects messages from the same zone and even the same sender, and the difference in sort order is days not hours.

There's an apparent character set decoding issue as well, visible in the same screenshot. I mention this only in case it's relevant to the date decoding, but it's probably a separate issue.

I notice it most on an Amavis quarantine folder which is full of spam - I guess those messages are more likely to be malformed or have missing headers. I can supply example headers if that helps.

I have seen many similiar reports of email date sorting problems over the years but none seem to have resulted in a fix. Apologies if this is therefore seen as a duplicate.

I realise that trying to define the "date" of a message is problematic because there are many different timestamps involved in message transmission. Nevertheless I think there's a real bug here because at the very least the displayed date is different from the one used for sorting, which doesn't make sense.

I'm on Webmin 2.013, Virtualmin 7.5, Ubuntu 18.04.6, MariaDB 10.4.27

1 Attachments

Discussion

  • Phil McKerracher

    Update: Someone is going to ask if the problem happens in Usermin as well, and the answer is yes. Screenshot attached. Not sure if that's a separate bug or not.

    I'm on Usermin 1.860.

     
  • Ilia

    Ilia - 2023-01-25

    Hello,

    At first check this patch for Webmin.

     
    • Phil McKerracher

      That patch seems to work well when the date sort arrows are clicked in Read User Mail view, thanks.

      The default view still seems pretty random (not sorted by originator, size, date, subject or anything else as far as I can tell).

       
  • Ilia

    Ilia - 2023-01-25

    Although, I think we shouldn't disable server sorting in mail modules. I will have a closer look into this.

     
  • Phil McKerracher

    The patch works in Usermin as well if date sort is selected, somewhat to my surprise.

    I'm guessing the default order is order of delivery rather than date sent or something. I'm not sure which datetime I care about most to be honest, but I still think random is bad and consistent would be better.

     
  • Jamie Cameron

    Jamie Cameron - 2023-01-26

    Yes, the default if no column header is clicked on is to sort by time received. This doesn't necessarily match the sending date, but it is faster..

     
  • Phil McKerracher

    Faster is good. Perhaps the solution is to just find the first page of most recent messages (by sending time) and display those, rather than sorting a potentially huge list?

    Alternatively, display the received time rather than the sent time. I think the first solution is probably more expected.

     
    • Ilia

      Ilia - 2023-01-26

      Perhaps the solution is to just find the first page of most recent messages (by sending time)

      Well, no we need to read emails' headers to know the right datetime.

       

Log in to post a comment.