mail: allow aliases to have wildcard

this came out of https://forum.cloudron.io/topic/6350/disposable-email-prefixes-for-existing-mailboxes/
This commit is contained in:
Girish Ramakrishnan
2022-08-18 13:21:24 +02:00
parent 6124323d52
commit 1591541c7f
5 changed files with 53 additions and 6 deletions
+13
View File
@@ -183,6 +183,19 @@ describe('Mail', function () {
expect(results[1].domain).to.be(domain.domain);
});
it('can set wildcard alias', async function () {
await mail.setAliases('support', domain.domain, [ { name: 'support*', domain: domain.domain }, { name: 'help', domain: domain.domain } ], auditSource);
});
it('can get aliases of name', async function () {
const results = await mail.getAliases('support', domain.domain);
expect(results.length).to.be(2);
expect(results[0].name).to.be('help');
expect(results[0].domain).to.be(domain.domain);
expect(results[1].name).to.be('support*');
expect(results[1].domain).to.be(domain.domain);
});
it('unset aliases', async function () {
await mail.setAliases('support', domain.domain, [], auditSource);