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

Feature request: Local-only mode #121

Open
iskunk opened this issue Feb 14, 2023 · 4 comments
Open

Feature request: Local-only mode #121

iskunk opened this issue Feb 14, 2023 · 4 comments

Comments

@iskunk
Copy link

iskunk commented Feb 14, 2023

In my use case, I'd like to receive mail from system daemons / cron jobs / etc. but don't want to set up authentication for an external/third-party SMTP relay. Partly because the credentials could allow access to more than just SMTP relaying if they are ever leaked (see: Gmail) and also because nowadays, setting up a third-party e-mail service with simple non-2FA username + password authentication can be non-trivial, if even supported at all (see: also Gmail).

There is currently no good way to get this functionality, because if I leave SMARTHOST unset, or set it to a dummy destination (e.g. localhost) then dma will either attempt direct delivery (a quixotic task in today's world of spam-spewing home Internet connections) or keep retrying delivery for a long time.

This would effectively be the opposite of the NULLCLIENT directive. Any attempt to send to a remote destination, or to an alias that resolves to a remote destination, should fail immediately.

@corecode
Copy link
Owner

corecode commented Feb 16, 2023 via email

@iskunk
Copy link
Author

iskunk commented Feb 17, 2023

The code looks straightforward enough... I can try putting something together. I have a couple questions:

  • This option is basically a tri-state with NULLCLIENT, so the operating mode is one of (normal, nullclient, noremote). I think it would thus be desirable to name these in a more unified manner, so that they don't appear unrelated. Also, I'd argue that having option keywords in the negative form isn't ideal, and the meaning of "null client" isn't obvious. How about renaming NULLCLIENT to REMOTEONLY (while retaining recognition of the former), have this new one be LOCALONLY, and normal mode is the absence of either? Specifying both keywords would be an error.

  • Do I understand correctly that in NULLCLIENT mode, dma should send a message with only a local username to the smarthost? So it is expected that the smarthost will qualify/recognize that local name, and dma shouldn't return an error in such a case?

@corecode
Copy link
Owner

  • I like your proposal. We can also put the operating modes as arguments to a new DELIVERYMODE config key, e.g. DELIVERYMODE LOCALONLY; I'll leave it to you to decide what you prefer and which config key name you use.

  • I think so? Makes sense to me.

iskunk added a commit to iskunk/dma that referenced this issue Apr 23, 2023
This allows dma to support three modes of delivery: local-only,
remote-only, and local + remote (the default). It supersedes the
NULLCLIENT directive, which is equivalent to the remote-only mode.

Fixes: corecode#121
@iskunk
Copy link
Author

iskunk commented Apr 23, 2023

All right, my PR is up. Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants