added IMAP, LetsEncrypt, update layout

This commit is contained in:
2026-08-12 21:14:19 +01:00
parent 6e103959b0
commit 70fa1a5f2c
222 changed files with 42947 additions and 14038 deletions
+19
View File
@@ -0,0 +1,19 @@
package mailstore
import "fmt"
// QuotaStatus reports a mailbox's storage usage — feeds the "≥90% full" badge on the
// mailboxes list and the dashboard tile in a later milestone.
func (s *Store) QuotaStatus(mailboxID int64) (used, quota int64, pctFull float64, err error) {
mbox, err := s.DB.GetMailboxByID(mailboxID)
if err != nil {
return 0, 0, 0, err
}
if mbox == nil {
return 0, 0, 0, fmt.Errorf("mailstore: mailbox %d not found", mailboxID)
}
if mbox.QuotaBytes == 0 {
return mbox.UsedBytes, 0, 0, nil
}
return mbox.UsedBytes, mbox.QuotaBytes, float64(mbox.UsedBytes) / float64(mbox.QuotaBytes) * 100, nil
}