Skip to content
Browse files

Added a mail from blocklist

  • Loading branch information...
1 parent 0cceec1 commit 802742604ff8696c78baee0ce489ad01a657049f @baudehlo baudehlo committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 plugins/mail_from.blocklist.js
View
11 plugins/mail_from.blocklist.js
@@ -0,0 +1,11 @@
+// Block mail from matching anything in the list
+var utils = require('./utils');
+
+exports.hook_mail = function (next, connection, params) {
+ var mail_from = params[0];
+ var list = this.config.get('mail_from.blocklist', 'list');
+ if (utils.in_array(mail_from, list)) {
+ return next(DENY, "Mail from you is not allowed here");
+ }
+ return next();
+}

0 comments on commit 8027426

Please sign in to comment.
Something went wrong with that request. Please try again.