Skip to content

Conversation

octvs
Copy link
Contributor

@octvs octvs commented Aug 23, 2025

Add option programs.msmtp.offlineSupport which when enabled delegates the usage of msmtp to msmtpq script. This is achieved by an internal option msmtpCommand which should be called when msmtp is used by another module.

Resolves #2933.

Description

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.

  • Code tested through nix run .#tests -- test-all or
    nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

@octvs octvs force-pushed the msmtp-add-command-option branch from 93b0e9e to 2b5c707 Compare August 23, 2025 11:49
Add option `programs.msmtp.offlineSupport` which when enabled delegates
the usage of `msmtp` to `msmtpq` script. This is achieved by an internal
option `msmtpCommand` which should be called when `msmtp` is used by
another module.
@octvs octvs force-pushed the msmtp-add-command-option branch from 2b5c707 to 8edccd4 Compare August 23, 2025 11:50
@octvs
Copy link
Contributor Author

octvs commented Aug 25, 2025

There are two concerns that I see on this. First is to generalize the msmtpCommand variable introduced here to be a account-wide accounts.email.accounts.<name>.sendMailCommand as in the modules of alot and astroid, where the newly introduced account-wide variable can fill as the default of submodules (i.e. alot and astroid).

Another is to whether to include necessary flags, --read-envelope-from --read-recipients, to be part of the command. msmtpq script by itself doesn't work as a command without these flags, which is supported by the fact that everywhere that it is used, it is accompanied by them.

Would be great to hear other opinions, so that we reduce the chance to break other workflows.

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

Successfully merging this pull request may close these issues.

Provide option to use msmtpq wrapper script instead of msmtp
2 participants