Roundcubemail: Elastic: display email size

Created on 10 Jan 2020  路  13Comments  路  Source: roundcube/roundcubemail

The size of emails is not visible with Elastic theme.

The most useful place for that is in the list of emails, perhaps near the date. This could be shown/hidden by editing CSS if needed. Perhaps size could also be shown in the headers section of emails.

User Interface enhancement

Most helpful comment

Hello alecpc,

I don't think that what other 3-column view clients do should define RC's ambitions.
: ]

I'd be happy if the info was there (list + header), even hidden, and I could then tweak local CSS to display it. For me, perhaps others, seeing the size of emails in the list is helpful. Also, some emails with images included inline do not show up as attachments, so no size is displayed.

Cheers,

All 13 comments

Most of webmail apps I know that have 3-column view do not display message size. So, maybe it's not that important. More important is attachment size which you can see in the mail preview.

Hello alecpc,

I don't think that what other 3-column view clients do should define RC's ambitions.
: ]

I'd be happy if the info was there (list + header), even hidden, and I could then tweak local CSS to display it. For me, perhaps others, seeing the size of emails in the list is helpful. Also, some emails with images included inline do not show up as attachments, so no size is displayed.

Cheers,

The size of emails is not visible with Elastic theme.

The most useful place for that is in the list of emails, perhaps near the date. This could be shown/hidden by editing CSS if needed. Perhaps size could also be shown in the headers section of emails.

I totally agree! Being able to sort a mailbox by message size when trying remove large message that are pushing it to over-quota is a MUST. Larry had it right!

Please add those column/sort options back in.

I manage a few dozen companies that use roundcube via cpanel and I have to say that since the new theme was integrated the missing size column has been the one major complaint I have gotten from them. I had to switch them to the old theme to get the functionality back. it would be great to have the option of using it at least. Although its still there via the old theme, it would be great to be able to use it with the new interface which is so very slick.

in any case thank you for such a great app.

Definitely a +1 from my side.
Missing this feature for exactly the same reason as hyssop: deleting large messages that push the email account toward its quota.
Bringing this back would be much appreciated.

Definitely a +1 from my side.
Missing this feature for exactly the same reason as hyssop: deleting large messages that push the email account toward its quota.
Bringing this back would be much appreciated.

Registered to add to this. Just came across this issue and had to revert to an older theme to get that functionality. It seems like a simple and justified use case.

Regards,
Jason

This continues to be a problem when assisting account users with quota issues. Without being able to sort by message size it is not easy to help them. Alternatives are extra work for us, or inconvenience and frustration for the user. I hope this can be changed soon.

We like the new theme and don't want to stay with the old, but the need for this ability overrides that.

-Pete

Maybe someone will make a nice PR out of this, but this worked for me (on Roundcube 1.4.9):

program/js/app.js around line 2349 add

    else if (c == 'size') {
        // Remove this whole "if/else" and leave "html = ..." if you want the size to be shown on all messages and not just those with attachments
        if (flags.hasattachment || (!flags.hasnoattachment && /application\/|multipart\/(m|signed)/.test(flags.ctype))) {
          html = cols[c];
        } else {
          // This hides size from emails with no attachments
          continue;
        }
      }

after the last else if statement (which is c == 'folder' in my case)

program/js/app.js around line 260 change

this.env.widescreen_list_template = [
            {className: 'threads', cells: ['threads']},
            {className: 'subject', cells: ['fromto', 'date', 'status', 'subject']},
            {className: 'flags', cells: ['flag', 'attachment']}
          ];

to

this.env.widescreen_list_template = [
            {className: 'threads', cells: ['threads']},
            {className: 'subject', cells: ['fromto', 'date', 'status', 'size', 'subject']}, // Size column added before 'subject"
            {className: 'flags', cells: ['flag', 'attachment']}
          ];

Create a new plugin like message_list_attachment_size and add this in the .php file:
(This will output the "size" attribute of the mail to the js frontend)

<?php

class message_list_attachment_size extends rcube_plugin
{
    function init() {
        $this->add_hook('messages_list', array($this, 'messages_list'));
    }

    function messages_list($args) {
        $args['cols'][] = 'size';

        return $args;
    }
}

?>

and make sure the plugin is loaded.

Add some custom styles to your _styles.less file:

// Display size in mail list
.messagelist {
  td.subject {
    position: relative;

    .size {
      position: absolute;
      right: 0;
      bottom: 2px;
      font-size: 75%;
      color: @color-list-secondary;

      // Only affect subject if there is any size column
      + .subject {
        padding-right: 50px;
      }
    }
  }
}

html.touch {
  .messagelist {
    td.subject {
      .size {
        right: .5em;

        // Only affect subject if there is any size column
        + .subject {
          padding-right: 3.5em;
        }
      }
    }
  }
}

(Don't forget to recompile your .less file)

And this should give you the following result in your message list:

image

This works for my use case: Showing total mail size in list of mails with attachments. If you modify the "if" statement in the first code example this should print out the size of every message.

I could not test this in every use-case and maybe this is not the right way of doing it, but at least it worked for me.

I'm going to work on this. Here's the plan.

  1. When the list IS NOT sorted by size the size will replace the date on tr:hover.
  2. When the list IS sorted by size we'll have the opposite behavior, i.e. the size will get replaced by date on tr:hover.

Done.

Awesome!

Newbie here -- What do I need to do to pull the code change to my server?

Is it automatic? If so, when will I receive it and be able to test?

Cheers,
Jason

@charlottezweb Google git fetch and git pull

This new theme with a missing size column totally flummoxed me earlier - absolutely crazy that a size sorting method is missing!!! I don't want just attachment size sorting, it has to be everything sorting.

I was trying to explain to someone over the phone that she needed to sort by size to see what was causing the loss of space on the server and it was impossible to describe or find the obvious.

Whoever thought this was a good idea to leave it out? - Crazy!

I had to login to revert things back to the more sensible theme, one that actually does the job properly. I'm beginng to hate the new world of a clean/simple app-view of everything, it throws out so many basic things that took us years to evolve, all lost by one person or team's view of how they can make it better without leaving us the option to easily choose or customise.

Oh well, it's changed back to the old theme now - no doubt elastic theme is interesting but I had no time to explore it and probably never will if it can't do the job.

Was this page helpful?
0 / 5 - 0 ratings