nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.28k stars 1.68k forks source link

bug: neomutt silently requires smtp.tls.enable or smtp.tls.useStartTls #4869

Open jedesroches opened 5 months ago

jedesroches commented 5 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Hi, thank you for your work on the neomutt home-manager module!

When setting up email using neomutt only as a MUA, the neomutt module requires one of smtp.tls.enable or smtp.tls.useStartTls to be set. This is:

1) Not documented anywhere and, if the behavior is kept, should be documented 1) Not validated by an assertion, and so the error message that the user gets (error: value is null while a set was expected) is pretty obscure and some source code reading is required to figure out what went wrong 1) This is probably not the desired behavior anyway, since if neomutt is only used as an MUA and other programs are used for IMAP and SMTP (which is the setup I'm going for), then neomutt should not care for TLS or any sort of network connection.

I believe this is a bug that was introduced in the last commit.

Minimal example to reproduce:

{ config, ... }:

{
  home-manager.users.${config.user} = {

    programs = { neomutt.enable = true; };

    accounts.email = {
      accounts.mymailaccount = {
        primary = true;
        neomutt = {
          enable = true;
          sendMailCommand = ''echo "Mail sending is disabled on this host"'';
        };
      };
    };
  };

Maintainer CC

@fpletz @rycee

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.69, NixOS, 23.11 (Tapir), 23.11.2561.b0b2c5445c64`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos
fmahnke commented 5 months ago

I just started using home-manager and came across this yesterday. I wrote a patch and came here to find the issue was already open. The patch allows the neomutt configuration to build when either or both of accounts.email.accounts.<name>.passwordCommand and accounts.email.accounts<name>.smtp are at their default null values. Does this seem like a good approach?

stale[bot] commented 2 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

jedesroches commented 3 weeks ago

@fmahnke : I guess you could open a PR with the patch maybe ?