Giter VIP home page Giter VIP logo

Comments (4)

msimerson avatar msimerson commented on June 26, 2024

Any ideas why?

Yes, remove the line with the bare return; Hooks must always call next when they're completed. If not, they get timed out after 30 seconds.

Improved:

exports.hook_rcpt = function (next, connection, params) {
    const rcpt = params[0];
    const address = rcpt.address();

    const dropPattern = /^foo.*@mailsac\.com$/i;

    if (dropPattern.test(address)) {
       connection.loginfo(this, `Dropping message to: ${address}`);
    }

    next();
}

from haraka.

gminogiannis avatar gminogiannis commented on June 26, 2024

Thank you @msimerson for the prompt response.
Nevertheless, the purpose of the custom plugin is to silently drop a message if the recipient conforms to the pattern foo*@mailsac.com

Your suggestion appends a log entry that a message is to be dropped, but it isn't (it's "promoted" to the next chain of commands and reaches the wildduck plugin).
As mentioned in the original comment, the purpose of the plugin is to conditionally skip WildDuck.

Can you help ?

from haraka.

msimerson avatar msimerson commented on June 26, 2024

You asked why it paused for 30 seconds. I answered your question.

To change what Haraka does when you call next, look into next return codes

from haraka.

gminogiannis avatar gminogiannis commented on June 26, 2024

Thank you for pointing me to the proper section of the documentation.

For anyone encountering this thread, the solution was to use next(OK) in case the recipient's address matched the pattern.
Quoting from the documentation:

After a plugin calls next(OK), no further plugins on that hook will run.

from haraka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.