2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
options.msmtp = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable msmtp.
|
2023-08-08 10:19:01 +00:00
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
If enabled then it is possible to use the
|
2023-08-08 10:19:01 +00:00
|
|
|
`--account` command line
|
2020-10-12 00:22:58 +00:00
|
|
|
option to send a message for a given account using the
|
2023-08-08 10:19:01 +00:00
|
|
|
{command}`msmtp` or {command}`msmtpq` tool.
|
|
|
|
For example, {command}`msmtp --account=private` would
|
2020-10-12 00:22:58 +00:00
|
|
|
send using the account defined in
|
2023-08-08 10:19:01 +00:00
|
|
|
{option}`accounts.email.accounts.private`. If the
|
|
|
|
`--account` option is not
|
2020-10-12 00:22:58 +00:00
|
|
|
given then the primary account will be used.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
tls.fingerprint = mkOption {
|
|
|
|
type =
|
|
|
|
types.nullOr (types.strMatching "([[:alnum:]]{2}:)+[[:alnum:]]{2}");
|
|
|
|
default = null;
|
|
|
|
example = "my:SH:a2:56:ha:sh";
|
|
|
|
description = ''
|
|
|
|
Fingerprint of a trusted TLS certificate.
|
|
|
|
The fingerprint can be obtained by executing
|
2023-08-08 10:19:01 +00:00
|
|
|
{command}`msmtp --serverinfo --tls --tls-certcheck=off`.
|
2020-10-12 00:22:58 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = mkOption {
|
|
|
|
type = types.attrsOf types.str;
|
|
|
|
default = { };
|
|
|
|
example = { auth = "login"; };
|
|
|
|
description = ''
|
2023-08-08 10:19:01 +00:00
|
|
|
Extra configuration options to add to {file}`~/.msmtprc`.
|
|
|
|
See <https://marlam.de/msmtp/msmtprc.txt> for
|
2020-10-12 00:22:58 +00:00
|
|
|
examples.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|