mail: add option to force from address for relays
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user