1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

neomutt: allow default email sending behaviour (#7476)

If neither neomutt.sendMailCommand nor passCmd are set, leave
configuration for sending emails unset.  This will leave neomutt to
manage sending emails itself, which matches the existing description of
the `accounts.email.accounts.<name>.neomutt.sendMailCommand`
configuration option.

This also removes the assertion added in bd680a8c (neomutt: allow
default email sending behaviour, 2025-07-12), since it is now valid to
have neither passCmd nor neomutt.sendMailCommand on an account.
This commit is contained in:
Adam Dinwoodie 2025-07-21 22:12:28 +01:00 committed by GitHub
parent 13a83d1b65
commit e4bf85da68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -223,7 +223,7 @@ let
{
sendmail = "'${neomutt.sendMailCommand}'";
}
else
else if passwordCommand != null then
let
smtpProto = if smtp.tls.enable && !smtp.tls.useStartTls then "smtps" else "smtp";
smtpPort = if smtp.port != null then ":${toString smtp.port}" else "";
@ -232,7 +232,9 @@ let
{
smtp_url = "'${smtpBaseUrl}'";
smtp_pass = ''"`${passCmd}`"'';
};
}
else
{ };
genAccountConfig =
account:
@ -537,17 +539,12 @@ in
);
};
assertions =
[
{
assertion = ((filter (b: (lib.length (lib.toList b.map)) == 0) (cfg.binds ++ cfg.macros)) == [ ]);
message = "The 'programs.neomutt.(binds|macros).map' list must contain at least one element.";
}
]
++ lib.mapAttrsToList (n: a: {
assertion = a.neomutt.sendMailCommand != null || a.passwordCommand != null;
message = "'accounts.email.accounts.${n}' needs either 'neomutt.sendMailCommand' or 'passwordCommand' set.";
}) neomuttAccountsCfg;
assertions = [
{
assertion = ((filter (b: (lib.length (lib.toList b.map)) == 0) (cfg.binds ++ cfg.macros)) == [ ]);
message = "The 'programs.neomutt.(binds|macros).map' list must contain at least one element.";
}
];
warnings =
let