Comments (4)
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.
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.
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.
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)
- release 3.0.4
- Outbound - Fallback to MX's IPv4 when the MX's IPv6 is bogus HOT 2
- 550 Envelope domain 'domain.com' doesn't match AUTH domain 'null' HOT 8
- Spamhause warning HOT 1
- Bounces not working for me HOT 6
- OutboundTLS/plugin-redis missing logerror HOT 5
- Error: no PRIVATE key in /opt/haraka/config/tls/dhparams.pem HOT 10
- Sender verficiation failed HOT 3
- [core] TypeError: Cannot read properties of undefined (reading 'name') HOT 1
- Custom tx.notes.outbound_helo not working HOT 3
- Race condition error: listen EACCES: permission denied ::0:25
- Old clients: SSL issue and no_tls_hosts HOT 5
- Mail not being delivered to wildduck HOT 1
- Inbound specific TLS configuration stopped working HOT 1
- Does haraka support PGP/GPG or S/MIME?
- Mutliple IPs and PTR HOT 1
- double hook invocation
- queryMx critical error
- How to customize Message-ID suffix HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haraka.