haraka-plugin-wildduck
Advanced tools
Comparing version 1.0.0 to 1.0.1
21
index.js
@@ -39,2 +39,4 @@ /* eslint-env es6 */ | ||
plugin.database = database; | ||
plugin.usersdb = plugin.cfg.mongo.users ? database.db(plugin.cfg.mongo.users) : database; | ||
plugin.gridfsdb = plugin.cfg.mongo.gridfs ? database.db(plugin.cfg.mongo.gridfs) : database; | ||
next(); | ||
@@ -79,3 +81,3 @@ }); | ||
// check if address exists | ||
plugin.database.collection('addresses').findOne({ | ||
plugin.usersdb.collection('addresses').findOne({ | ||
address | ||
@@ -91,3 +93,3 @@ }, (err, addressObj) => { | ||
// load user for quota checks | ||
plugin.database.collection('users').findOne({ | ||
plugin.usersdb.collection('users').findOne({ | ||
_id: addressObj.user | ||
@@ -97,3 +99,4 @@ }, { | ||
quota: true, | ||
storageUsed: true | ||
storageUsed: true, | ||
disabled: true | ||
} | ||
@@ -109,4 +112,12 @@ }, (err, user) => { | ||
if (user.quota && user.storageUsed && user.quota <= user.storageUsed) { | ||
// can not deliver mail to this user | ||
if (user.disabled) { | ||
// user is disabled for whatever reason | ||
return next(DENY, DSN.mbox_disabled()); | ||
} | ||
// max quota for the user | ||
let quota = user.quota || Number(plugin.cfg.maxStorage) * 1024; | ||
if (user.storageUsed && quota <= user.storageUsed) { | ||
// can not deliver mail to this user, over quota | ||
return next(DENY, DSN.mbox_full()); | ||
@@ -113,0 +124,0 @@ } |
{ | ||
"name": "haraka-plugin-wildduck", | ||
"version": "1.0.0", | ||
"description": "Haraka plugin for processing incoming messages for Wild Duck IMAP server", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/wildduck-email/haraka-plugin-wildduck.git" | ||
}, | ||
"keywords": [ | ||
"MX", | ||
"SMTP", | ||
"Haraka", | ||
"Wild", | ||
"Duck", | ||
"IMAP", | ||
"LMTP" | ||
], | ||
"author": "Andris Reinman", | ||
"license": "EUPL-1.1", | ||
"bugs": { | ||
"url": "https://github.com/wildduck-email/haraka-plugin-wildduck/issues" | ||
}, | ||
"homepage": "https://github.com/wildduck-email/haraka-plugin-wildduck#readme", | ||
"devDependencies": { | ||
"eslint": "^3.19.0", | ||
"eslint-config-nodemailer": "^1.0.0", | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-eslint": "^19.0.0" | ||
}, | ||
"dependencies": { | ||
"mongodb": "^2.2.28" | ||
} | ||
"name": "haraka-plugin-wildduck", | ||
"version": "1.0.1", | ||
"description": "Haraka plugin for processing incoming messages for Wild Duck IMAP server", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/nodemailer/haraka-plugin-wildduck.git" | ||
}, | ||
"keywords": ["MX", "SMTP", "Haraka", "Wild", "Duck", "IMAP", "LMTP"], | ||
"author": "Andris Reinman", | ||
"license": "EUPL-1.1", | ||
"bugs": { | ||
"url": "https://github.com/nodemailer/haraka-plugin-wildduck/issues" | ||
}, | ||
"homepage": "https://github.com/nodemailer/haraka-plugin-wildduck#readme", | ||
"devDependencies": { | ||
"eslint": "^4.3.0", | ||
"eslint-config-nodemailer": "^1.2.0", | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-eslint": "^20.0.0" | ||
}, | ||
"dependencies": { | ||
"mongodb": "^2.2.30" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18555
113
Updatedmongodb@^2.2.30