git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #10620 from gebner/postfix-3.0.3

postfix: 2.11.5 -> 3.0.3

commitadb74ad2f935e2ec66b799d6a001825fc6736c85 authorPeter Simons <simons@cryp.to> dateSun 8 Nov 2015, 18:10 (11 years ago) parent6687047929e734
3 files changed+85−22
nixos/modules/services/mail/postfix.nix+20−19 pkgs/servers/mail/postfix/3.0.nix+63 pkgs/top-level/all-packages.nix+2−3
nixos/modules/services/mail/postfix.nix+20−19
@@ -11,6 +11,8 @@ let
1111
1212 mainCf =
1313 ''
14+ compatibility_level = 2
15+
1416 queue_directory = /var/postfix/queue
1517 command_directory = ${pkgs.postfix}/sbin
1618 daemon_directory = ${pkgs.postfix}/libexec/postfix
@@ -31,10 +33,7 @@ let
3133 mynetworks_style = ${cfg.networksStyle}
3234 ''
3335 else
34− # Postfix default is subnet, but let's play safe
35− ''
36− mynetworks_style = host
37− '')
36+ "")
3837 + optionalString (cfg.hostname != "") ''
3938 myhostname = ${cfg.hostname}
4039 ''
@@ -89,7 +88,7 @@ let
8988 masterCf = ''
9089 # ==========================================================================
9190 # service type private unpriv chroot wakeup maxproc command + args
92− # (yes) (yes) (yes) (never) (100)
91+ # (yes) (yes) (no) (never) (100)
9392 # ==========================================================================
9493 smtp inet n - n - - smtpd
9594 #submission inet n - n - - smtpd
@@ -232,8 +231,7 @@ in
232231 default = null;
233232 example = ["localdomain"];
234233 description = "
235− List of domains we agree to relay to. Default is the same as
236− destination.
234+ List of domains we agree to relay to. Default is empty.
237235 ";
238236 };
239237
@@ -357,23 +355,20 @@ in
357355 }
358356 ];
359357
360− jobs.postfix =
361− # I copy _lots_ of shipped configuration filed
362− # that can be left as is. I am afraid the exact
363− # will list slightly change in next Postfix
364− # release, so listing them all one-by-one in an
365− # accurate way is unlikely to be better.
358+ systemd.services.postfix =
366359 { description = "Postfix mail server";
367360
368361 wantedBy = [ "multi-user.target" ];
369362 after = [ "network.target" ];
370363
371− daemonType = "fork";
364+ serviceConfig = {
365+ Type = "forking";
366+ Restart = "always";
367+ PIDFile = "/var/postfix/queue/pid/master.pid";
368+ };
372369
373370 preStart = ''
374− if ! [ -d /var/spool/postfix ]; then
375− ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue
376− fi
371+ ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue
377372
378373 ${pkgs.coreutils}/bin/chown -R ${user}:${group} /var/postfix
379374 ${pkgs.coreutils}/bin/chown -R ${user}:${setgidGroup} /var/postfix/queue
@@ -382,7 +377,7 @@ in
382377 ${pkgs.coreutils}/bin/chmod a+rwxt /var/spool/mail
383378 ${pkgs.coreutils}/bin/ln -sf /var/spool/mail /var/
384379
385− ln -sf "${pkgs.postfix}/etc/postfix/"* /var/postfix/conf
380+ ln -sf ${pkgs.postfix}/etc/postfix/postfix-files /var/postfix/conf
386381
387382 ln -sf ${aliasesFile} /var/postfix/conf/aliases
388383 ln -sf ${virtualFile} /var/postfix/conf/virtual
@@ -391,12 +386,18 @@ in
391386
392387 ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases
393388 ${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual
389+ '';
394390
391+ script = ''
395392 ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf start
396393 '';
397394
395+ reload = ''
396+ ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf reload
397+ '';
398+
398399 preStop = ''
399− ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf stop
400+ ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf stop
400401 '';
401402
402403 };
pkgs/servers/mail/postfix/3.0.nixnew file+63
@@ -0,0 +1,63 @@
1+{ stdenv, fetchurl, makeWrapper, gnused, db, openssl, cyrus_sasl, coreutils
2+, findutils, gnugrep, gawk, icu
3+}:
4+
5+stdenv.mkDerivation rec {
6+
7+ name = "postfix-${version}";
8+
9+ version = "3.0.3";
10+
11+ src = fetchurl {
12+ url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
13+ sha256 = "00mc12k5p1zlrlqcf33vh5zizaqr5ai8q78dwv69smjh6kn4c7j0";
14+ };
15+
16+ buildInputs = [ makeWrapper gnused db openssl cyrus_sasl icu ];
17+
18+ preBuild = ''
19+ sed -e '/^PATH=/d' -i postfix-install
20+
21+ export command_directory=$out/sbin
22+ export config_directory=/etc/postfix
23+ export daemon_directory=$out/libexec/postfix
24+ export data_directory=/var/lib/postfix
25+ export html_directory=$out/share/postfix/doc/html
26+ export mailq_path=$out/bin/mailq
27+ export manpage_directory=$out/share/man
28+ export newaliases_path=$out/bin/newaliases
29+ export queue_directory=/var/spool/postfix
30+ export readme_directory=$out/share/postfix/doc
31+ export sendmail_path=$out/bin/sendmail
32+
33+ make makefiles \
34+ CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${cyrus_sasl}/include/sasl \
35+ -DHAS_DB_BYPASS_MAKEDEFS_CHECK \
36+ -fPIE -fstack-protector-all --param ssp-buffer-size=4 -O2 -D_FORTIFY_SOURCE=2' \
37+ AUXLIBS='-ldb -lnsl -lresolv -lsasl2 -lcrypto -lssl -pie -Wl,-z,relro,-z,now'
38+ '';
39+
40+ installTargets = [ "non-interactive-package" ];
41+
42+ installFlags = [ " install_root=installdir " ];
43+
44+ postInstall = ''
45+ mkdir -p $out
46+ mv -v installdir/$out/* $out/
47+ mv -v installdir/etc $out/etc
48+ sed -e '/^PATH=/d' -i $out/libexec/postfix/post-install
49+ wrapProgram $out/libexec/postfix/post-install \
50+ --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin
51+ wrapProgram $out/libexec/postfix/postfix-script \
52+ --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin
53+ '';
54+
55+ meta = {
56+ homepage = "http://www.postfix.org/";
57+ description = "A fast, easy to administer, and secure mail server";
58+ license = stdenv.lib.licenses.bsdOriginal;
59+ platforms = stdenv.lib.platforms.linux;
60+ maintainers = [ stdenv.lib.maintainers.rickynils ];
61+ };
62+
63+}
pkgs/top-level/all-packages.nix+2−3
@@ -9207,10 +9207,9 @@ let
92079207 popa3d = callPackage ../servers/mail/popa3d { };
92089208
92099209 postfix28 = callPackage ../servers/mail/postfix { };
9210−
92119210 postfix211 = callPackage ../servers/mail/postfix/2.11.nix { };
9212−
9213− postfix = postfix211;
9211+ postfix30 = callPackage ../servers/mail/postfix/3.0.nix { };
9212+ postfix = postfix30;
92149213
92159214 pshs = callPackage ../servers/http/pshs { };
92169215