mirror of
https://github.com/hanzoai/mail.git
synced 2026-09-23 23:53:02 +00:00
Fork of github.com/mjl-/mox at 5656ca6d1b
(upstream v0.0.15 plus 55 commits).
Rename the module path in go.mod and the import paths in 268 Go files. Also
update the five scripts that "go install" the module (genwebsite.sh,
docker-release.sh, apidiff.sh, test-upgrade.sh, Dockerfile.release), which
would otherwise build upstream rather than this fork.
Add NOTICE recording the upstream project, author, license, and fork point,
and stating which license covers which files: MIT for the mox source and our
changes, MPL-2.0 for publicsuffix/public_suffix_list.txt alone, and the
vendored dependencies' own licenses under licenses/. Embed NOTICE so
"mail licenses" prints the lineage from the running binary. LICENSE.MIT,
LICENSE.MPLv2.0 and the licenses/ tree are preserved verbatim; no code is
relicensed.
The mox command name, config keys, data directory layout and website content
are unchanged. LLM.md records the fork point, the rename, what was left alone,
and the steps to stand the server up.
Co-authored-by: Hanzo Dev <[email protected]>
55 lines
1.9 KiB
Go
55 lines
1.9 KiB
Go
package imapserver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hanzoai/mail/imapclient"
|
|
)
|
|
|
|
func TestQuota1(t *testing.T) {
|
|
tc := start(t, false)
|
|
defer tc.close()
|
|
|
|
tc.login("[email protected]", password0)
|
|
|
|
// We don't implement setquota.
|
|
tc.transactf("bad", `setquota "" (STORAGE 123)`)
|
|
|
|
tc.transactf("bad", "getquotaroot") // Missing param.
|
|
tc.transactf("bad", "getquotaroot inbox bogus") // Too many params.
|
|
|
|
tc.transactf("bad", "getquota") // Missing param.
|
|
tc.transactf("bad", "getquota a b") // Too many params.
|
|
|
|
// tc does not have a limit.
|
|
tc.transactf("ok", "getquotaroot inbox")
|
|
tc.xuntagged(imapclient.UntaggedQuotaroot([]string{""}))
|
|
|
|
tc.transactf("no", "getquota bogusroot")
|
|
tc.transactf("ok", `getquota ""`)
|
|
tc.xuntagged()
|
|
|
|
// Check that we get a DELETED-STORAGE status attribute with value 0, also if
|
|
// messages are marked deleted. We don't go through the trouble.
|
|
tc.transactf("ok", "status inbox (DELETED-STORAGE)")
|
|
tc.xuntagged(imapclient.UntaggedStatus{Mailbox: "Inbox", Attrs: map[imapclient.StatusAttr]int64{imapclient.StatusDeletedStorage: 0}})
|
|
|
|
// tclimit does have a limit.
|
|
tclimit := startArgs(t, false, false, false, true, true, "limit")
|
|
defer tclimit.close()
|
|
|
|
tclimit.login("[email protected]", password0)
|
|
|
|
tclimit.transactf("ok", "getquotaroot inbox")
|
|
tclimit.xuntagged(
|
|
imapclient.UntaggedQuotaroot([]string{""}),
|
|
imapclient.UntaggedQuota{Root: "", Resources: []imapclient.QuotaResource{{Name: imapclient.QuotaResourceStorage, Usage: 0, Limit: 1}}},
|
|
)
|
|
|
|
tclimit.transactf("ok", `getquota ""`)
|
|
tclimit.xuntagged(imapclient.UntaggedQuota{Root: "", Resources: []imapclient.QuotaResource{{Name: imapclient.QuotaResourceStorage, Usage: 0, Limit: 1}}})
|
|
|
|
tclimit.transactf("ok", "status inbox (DELETED-STORAGE)")
|
|
tclimit.xuntagged(imapclient.UntaggedStatus{Mailbox: "Inbox", Attrs: map[imapclient.StatusAttr]int64{imapclient.StatusDeletedStorage: 0}})
|
|
}
|