mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
nixos/parsedmarc: follow upstream configuration
> Starting in version 8.0.0, most options from the `imap` section have
been moved to the `mailbox` section.
6b2131f0e8
This commit is contained in:
parent
44cee687b5
commit
59c28cab1c
@ -17,7 +17,6 @@ services.parsedmarc = {
|
||||
host = "imap.example.com";
|
||||
user = "alice@example.com";
|
||||
password = "/path/to/imap_password_file";
|
||||
watch = true;
|
||||
};
|
||||
provision.geoIp = false; # Not recommended!
|
||||
};
|
||||
|
@ -123,7 +123,10 @@ in
|
||||
host = "imap.example.com";
|
||||
user = "alice@example.com";
|
||||
password = { _secret = "/run/keys/imap_password" };
|
||||
};
|
||||
mailbox = {
|
||||
watch = true;
|
||||
batch_size = 30;
|
||||
};
|
||||
splunk_hec = {
|
||||
url = "https://splunkhec.example.com";
|
||||
@ -170,6 +173,24 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
mailbox = {
|
||||
watch = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = lib.mdDoc ''
|
||||
Use the IMAP IDLE command to process messages as they arrive.
|
||||
'';
|
||||
};
|
||||
|
||||
delete = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Delete messages after processing them, instead of archiving them.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
imap = {
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@ -216,22 +237,6 @@ in
|
||||
'';
|
||||
apply = x: if isAttrs x || x == null then x else { _secret = x; };
|
||||
};
|
||||
|
||||
watch = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = lib.mdDoc ''
|
||||
Use the IMAP IDLE command to process messages as they arrive.
|
||||
'';
|
||||
};
|
||||
|
||||
delete = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Delete messages after processing them, instead of archiving them.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
smtp = {
|
||||
@ -360,6 +365,13 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
warnings = let
|
||||
deprecationWarning = optname: "Starting in 8.0.0, the `${optname}` option has been moved from the `services.parsedmarc.settings.imap`"
|
||||
+ "configuration section to the `services.parsedmarc.settings.mailbox` configuration section.";
|
||||
hasImapOpt = lib.flip builtins.hasAttr cfg.settings.imap;
|
||||
movedOptions = [ "reports_folder" "archive_folder" "watch" "delete" "test" "batch_size" ];
|
||||
in builtins.map deprecationWarning (builtins.filter hasImapOpt movedOptions);
|
||||
|
||||
services.elasticsearch.enable = lib.mkDefault cfg.provision.elasticsearch;
|
||||
|
||||
services.geoipupdate = lib.mkIf cfg.provision.geoIp {
|
||||
@ -444,6 +456,8 @@ in
|
||||
ssl = false;
|
||||
user = cfg.provision.localMail.recipientName;
|
||||
password = "${pkgs.writeText "imap-password" "@imap-password@"}";
|
||||
};
|
||||
mailbox = {
|
||||
watch = true;
|
||||
};
|
||||
})
|
||||
|
@ -15,14 +15,13 @@
|
||||
email address and saves them to a local Elasticsearch instance
|
||||
looks like this:
|
||||
</para>
|
||||
<programlisting language="bash">
|
||||
<programlisting>
|
||||
services.parsedmarc = {
|
||||
enable = true;
|
||||
settings.imap = {
|
||||
host = "imap.example.com";
|
||||
user = "alice@example.com";
|
||||
password = "/path/to/imap_password_file";
|
||||
watch = true;
|
||||
};
|
||||
provision.geoIp = false; # Not recommended!
|
||||
};
|
||||
@ -45,7 +44,7 @@ services.parsedmarc = {
|
||||
email address that should be configured in the domain’s dmarc
|
||||
policy is <literal>dmarc@monitoring.example.com</literal>.
|
||||
</para>
|
||||
<programlisting language="bash">
|
||||
<programlisting>
|
||||
services.parsedmarc = {
|
||||
enable = true;
|
||||
provision = {
|
||||
@ -68,7 +67,7 @@ services.parsedmarc = {
|
||||
Elasticsearch instance is automatically added as a Grafana
|
||||
datasource, and the dashboard is added to Grafana as well.
|
||||
</para>
|
||||
<programlisting language="bash">
|
||||
<programlisting>
|
||||
services.parsedmarc = {
|
||||
enable = true;
|
||||
provision = {
|
||||
|
@ -155,7 +155,6 @@ in
|
||||
ssl = true;
|
||||
user = "alice";
|
||||
password = "${pkgs.writeText "imap-password" "foobar"}";
|
||||
watch = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user