Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added ^ and $ regex anchors.

  • Loading branch information...
commit e36762a362769e4512f672e61da997fd9925951e 1 parent 4ff2eea
@godsflaw godsflaw authored
View
8 config/host_list_regex
@@ -1,2 +1,6 @@
-# Add regexes in here we want to accept mail for. Please try to anchor
-# your regexes to reduce the chance of false matches.
+# Add regexes in here we want to accept mail for.
+# Specifies the list of regexes that are local to this server. Note
+# all these regexes are anchored with ^regex$. One can not choose not to
+# anchor with .* and that there is a good potential for bad regexes being
+# over permissive if we don't do this.
+
View
6 docs/plugins/rcpt_to.in_host_list.md
@@ -15,5 +15,7 @@ Configuration
* host_list_regex
- Specifies the list of regexes that are local to this server. Please
- try to always anchor your regexes to reduce the chance of false matches.
+ Specifies the list of regexes that are local to this server. Note
+ all these regexes are anchored with ^regex$. One can not choose not to
+ anchor with .* and that there is a good potential for bad regexes being
+ over permissive if we don\'t do this.
View
2  plugins/rcpt_to.in_host_list.js
@@ -34,7 +34,7 @@ exports.hook_rcpt = function(next, connection, params) {
this.logdebug("checking " + domain + " against " +
host_list_regex[i]);
- var regex = new RegExp (host_list_regex[i]);
+ var regex = new RegExp ('^' + host_list_regex[i] + '$');
// regex matches
if (domain.match(regex)) {
Please sign in to comment.
Something went wrong with that request. Please try again.