And STATUS SIZE is part of RFC 8438, not RFC 9051
This commit is contained in:
the-djmaze 2023-11-14 16:49:38 +01:00
parent 9bdd7d5564
commit 13c23141ee
12 changed files with 34 additions and 9 deletions

View file

@ -25,6 +25,8 @@ import { /*koComputable,*/ addObservablesTo } from 'External/ko';
import Remote from 'Remote/User/Fetch';
import { FileInfo } from 'Common/File';
const
// isPosNumeric = value => null != value && /^[0-9]*$/.test(value.toString()),
@ -304,6 +306,7 @@ export class FolderModel extends AbstractModel {
this.etag = '';
this.id = 0;
this.uidNext = 0;
this.size = 0;
addObservablesTo(this, {
name: '',
@ -456,6 +459,8 @@ export class FolderModel extends AbstractModel {
return '';
},
friendlySize: () => FileInfo.friendlySize(this.size),
detailedName: () => this.name() + ' ' + this.nameInfo(),
hasSubscribedUnreadMessagesSubfolders: () =>

View file

@ -19,7 +19,8 @@
white-space: pre-wrap;
}
.folder-system-name {
.folder-system-name, .folder-size {
margin-left: 0.2em;
opacity: 0.6;
}

View file

@ -36,6 +36,7 @@ const
imapDisable_sort: false,
imapDisable_thread: false,
imapDisable_binary: false,
imapDisable_status_size: true,
imapExpunge_all_on_delete: false,
imapFast_simple_search: true,
imapFetch_new_messages: true,
@ -86,6 +87,7 @@ const
disable_sort: !!oDomain.imapDisable_sort(),
disable_thread: !!oDomain.imapDisable_thread(),
disable_binary: !!oDomain.imapDisable_binary(),
disable_status_size: !!oDomain.imapDisable_status_size(),
folder_list_limit: pInt(oDomain.imapFolder_list_limit()),
message_list_limit: pInt(oDomain.imapMessage_list_limit())
/*

View file

@ -28,6 +28,7 @@
"disable_sort": false,
"disable_thread": false,
"disable_binary": false,
"disable_status_size": true,
"use_expunge_all_on_delete": false,
"fast_simple_search": true,
"force_select": false,

View file

@ -143,6 +143,10 @@ trait Folders
if ($this->hasCapability('APPENDLIMIT')) {
$aStatusItems[] = FolderStatus::APPENDLIMIT;
}
// RFC 8438
if ($this->hasCapability('STATUS=SIZE')) {
$aStatusItems[] = FolderStatus::SIZE;
}
// RFC 8474
if ($this->hasCapability('OBJECTID')) {
$aStatusItems[] = FolderStatus::MAILBOXID;
@ -151,11 +155,6 @@ trait Folders
$aStatusItems[] = 'X-GUID';
*/
}
/* // STATUS SIZE can take a significant amount of time, therefore not active
if ($this->hasCapability('IMAP4rev2')) {
$aStatusItems[] = FolderStatus::SIZE;
}
*/
return $aStatusItems;
}

View file

@ -28,8 +28,8 @@ abstract class FolderStatus
const HIGHESTMODSEQ = 'HIGHESTMODSEQ';
// RFC 7889
const APPENDLIMIT = 'APPENDLIMIT';
// RFC 8438
const SIZE = 'SIZE';
// RFC 8474
const MAILBOXID = 'MAILBOXID';
// RFC 9051 IMAP4rev2
const SIZE = 'SIZE';
}

View file

@ -164,6 +164,7 @@ class Folder implements \JsonSerializable
'totalEmails' => $this->MESSAGES,
'unreadEmails' => $this->UNSEEN,
'id' => $this->MAILBOXID,
'size' => $this->SIZE,
'role' => $this->Role()
/*
'myRights' => [

View file

@ -325,6 +325,10 @@ class ImapClient extends \MailSo\Net\NetClient
}
if (8 > PHP_INT_SIZE) {
$aList = \array_diff($aList, ['CONDSTORE']);
$aList = \array_diff($aList, ['STATUS=SIZE']);
}
if ($this->Settings->disable_status_size) {
$aList = \array_diff($aList, ['STATUS=SIZE']);
}
}
$this->aCapabilityItems = $aList;

View file

@ -28,6 +28,8 @@ class Settings extends \MailSo\Net\ConnectSettings
$disable_sort = false,
$disable_thread = false,
$disable_binary = false,
// STATUS SIZE can take a significant amount of time, therefore not active by default
$disable_status_size = true,
$expunge_all_on_delete = false,
$fast_simple_search = true,
$fetch_new_messages = true,
@ -53,6 +55,7 @@ class Settings extends \MailSo\Net\ConnectSettings
'disable_sort',
'disable_thread',
'disable_binary',
'disable_status_size',
'expunge_all_on_delete',
'fast_simple_search',
'fetch_new_messages',
@ -91,6 +94,7 @@ class Settings extends \MailSo\Net\ConnectSettings
'disable_sort' => $this->disable_sort,
'disable_thread' => $this->disable_thread,
'disable_binary' => $this->disable_binary,
'disable_status_size' => $this->disable_status_size,
'use_expunge_all_on_delete' => $this->expunge_all_on_delete,
// 'body_text_limit' => $this->body_text_limit,
'fast_simple_search' => $this->fast_simple_search,

View file

@ -82,7 +82,7 @@ trait Status
public ?string $MAILBOXID = null;
/**
* RFC 9051
* RFC 8438
* The total size of the mailbox in octets.
*/
public ?int $SIZE = null;

View file

@ -121,6 +121,13 @@
label: 'BINARY'
}
}"></div>
<div data-bind="component: {
name: 'Checkbox',
params: {
value: imapDisable_status_size,
label: 'STATUS SIZE'
}
}"></div>
<h4 data-i18n="POPUPS_DOMAIN/LIMITS"></h4>
<div class="control-group">

View file

@ -7,6 +7,7 @@
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-bind="textInput: nameForEdit, visible: editing, hasfocus: editing, onEnter: rename, onEsc: unedit">
<span class="folder-system-name" data-bind="text: nameInfo, visible: isSystemFolder"></span>
<span class="folder-size" data-bind="text: friendlySize, visible: size"></span>
</td>
<td data-i18n="[title]SETTINGS_FOLDERS/HELP_DELETE_FOLDER">
<a class="btn btn-small btn-danger button-confirm-delete" data-bind="css: {'delete-access': askDelete()}, click: $root.deleteFolder"