Horde - when opening a mailbox for the first time, where do you want to start

diracuser

Active Member
Oct 22, 2014
41
1
8
cPanel Access Level
Root Administrator
Hello.
I want by default when horde is opened that messages are ordering newest first and the scroll in the top.
I have change in my server in /usr/local/cpanel/base/horde/imp/config/prefs.php file this value:

// default sorting direction
$_prefs['sortdir'] = array(
'value' => 1,
'locked' => false,
'shared' => false,
'type' => 'enum',
'enum' => array(0 => _("Ascending"),
1 => _("Descending")),
'desc' => _("Default sorting direction:"));

but the scroll is at the bottom...

Where can I change this option: When opening a mailbox for the first time, where do you want to start? (last newest) Unseen Message
for all mailboxes (option by default)

Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello @diracuser,

The following entry in /usr/local/cpanel/base/horde/imp/config/prefs.php is what you'd need to change:

Code:
$_prefs['mailbox_start'] = array(
    'value' => IMP::MAILBOX_START_FIRSTUNSEEN,
    'type' => 'enum',
    'enum' => array(
        IMP::MAILBOX_START_FIRSTUNSEEN => _("First (oldest) Unseen Message"),
        IMP::MAILBOX_START_LASTUNSEEN => _("Last (newest) Unseen Message"),
        IMP::MAILBOX_START_FIRSTPAGE => _("First Page"),
        IMP::MAILBOX_START_LASTPAGE => _("Last Page")
    ),
    'desc' => _("When opening a mailbox for the first time, where do you want to start?")
);
Based on the information you provided, you'd want this entry to instead look like this:

Code:
$_prefs['mailbox_start'] = array(
    'value' => IMP::MAILBOX_START_LASTUNSEEN,
    'type' => 'enum',
    'enum' => array(
        IMP::MAILBOX_START_FIRSTUNSEEN => _("First (oldest) Unseen Message"),
        IMP::MAILBOX_START_LASTUNSEEN => _("Last (newest) Unseen Message"),
        IMP::MAILBOX_START_FIRSTPAGE => _("First Page"),
        IMP::MAILBOX_START_LASTPAGE => _("Last Page")
    ),
    'desc' => _("When opening a mailbox for the first time, where do you want to start?")
);
Note that this file is overwritten by default when cPanel updates, so you'd have to develop a custom bash script that automatically makes this change, and then configure it to run after each cPanel update. Information on how to make custom scripts run after cPanel updates (upcp) is available at:

Guide to Standardized Hooks - Software Development Kit - cPanel Documentation
Guide to Standardized Hooks - System Functions - Software Development Kit - cPanel Documentation

Thank you.