Merge pull request #72390 from flokli/bump-opensmtpd

opensmtpd: 6.4.2p1 -> 6.6.1p1
This commit is contained in:
Florian Klink 2019-11-11 01:56:24 +01:00 committed by GitHub
commit 848399f448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 29 deletions

View File

@ -101,6 +101,12 @@ in {
};
};
systemd.tmpfiles.rules = [
"d /var/spool/smtpd 711 root - - -"
"d /var/spool/smtpd/offline 770 root smtpq - -"
"d /var/spool/smtpd/purge 700 smtpq root - -"
];
systemd.services.opensmtpd = let
procEnv = pkgs.buildEnv {
name = "opensmtpd-procs";
@ -110,18 +116,6 @@ in {
in {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
preStart = ''
mkdir -p /var/spool/smtpd
chmod 711 /var/spool/smtpd
mkdir -p /var/spool/smtpd/offline
chown root.smtpq /var/spool/smtpd/offline
chmod 770 /var/spool/smtpd/offline
mkdir -p /var/spool/smtpd/purge
chown smtpq.root /var/spool/smtpd/purge
chmod 700 /var/spool/smtpd/purge
'';
serviceConfig.ExecStart = "${cfg.package}/sbin/smtpd -d -f ${conf} ${args}";
environment.OPENSMTPD_PROC_PATH = "${procEnv}/libexec/opensmtpd";
};

View File

@ -1,4 +1,4 @@
import ./make-test.nix {
import ./make-test-python.nix {
name = "opensmtpd";
nodes = {
@ -102,23 +102,23 @@ import ./make-test.nix {
};
testScript = ''
startAll;
start_all()
$client->waitForUnit("network-online.target");
$smtp1->waitForUnit('opensmtpd');
$smtp2->waitForUnit('opensmtpd');
$smtp2->waitForUnit('dovecot2');
client.wait_for_unit("network-online.target")
smtp1.wait_for_unit("opensmtpd")
smtp2.wait_for_unit("opensmtpd")
smtp2.wait_for_unit("dovecot2")
# To prevent sporadic failures during daemon startup, make sure
# services are listening on their ports before sending requests
$smtp1->waitForOpenPort(25);
$smtp2->waitForOpenPort(25);
$smtp2->waitForOpenPort(143);
smtp1.wait_for_open_port(25)
smtp2.wait_for_open_port(25)
smtp2.wait_for_open_port(143)
$client->succeed('send-a-test-mail');
$smtp1->waitUntilFails('smtpctl show queue | egrep .');
$smtp2->waitUntilFails('smtpctl show queue | egrep .');
$client->succeed('check-mail-landed >&2');
client.succeed("send-a-test-mail")
smtp1.wait_until_fails("smtpctl show queue | egrep .")
smtp2.wait_until_fails("smtpctl show queue | egrep .")
client.succeed("check-mail-landed >&2")
'';
meta.timeout = 30;

View File

@ -4,14 +4,14 @@
stdenv.mkDerivation rec {
pname = "opensmtpd";
version = "6.4.2p1";
version = "6.6.1p1";
nativeBuildInputs = [ autoconf automake libtool bison ];
buildInputs = [ libasr libevent zlib libressl db pam ];
src = fetchurl {
url = "https://www.opensmtpd.org/archives/${pname}-${version}.tar.gz";
sha256 = "0pgv080ai7d98l9340jadp9wjiaqj2qvgpqhilcz0kps2mdiawbd";
sha256 = "1ngil8j13m2rq07g94j4yjr6zmaimzy8wbfr17shi7rxnazys6zb";
};
patches = [
@ -21,8 +21,6 @@ stdenv.mkDerivation rec {
# See https://github.com/OpenSMTPD/OpenSMTPD/issues/885 for the `sh bootstrap`
# requirement
postPatch = ''
substituteInPlace smtpd/parse.y \
--replace "/usr/libexec/" "$out/libexec/opensmtpd/"
substituteInPlace mk/smtpctl/Makefile.am --replace "chgrp" "true"
substituteInPlace mk/smtpctl/Makefile.am --replace "chmod 2555" "chmod 0555"
sh bootstrap