updated address handling

This commit is contained in:
Andris Reinman 2018-01-24 16:31:37 +02:00
parent 261f28c15c
commit c35b719611
2 changed files with 21 additions and 18 deletions

View file

@ -297,8 +297,7 @@ module.exports = (db, server) => {
name: Joi.string()
.empty('')
.trim()
.max(128)
.required(),
.max(128),
main: Joi.boolean()
.truthy(['Y', 'true', 'yes', 'on', 1])
.falsy(['N', 'false', 'no', 'off', 0, '']),

View file

@ -549,14 +549,16 @@ module.exports = (db, server) => {
.lowercase()
.length(24)
.empty(''),
targets: Joi.array().items(
Joi.string().email(),
Joi.string().uri({
scheme: [/smtps?/, /https?/],
allowRelative: false,
relativeOnly: false
})
)
targets: Joi.array()
.items(
Joi.string().email(),
Joi.string().uri({
scheme: [/smtps?/, /https?/],
allowRelative: false,
relativeOnly: false
})
)
.empty('')
})
.required()
});
@ -869,14 +871,16 @@ module.exports = (db, server) => {
.lowercase()
.length(24)
.empty(''),
targets: Joi.array().items(
Joi.string().email(),
Joi.string().uri({
scheme: [/smtps?/, /https?/],
allowRelative: false,
relativeOnly: false
})
)
targets: Joi.array()
.items(
Joi.string().email(),
Joi.string().uri({
scheme: [/smtps?/, /https?/],
allowRelative: false,
relativeOnly: false
})
)
.empty('')
})
});