mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-04 07:02:45 +08:00
Allow empty targets
This commit is contained in:
parent
58b6bf2999
commit
33287d57ed
1 changed files with 8 additions and 10 deletions
|
@ -998,7 +998,7 @@ module.exports = (db, server) => {
|
|||
* }
|
||||
*
|
||||
* @apiParam {String} address E-mail Address
|
||||
* @apiParam {String[]} targets An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25")
|
||||
* @apiParam {String[]} [targets] An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25")
|
||||
* @apiParam {Number} [forwards] Daily allowed forwarding count for this address
|
||||
* @apiParam {Boolean} [allowWildcard=false] If <code>true</code> then address value can be in the form of <code>*@example.com</code>, otherwise using * is not allowed
|
||||
* @apiParam {Object} [autoreply] Autoreply information
|
||||
|
@ -1049,14 +1049,12 @@ module.exports = (db, server) => {
|
|||
.required(),
|
||||
Joi.string().regex(/^\w+@\*$/, 'special address')
|
||||
],
|
||||
targets: Joi.array()
|
||||
.items(
|
||||
Joi.string().email(),
|
||||
Joi.string().uri({
|
||||
scheme: [/smtps?/, /https?/]
|
||||
})
|
||||
)
|
||||
.min(1),
|
||||
targets: Joi.array().items(
|
||||
Joi.string().email(),
|
||||
Joi.string().uri({
|
||||
scheme: [/smtps?/, /https?/]
|
||||
})
|
||||
),
|
||||
forwards: Joi.number()
|
||||
.min(0)
|
||||
.default(0),
|
||||
|
@ -1102,7 +1100,7 @@ module.exports = (db, server) => {
|
|||
let address = tools.normalizeAddress(result.value.address);
|
||||
let addrview = address.substr(0, address.indexOf('@')).replace(/\./g, '') + address.substr(address.indexOf('@'));
|
||||
|
||||
let targets = result.value.targets;
|
||||
let targets = result.value.targets || [];
|
||||
let forwards = result.value.forwards;
|
||||
|
||||
if (result.value.autoreply) {
|
||||
|
|
Loading…
Reference in a new issue