Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable validation of SMTP recipients #49

Open
schmonz opened this issue Jul 28, 2019 · 3 comments · May be fixed by #233
Open

Configurable validation of SMTP recipients #49

schmonz opened this issue Jul 28, 2019 · 3 comments · May be fixed by #233
Labels
enhancement New feature or request
Milestone

Comments

@schmonz
Copy link
Member

schmonz commented Jul 28, 2019

In 1.9 or so, we'll add Paweł Foremski's qmail-spp to qmail-smtpd. It's a very general-purpose API. Programs can very easily influence just about any SMTP behavior. Admins control which programs run for which events in control/smtpplugins.

qmail-spp is not the only patch that adds enough API to do recipient checking. A much simpler API, specific for this purpose, is Jay Soffian's RCPTCHECK.

Since RCPTCHECK is a subset of qmail-spp, we can easily support both APIs. In my rejectutils, qmail-rcptcheck runs the sequence of RCPTCHECK-compatible programs in control/rcptchecks, rejecting if any of them reject. (It runs under qmail-smtpd with either the RCPTCHECK patch or the qmail-spp patch, though only the latter is important for us here.)

rejectutils also includes several RCPTCHECK-compatible programs, repackaged from familiar SMTP recipient validation patches:

(There are a couple other programs in rejectutils that may be interesting for notqmail, but probably not for this precise issue.)

rejectutils does not include every SMTP recipient validator anyone might want. That's fine, because qmail-spp provides hooks for every SMTP everything anyone might want, and we plan to freely accept extensions.

@schmonz schmonz added the enhancement New feature or request label Jul 29, 2019
@schmonz
Copy link
Member Author

schmonz commented Jul 31, 2019

Andrew Richards's qmail-verify is a practical improvement on realrcptto: the recipient-validation logic moves into a new service that runs as root, so it produces more accurate results than qmaild can. I should probably add a qmail-rcptcheck-verify program to rejectutils.

Wild speculation about config: when we have extensions, it might be sensible for us to ship the qmail-verify daemon and recommend enabling qmail-rcptcheck-verify. It's qmail's own delivery logic, after all.

Wild speculation about design: maybe we can avoid duplicating the logic. Instead, extract the originals to objects that can be linked into their original call sites and also into qmail-verify.

Caveat: though realrcptto has been made to work with qmail-qmtpd, qmail-verify has not, as yet.

@DerDakon
Copy link
Member

DerDakon commented Oct 4, 2019

I have patches at my qmail patch site that do that verification if you use vpopmail and have the users in the filesystem (in contrast to a database). Similar code is in Qsmtpd which I have in production for more than a decade and it just works. It detects the .qmail-default catchalls and rejects, and it also works with sub-addresses of users. I'm not 100% sure for the naked qmail patch, but that can probably be adapted to the latest code I have in Qsmtp.

@schmonz schmonz added this to the 1.09 milestone May 25, 2020
@schmonz
Copy link
Member Author

schmonz commented May 25, 2020

I think we can ship a decent solution relatively cheaply by repurposing existing code, so I’m suggesting this as one of the small number of new features for 1.09 and will submit a PR soonish.

@schmonz schmonz linked a pull request Feb 5, 2022 that will close this issue
@schmonz schmonz modified the milestones: 1.09, 1.90 Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants