mail: add option to force from address for relays

This commit is contained in:
Girish Ramakrishnan
2021-10-16 21:47:23 -07:00
parent 273a833935
commit 22e4d956fb
3 changed files with 8 additions and 5 deletions

View File

@@ -100,6 +100,7 @@ async function setMailRelay(req, res, next) {
if ('username' in req.body && typeof req.body.username !== 'string') return next(new HttpError(400, 'username must be a string'));
if ('password' in req.body && typeof req.body.password !== 'string') return next(new HttpError(400, 'password must be a string'));
if ('acceptSelfSignedCerts' in req.body && typeof req.body.acceptSelfSignedCerts !== 'boolean') return next(new HttpError(400, 'acceptSelfSignedCerts must be a boolean'));
if ('forceFromAddress' in req.body && typeof req.body.forceFromAddress !== 'boolean') return next(new HttpError(400, 'forceFromAddress must be a boolean'));
const [error] = await safe(mail.setMailRelay(req.params.domain, req.body, { skipVerify: false }));
if (error) return next(BoxError.toHttpError(error));