Merge 2e339cc6da
into 6d3b6dc922
This commit is contained in:
commit
f5df367129
|
@ -407,7 +407,10 @@ in {
|
|||
mkIf smtp.tls.enable (toString smtp.tls.certificatesFile);
|
||||
smtpServer = smtp.host;
|
||||
smtpUser = userName;
|
||||
from = address;
|
||||
from = if (builtins.stringLength realName == 0) then
|
||||
address
|
||||
else
|
||||
"${realName} <${address}>";
|
||||
} // optionalAttrs (smtp.port != null) {
|
||||
smtpServerPort = smtp.port;
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
smtpUser = "home.manager.jr"
|
||||
|
||||
[sendemail "hm@example.com"]
|
||||
from = "hm@example.com"
|
||||
from = "H. M. Test <hm@example.com>"
|
||||
smtpEncryption = "ssl"
|
||||
smtpServer = "smtp.example.com"
|
||||
smtpSslCertPath = "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
|
|
@ -6,8 +6,10 @@ with lib;
|
|||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
accounts.email.accounts.hm-account.smtp.tls.certificatesFile =
|
||||
"/etc/test/certificates.crt";
|
||||
accounts.email.accounts.hm-account = {
|
||||
smtp.tls.certificatesFile = "/etc/test/certificates.crt";
|
||||
realName = mkForce "";
|
||||
};
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitMinimal;
|
||||
|
@ -33,7 +35,7 @@ with lib;
|
|||
./git-with-email-expected.conf
|
||||
}
|
||||
|
||||
assertGitConfig "sendemail.hm@example.com.from" "hm@example.com"
|
||||
assertGitConfig "sendemail.hm@example.com.from" "H. M. Test <hm@example.com>"
|
||||
assertGitConfig "sendemail.hm-account.from" "hm@example.org"
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[sendemail "hm-account"]
|
||||
from = "hm@example.org"
|
||||
from = "H. M. Test Jr. <hm@example.org>"
|
||||
smtpEncryption = "tls"
|
||||
smtpServer = "smtp.example.org"
|
||||
smtpSslCertPath = "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
|
|
@ -6,7 +6,11 @@ with lib;
|
|||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
accounts.email.accounts."hm@example.com".msmtp.enable = true;
|
||||
accounts.email.accounts."hm@example.com" = {
|
||||
msmtp.enable = true;
|
||||
realName = mkForce "";
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitMinimal;
|
||||
|
@ -34,7 +38,7 @@ with lib;
|
|||
${./git-with-msmtp-expected.conf}
|
||||
|
||||
assertGitConfig "sendemail.hm@example.com.from" "hm@example.com"
|
||||
assertGitConfig "sendemail.hm-account.from" "hm@example.org"
|
||||
assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. <hm@example.org>"
|
||||
assertGitConfig "sendemail.hm@example.com.smtpServer" "${pkgs.msmtp}/bin/msmtp"
|
||||
assertGitConfig "sendemail.hm@example.com.envelopeSender" "auto"
|
||||
'';
|
||||
|
|
Loading…
Reference in New Issue