// discard

exports.register = function () {
    this.register_hook('queue','discard');
    this.register_hook('queue_outbound', 'discard');
}

exports.discard = function (next, connection) {
    var transaction = connection.transaction;
    if (connection.notes.discard || transaction.notes.discard) {
        connection.loginfo(this, 'discarding message');
        // Pretend we delivered the message
        return next(OK);
    }
    // Allow other queue plugins to deliver
    return next();
}

@@ -69,16 +69,17 @@
 'queue',
+ 
 'discard
@@ -428,16 +428,94 @@
 ;%0A    %7D%0A
+%0A    if (process.env.YES_REALLY_DO_DISCARD) %7B%0A        return next(OK);%0A    %7D%0A%0A
     // A

add ENV that permits discarding