mail: Add tu-dreden account
Special thanks to whoever thought that a backslash in a user name is a good idea.
This commit is contained in:
parent
5bb1d42abe
commit
d66cf000b0
|
@ -78,6 +78,33 @@ in
|
|||
|
||||
signature.text = signaturePersonal;
|
||||
|
||||
aerc.enable = true;
|
||||
};
|
||||
tu-dresden = rec {
|
||||
realName = "Simon Bruder";
|
||||
address = "simon.bruder@mailbox.tu-dresden.de";
|
||||
|
||||
userName = "user\\sibr833e";
|
||||
passwordCommand = "pass web/tu-dresden.de | head -n 1";
|
||||
|
||||
imap = {
|
||||
host = "msx.tu-dresden.de";
|
||||
tls.useStartTls = true;
|
||||
};
|
||||
smtp = {
|
||||
host = "msx.tu-dresden.de";
|
||||
port = 587;
|
||||
tls.useStartTls = true;
|
||||
};
|
||||
|
||||
gpg = {
|
||||
key = config.programs.gpg.settings.default-key;
|
||||
signByDefault = true;
|
||||
encryptByDefault = true;
|
||||
};
|
||||
|
||||
signature.text = signaturePersonal;
|
||||
|
||||
aerc.enable = true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -19,7 +19,12 @@ in
|
|||
"aerc/accounts.conf".text = lib.generators.toINI { } (lib.mapAttrs
|
||||
# incomplete support for all configuration options!
|
||||
(name: accountConfig: with accountConfig; let
|
||||
quoteMailAddress = lib.replaceChars [ "@" ] [ "%40" ];
|
||||
quoteMailAddress = lib.replaceChars [ "@" "\\" ] [ "%40" "%5C" ];
|
||||
# home-manager has no way to set if an account requires AUTH LOGIN
|
||||
# this emulats this by setting a list of known providers that do require it
|
||||
requiresLogin = lib.elem
|
||||
(lib.elemAt (lib.strings.splitString "@" address) 1)
|
||||
[ "mailbox.tu-dresden.de" ];
|
||||
in
|
||||
{
|
||||
source =
|
||||
|
@ -31,7 +36,7 @@ in
|
|||
outgoing =
|
||||
if notmuch.enable
|
||||
then "${./msmtp-wrapper} ${name}"
|
||||
else "`smtp+plain://${quoteMailAddress userName}@${smtp.host}`";
|
||||
else "`smtp${lib.optionalString requiresLogin "+login"}://${quoteMailAddress userName}@${smtp.host}`";
|
||||
outgoing-cred-cmd = "`${lib.concatStringsSep " " passwordCommand}`";
|
||||
from = "${realName} <${address}>";
|
||||
smtp-starttls = if smtp.tls.useStartTls then "yes" else "no";
|
||||
|
|
Loading…
Reference in a new issue