haraka / haraka/haraka-plugin-rcpt-postgresql
Only local part is checked
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
While this is probably ok in normal or single domain configurations or is what most people typically need, I'd suggest adding a configuration option that instructs the plugin on what to ask the db for.
You have:
this.is_user_valid(rcpt.user, function (isValid) {
Which only gathers the user (local part) of the receipient. In my case, supporting multiple domains, I needed it to match the entire email address and did the following:
this.is_user_valid(rcpt.user.concat('@').concat(rcpt.host), function (isValid) {
There is probably a better way to do this than concatenating but I was just doing the quickest thing possible to get it working.
I'd suggest the configuration variable be named "use_localpart_only" and when false it uses the entirety of the email address instead of just the local part.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the recipient-validation code containing this.is_user_valid(rcpt.user, ...), then inspect how plugin configuration is read and how the PostgreSQL lookup is built. Add the requested use_localpart_only option so the lookup can use either the local part or the full email address, and verify both paths with the available tests or a local database setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, postgresql
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100