Unverified Commit 4a2f53b6 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #280940 from e1mo/fix-parsedmarc-smtp-to

parents 33489534 896919de
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -301,7 +301,7 @@ in
              description = ''
                The addresses to send outgoing mail to.
              '';
              apply = x: if x == [] then null else lib.concatStringsSep "," x;
              apply = x: if x == [] || x == null then null else lib.concatStringsSep "," x;
            };
          };

@@ -438,7 +438,7 @@ in
            ];
        dashboards.settings.providers = lib.mkIf cfg.provision.grafana.dashboard [{
          name = "parsedmarc";
          options.path = "${pkgs.python3Packages.parsedmarc.dashboard}";
          options.path = "${pkgs.parsedmarc.dashboard}";
        }];
      };
    };
@@ -446,7 +446,7 @@ in
    services.parsedmarc.settings = lib.mkMerge [
      (lib.mkIf cfg.provision.elasticsearch {
        elasticsearch = {
          hosts = [ "localhost:9200" ];
          hosts = [ "http://localhost:9200" ];
          ssl = false;
        };
      })
@@ -530,7 +530,7 @@ in
            MemoryDenyWriteExecute = true;
            LockPersonality = true;
            SystemCallArchitectures = "native";
            ExecStart = "${pkgs.python3Packages.parsedmarc}/bin/parsedmarc -c /run/parsedmarc/parsedmarc.ini";
            ExecStart = "${lib.getExe pkgs.parsedmarc} -c /run/parsedmarc/parsedmarc.ini";
          };
        };

+41 −0
Original line number Diff line number Diff line
{ lib
, python3
, fetchFromGitHub
}:

let
  python = python3.override {
    packageOverrides = self: super: {
      # https://github.com/domainaware/parsedmarc/issues/464
      msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec {
        version = "0.2.2";

        src = fetchFromGitHub {
          owner = "microsoftgraph";
          repo = "msgraph-sdk-python-core";
          rev = "v${version}";
          hash = "sha256-eRRlG3GJX3WeKTNJVWgNTTHY56qiUGOlxtvEZ2xObLA=";
        };

        nativeBuildInputs = with self; [
          flit-core
        ];

        propagatedBuildInputs = with self; [
          requests
        ];

        nativeCheckInputs = with self; [
          pytestCheckHook
          responses
        ];

        disabledTestPaths = [
          "tests/integration"
        ];

        pythonImportsCheck = [ "msgraph.core" ];
      });
    };
  };
in with python.pkgs; toPythonApplication parsedmarc
+11 −8
Original line number Diff line number Diff line
@@ -24,11 +24,12 @@
, mailsuite
, msgraph-core
, nixosTests
, opensearch-py
, publicsuffixlist
, pythonOlder
, pythonRelaxDepsHook
, requests
, tqdm
, urllib3
, xmltodict
}:

@@ -50,14 +51,14 @@ buildPythonPackage rec {
    hash = "sha256-tK/cxOw50awcDAGRDTQ+Nxb9aJl2+zLZHuJq88xNmXM=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "elasticsearch<7.14.0" "elasticsearch" \
      --replace "elasticsearch-dsl==7.4.0" "elasticsearch-dsl"
  '';

  nativeBuildInputs = [
    hatchling
    pythonRelaxDepsHook
  ];

  pythonRelaxDeps = [
    "elasticsearch"
    "elasticsearch-dsl"
  ];

  propagatedBuildInputs = [
@@ -84,8 +85,8 @@ buildPythonPackage rec {
    publicsuffixlist
    requests
    tqdm
    urllib3
    xmltodict
    opensearch-py
  ];

  # no tests on PyPI, no tags on GitHub
@@ -108,5 +109,7 @@ buildPythonPackage rec {
    license = licenses.asl20;
    maintainers = with maintainers; [ talyz ];
    mainProgram = "parsedmarc";
    # https://github.com/domainaware/parsedmarc/issues/464
    broken = lib.versionAtLeast msgraph-core.version "1.0.0";
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -40014,8 +40014,6 @@ with pkgs;
  OSCAR = qt5.callPackage ../applications/misc/OSCAR { };
  parsedmarc = with python3Packages; toPythonApplication parsedmarc;
  pgmanage = callPackage ../applications/misc/pgmanage { };
  pgadmin4 = callPackage ../tools/admin/pgadmin { };