mirror of
https://github.com/moparisthebest/mail
synced 2024-12-25 16:58:58 -05:00
bugfix email validation
This commit is contained in:
parent
ebbb16866a
commit
d2565df871
@ -240,14 +240,18 @@ app.dao.EmailDAO = function(_, crypto, devicestorage, cloudstorage, naclCrypto,
|
||||
var userId = this.account.get('emailAddress');
|
||||
|
||||
// validate email addresses
|
||||
var invalidRecipient;
|
||||
_.each(email.get('to'), function(address) {
|
||||
if (!validateEmail(address)) {
|
||||
callback({
|
||||
errMsg: 'Invalid recipient: ' + address
|
||||
});
|
||||
return;
|
||||
invalidRecipient = address;
|
||||
}
|
||||
});
|
||||
if (invalidRecipient) {
|
||||
callback({
|
||||
errMsg: 'Invalid recipient: ' + invalidRecipient
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!validateEmail(email.get('from'))) {
|
||||
callback({
|
||||
errMsg: 'Invalid sender: ' + email.from
|
||||
|
Loading…
Reference in New Issue
Block a user