-
Notifications
You must be signed in to change notification settings - Fork 30
Run alternate qmail-remote by setting QMAILREMOTE. #46
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
Conversation
This one is intended for our "Introduce new programming interfaces for use by extensions" release. The implementation may change depending on how we implement the "FHS-strict" option of #2 (no problem, that's scheduled for 1.08). |
I have done something similar in indimail-mta in qmail-lspawn.c and qmail-rspawn.c by setting QMAILLOCAL and QMAILREMOTE. Instead of calling qmail-local / qmail-remote, I call a program called spawn-filter which can run user defined filters and the output of that gets passed to qmail-local, qmail-remote. @schmonz, take a look at qmail-rspawn.c, qmail-lspawn.c and spawn-filter.c. I use it mainly for DKIM. |
@mbhangui, that sounds more generalized than what I've done here, and might be preferable. Would you be willing to submit a PR with it? No hurry whatsoever, this would be for a couple releases after 1.07. |
Sure. I will also make the change that @DerDakon suggested and remove all indimail related changes. The change will add a control file named /var/qmail/control/filterargs where one can specify filters indimail.org:remote:/usr/bin/dk-filter will cause all emails sent to indimail.org, get filtered through the the program /usr/bin/dk-filter. The program /usr/bin/dk-filter will just take the original email on stdin and print the email on stdout with the DKIM-Signature added. This output will be sent to qmail-remote. |
If this becomes code like this: const char *qrprogram()
{
static const char *qrprog;
if (qrprog != NULL)
return qrprog;
…
} then it does not need to be in main as it will be only on if call per scheduled mail, regardless which binary will finally be called. |
@schmonz I have done the changes. spawn-filter.c and wildmat.c will require a good review. How do I put it here? Do I use this same branch alternate-qmailremote and add changes (this is what I have done now, but I have not committed or pushed the changes) Following will be the changes
|
@mbhangui, I think we'll want to be able to look at all our options for how to solve this problem. (We did this for DESTDIR. One PR got merged, and the rest closed.) So please create a new PR on a new branch, with the name not being terribly important because it won't stick around forever. When I see the PR land, I'll reference it from this one. Thanks! |
335ec81
to
e751849
Compare
This is like the QMAILQUEUE patch, but for qmail-remote(8). With this change, on a system wherein qmail-start's environment... - has QMAILREMOTE set: it's invoked by qmail-rspawn(8) instead of "qmail-remote" - has QMAILREMOTE unset: no change in behavior A QMAILREMOTE program must take care to adhere to the qmail-remote(8) interface. It can wrap the original, concluding its work by running qmail-remote, or it can be a full replacement. Supports goals: "Adding interfaces and seams, where needed, to make extensions possible" Broaches non-goals: none known Risks: none known
e751849
to
175529d
Compare
Should I click on the "Rebase and Merge". The branch has no conflicts. |
That would work, but I'd like to see some comparative opinions on your #50 before we decide what to merge for 1.08. :-) |
|
If you agree #50 is better for later (perhaps 1.9), then I'm happy having you merge this one! |
This is like the QMAILQUEUE patch, but for qmail-remote(8).
With this change, on a system wherein qmail-start's environment...
has QMAILREMOTE set: it's invoked by qmail-rspawn(8) instead of
"qmail-remote"
has QMAILREMOTE unset: no change in behavior
A QMAILREMOTE program must take care to adhere to the qmail-remote(8)
interface. It can wrap the original, concluding its work by running
qmail-remote, or it can be a full replacement.
Supports goals: "Adding interfaces and seams, where needed, to make extensions possible"
Broaches non-goals: none known
Risks: none known