diff --git a/src/translation/en.json b/src/translation/en.json index 59b76895a..d2cc877dc 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -690,7 +690,10 @@ "receivedInfo": "Saved", "deliveredInfo": "Delivered mail", "deniedInfo": "Connection denied", - "spamFilterTrainedInfo": "Spam filter trained using mailbox content" + "spamFilterTrainedInfo": "Spam filter trained using mailbox content", + "overQuotaInfo": "Mailbox {{ mailbox }} is {{ quotaPercent }}% full", + "underQuotaInfo": "Mailbox {{ mailbox }} has fallen below {{ quotaPercent }}% quota", + "quota": "Mailbox Quota" }, "searchPlaceholder": "Search", "from": "From", diff --git a/src/translation/nl.json b/src/translation/nl.json index ea067a0cf..bb30c4b7c 100644 --- a/src/translation/nl.json +++ b/src/translation/nl.json @@ -1606,7 +1606,8 @@ "aliases": "Aliassen", "noAliases": "Er zijn geen aliassen ingesteld.", "addAliasAction": "Alias toevoegen", - "addAnotherAliasAction": "Een andere alias toevoegen" + "addAnotherAliasAction": "Een andere alias toevoegen", + "enableStorageQuota": "Inschakelen Opslag Quota" }, "deleteMailboxDialog": { "purgeMailboxCheckbox": "Verwijder alle e-mails en filters in deze mailbox", @@ -1794,5 +1795,10 @@ "mounts": { "description": "Apps kunnen toegang krijgen tot volumes via /media/{volume name} directory. Deze data is niet opgenomen in de app backup." } + }, + "mailboxes": { + "edit": { + "unlimitedStorageQuota": "Onbeperkt" + } } } diff --git a/src/translation/ru.json b/src/translation/ru.json index 49538b0dd..a5c97c12f 100644 --- a/src/translation/ru.json +++ b/src/translation/ru.json @@ -1609,7 +1609,8 @@ "addAliasAction": "Добавить псевдоним", "addAnotherAliasAction": "Добавить ещё один псевдоним", "aliases": "Псевдонимы", - "noAliases": "Псевдонимы не настроены." + "noAliases": "Псевдонимы не настроены.", + "enableStorageQuota": "Включить квоту хранилища" }, "deleteMailboxDialog": { "title": "Удалить почтовый ящик {{ name }}@{{ domain }}", @@ -1794,5 +1795,10 @@ "mounts": { "description": "Приложения могут получить доступ к смонтированным томампо пути /media/{имя тома}. Данные таких томов не будут включаться в резервные копии приложения." } + }, + "mailboxes": { + "edit": { + "unlimitedStorageQuota": "Безлимитно" + } } } diff --git a/src/views/email.html b/src/views/email.html index cbceb0224..3c24c0fd5 100644 --- a/src/views/email.html +++ b/src/views/email.html @@ -459,7 +459,7 @@ {{ alias.name + '@' + alias.domain }} - {{ mailbox.usage | prettyByteSize }} + {{ mailbox.usage | prettyByteSize }} / {{ mailbox.limit | prettyByteSize }} diff --git a/src/views/email.js b/src/views/email.js index bdb5095ab..6bd9a12f7 100644 --- a/src/views/email.js +++ b/src/views/email.js @@ -630,11 +630,15 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio } function done() { + $scope.diskUsage[$scope.mailboxes.edit.name + '@' + $scope.domain.domain].quotaLimit = $scope.mailboxes.edit.storageQuotaEnabled ? $scope.mailboxes.edit.storageQuota/1024 : 0; // hack to avoid refresh + $scope.mailboxes.edit.busy = false; $scope.mailboxes.edit.error = null; $scope.mailboxes.edit.name = ''; $scope.mailboxes.edit.owner = null; $scope.mailboxes.edit.aliases = []; + $scope.mailboxes.edit.storageQuota = 0; + $scope.mailboxes.edit.storageQuotaEnabled = false; $scope.mailboxes.refresh(); $('#mailboxEditModal').modal('hide'); @@ -697,7 +701,8 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio m.ownerDisplayName = m.owner ? m.owner.display : ''; // this meta property is set when we get the user list var u = $scope.diskUsage[m.name + '@' + m.domain]; // this is unset when no emails have been received yet - m.usage = (u && u.size) || 0; + m.usage = (u && u.quotaValue * 1024) || 0; + m.limit = u.quotaLimit * 1024; }); $scope.mailboxes.mailboxes = mailboxes; diff --git a/src/views/emails-eventlog.html b/src/views/emails-eventlog.html index e12450de0..752848d63 100644 --- a/src/views/emails-eventlog.html +++ b/src/views/emails-eventlog.html @@ -64,10 +64,11 @@ + {{ eventlog.ts | prettyDate }} {{ (eventlog.mailFrom | prettyEmailAddresses) || '-' }} - {{ (eventlog.rcptTo | prettyEmailAddresses) || '-' }} + {{ (eventlog.rcptTo | prettyEmailAddresses) || eventlog.mailbox || '-' }} {{ 'emails.eventlog.type.bounceInfo' | tr }}. {{ eventlog.message || eventlog.reason }} {{ 'emails.eventlog.type.deferredInfo' | tr: { delay:eventlog.delay } }}. {{ eventlog.message || eventlog.reason }} @@ -79,6 +80,10 @@ {{ 'emails.eventlog.type.deliveredInfo' | tr }} {{ 'emails.eventlog.type.deniedInfo' | tr }}. {{ eventlog.message || eventlog.reason }} {{ 'emails.eventlog.type.spamFilterTrainedInfo' | tr }} + + {{ 'emails.eventlog.type.overQuotaInfo' | tr: { mailbox: eventlog.mailbox, quotaPercent: eventlog.quotaPercent } }} + {{ 'emails.eventlog.type.underQuotaInfo' | tr: { mailbox: eventlog.mailbox, quotaPercent: -eventlog.quotaPercent } }} + diff --git a/src/views/emails-eventlog.js b/src/views/emails-eventlog.js index b01136661..5057b8293 100644 --- a/src/views/emails-eventlog.js +++ b/src/views/emails-eventlog.js @@ -22,6 +22,7 @@ angular.module('Application').controller('EmailsEventlogController', ['$scope', { name: 'Delivered', value: 'delivered' }, { name: 'Denied', value: 'denied' }, { name: 'Queued', value: 'queued' }, + { name: 'Quota', value: 'quota' }, { name: 'Received', value: 'received' }, { name: 'Spam', value: 'spam' }, ]; diff --git a/src/views/emails.js b/src/views/emails.js index b05c74720..24d88aff3 100644 --- a/src/views/emails.js +++ b/src/views/emails.js @@ -436,7 +436,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati if (error) return console.error('Failed to fetch usage for domain', domain.domain, error); domain.usage = 0; - Object.keys(usage).forEach(function (m) { domain.usage += usage[m].size; }); + Object.keys(usage).forEach(function (m) { domain.usage += (usage[m].quotaValue * 1024); }); }); }); });