Haraka icon indicating copy to clipboard operation
Haraka copied to clipboard

double hook invocation

Open celesteking opened this issue 8 months ago • 0 comments

Assume there's a plugin that's hooking up connect and returning DENY. Assume there's a second plugin that tarpits quit.

Then, connect hook would switch connection.state into LOOP. Client would send QUIT once, then would send another QUIT while there's a tarpit active, which will lead to double hook invocation and a crash.

    connect_respond (retval, msg) {
            case constants.deny:
                this.loop_respond(554, msg || "Your mail is not welcome here");
                break;
// --snip--
    loop_respond (code, msg) {
        if (this.state >= states.DISCONNECTING) return;
        this.state = states.LOOP;
// --snip--
     else if (this.state === states.LOOP) {
            // Allow QUIT
            if (this.current_line.toUpperCase() === 'QUIT') {
                this.cmd_quit();

celesteking avatar May 31 '24 21:05 celesteking