Skip to content

Commit 55173fd

Browse files
committed
accounts/email: add protocol-specific userName options
Add optional userName fields to IMAP and SMTP submodules, allowing different usernames for IMAP and SMTP servers. When not specified, the account-level userName is used as a fallback. This change updates all email programs (mbsync, msmtp, offlineimap, getmail, neomutt, aerc, thunderbird, git) to use the protocol-specific username when available.
1 parent dff4330 commit 55173fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/programs/msmtp/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let
4545
}
4646
// msmtp.extraConfig
4747
)
48-
++ lib.optional primary "account default : ${name}"
48+
++ lib.optional primary "\naccount default : ${name}"
4949
++ map (alias: ''
5050
5151
account ${alias} : ${name}
@@ -130,10 +130,10 @@ in
130130
{
131131
home.packages = [ cfg.package ];
132132

133-
xdg.configFile."msmtp/config".text = cfg.configContent;
133+
xdg.configFile."msmtp/config".text = cfg.configContent + "\n";
134134

135135
programs.msmtp.configContent = lib.mkMerge [
136-
(lib.mkBefore "# Generated by Home Manager.")
136+
(lib.mkBefore "# Generated by Home Manager.\n")
137137
(lib.mkIf (cfg.extraConfig != "") (lib.mkBefore cfg.extraConfig))
138138
(lib.concatStringsSep "\n\n" (map accountStr msmtpAccounts))
139139
(lib.mkIf (cfg.extraAccounts != "") (lib.mkAfter cfg.extraAccounts))

0 commit comments

Comments
 (0)