1 { fetchurl, perlPackages, lib, runCommand, postfix }:
4 mk-perl-flags = inputs: lib.concatStringsSep " " (map (dep: "-I ${dep}/${perlPackages.perl.libPrefix}") inputs);
5 postgrey-flags = mk-perl-flags (with perlPackages; [
6 NetServer BerkeleyDB DigestSHA1 NetAddrIP IOMultiplex
8 policy-test-flags = mk-perl-flags (with perlPackages; [
12 name = "postgrey-${version}";
15 url = "https://postgrey.schweikert.ch/pub/${name}.tar.gz";
16 sha256 = "1xx51xih4711vrvc6d57il9ccallbljj5zhgqdb07jzmz11rakgz";
19 description = "A postfix policy server to provide greylisting";
20 homepage = "https://postgrey.schweikert.ch/";
21 platforms = postfix.meta.platforms;
22 license = licenses.gpl2;
27 tar -xzf $src --strip-components=1
28 mv postgrey policy-test bin
29 sed -i -e "s,#!/usr/bin/perl -T,#!${perlPackages.perl}/bin/perl -T ${postgrey-flags}," \
30 -e "s#/etc/postfix#$out#" \
32 sed -i -e "s,#!/usr/bin/perl,#!${perlPackages.perl}/bin/perl ${policy-test-flags}," \