// backscatterer plugin

exports.register = function () {
    this.inherits('dns_list_base');
};

exports.hook_mail = function (next, connection, params) {
    const user = ((params[0] && params[0].user) ?
        params[0].user.toLowerCase() : null);
    if (!(!user || user === 'postmaster')) return next();
    // Check remote IP on ips.backscatterer.org
    const plugin = this;

    function resultCb (err, zone, a) {
        if (err) {
            connection.logerror(plugin, err);
            return next();
        }
        if (!a) return next();
        const msg = 'Host ' + connection.remote.host +
                  ' [' + connection.remote.ip + ']' +
                  ' is blacklisted by ' + zone;
        return next(DENY, msg);
    }

    this.first(connection.remote.ip, [ 'ips.backscatterer.org' ], resultCb);
};

@@ -573,18 +573,16 @@
 g = 
-'
+%60
 Host 
-' + 
+$%7B
 conn
@@ -603,84 +603,35 @@
 host
- +%0A                  ' %5B' + connection.remote.ip + '%5D' +%0A                  '
+%7D %5B$%7Bconnection.remote.ip%7D%5D
  is 
@@ -649,16 +649,16 @@
  by 
-' + 
+$%7B
 zone
+%7D%60
 ;%0A  

update plugins/backscatterer.js with es6 literals (#2261)