{ lib, buildPythonPackage, fetchPypi, pydns }:

buildPythonPackage rec {
  pname = "pyspf";
  version = "2.0.13";

  src = fetchPypi {
    inherit pname version;
    sha256 = "16wjj99d2pikz6z1gwnl1jjvad6qjgpsf3a85lh47qqrjpiipp32";
  };

  propagatedBuildInputs = [ pydns ];

  meta = with lib; {
    homepage = http://bmsi.com/python/milter.html;
    description = "Python API for Sendmail Milters (SPF)";
    maintainers = with maintainers; [ abbradar ];
    license = licenses.gpl2;
  };
}

{ lib, buildPythonPackage, fetchPypi, pydns }:

buildPythonPackage rec {
  pname = "pyspf";
  version = "2.0.12"; # version 2.0.13 should not be used, see #72791

  src = fetchPypi {
    inherit pname version;
    sha256 = "18j1rmbmhih7q6y12grcj169q7sx1986qn4gmpla9y5gwfh1p8la";
  };

  propagatedBuildInputs = [ pydns ];

  meta = with lib; {
    homepage = http://bmsi.com/python/milter.html;
    description = "Python API for Sendmail Milters (SPF)";
    maintainers = with maintainers; [ abbradar ];
    license = licenses.gpl2;
  };
}

Revert "python37Packages.pyspf: 2.0.12 -> 2.0.13"
Revert "python37Packages.pyspf: 2.0.12 -> 2.0.13"

This reverts commit e3f9c4d79041c6114a67ff67772186b737477393.
This fixes #72791.
Version 2.0.13 of pyspf introduced a bug where some incoming mails can cause a
crash and be falsely rejected. (https://github.com/sdgathman/pyspf/issues/17)
