mail: require catch all to be absolute
This commit is contained in:
@@ -40,11 +40,16 @@ describe('Mail', function () {
|
||||
expect(mailConfig.mailFromValidation).to.be(false);
|
||||
});
|
||||
|
||||
it('can set catch all address', async function () {
|
||||
await mail.setCatchAllAddress(domain.domain, [ 'user1', 'user2' ]);
|
||||
it('cannot set invalid catch all address', async function () {
|
||||
const [error] = await safe(mail.setCatchAllAddress(domain.domain, [ 'user1' ]));
|
||||
expect(error.reason).to.be(BoxError.BAD_FIELD);
|
||||
});
|
||||
|
||||
it('can set invalid catch all address', async function () {
|
||||
await mail.setCatchAllAddress(domain.domain, [ `user1@${domain.domain}`, `user2@${domain.domain}` ]);
|
||||
|
||||
const mailConfig = await mail.getDomain(domain.domain);
|
||||
expect(mailConfig.catchAll).to.eql([ 'user1', 'user2' ]);
|
||||
expect(mailConfig.catchAll).to.eql([ `user1@${domain.domain}`, `user2@${domain.domain}` ]);
|
||||
});
|
||||
|
||||
it('can set mail relay', async function () {
|
||||
|
||||
Reference in New Issue
Block a user