GNU bug report logs - #35619
WIP version of postfix.scm

Previous Next

Package: guix-patches;

Reported by: "Brant Gardner" <brantcgardner <at> brantware.com>

Date: Tue, 7 May 2019 15:17:02 UTC

Severity: normal

To reply to this bug, email your comments to 35619 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Tue, 07 May 2019 15:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Brant Gardner" <brantcgardner <at> brantware.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 07 May 2019 15:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brant Gardner" <brantcgardner <at> brantware.com>
To: guix-patches <at> gnu.org
Subject: WIP version of postfix.scm
Date: Tue, 07 May 2019 11:15:18 -0400
[Message part 1 (text/plain, inline)]
I've gotten it to the point where it builds but does not install - Postfix seems to have a non-standard install procedure and I'm not sure how to proceed.

'guix lint' is mostly happy with it and I tried to follow standards but I'm still new at this so any comments are appreciated.

Thank you!

--
Brant Gardner


[Message part 2 (text/html, inline)]
[0001-gnu-Add-postfix-WIP.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Mon, 10 Aug 2020 06:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Gábor Boskovits <boskovits <at> gmail.com>
Cc: Guix-devel <guix-devel <at> gnu.org>, 35619 <at> debbugs.gnu.org
Subject: Re: wip-postfix
Date: Mon, 10 Aug 2020 08:49:54 +0200
Gábor Boskovits writes:

Hello!

>> Jan Nieuwenhuizen <janneke <at> gnu.org> ezt írta (időpont: 2020. márc. 17., Ke 9:02):
>
>  Gábor Boskovits writes:

I took the liberty of rebasing wip-postfix on latest master and
found it does not compile

--8<---------------cut here---------------start------------->8---
gcc -fPIC -I. -I../../include -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\"no\" -DHAS_DEV_URANDOM -DDEF_SHLIB_DIR=\"/gnu/store/hbdrbb84krvjvw58vmr1pvzb6l3gbmyv-postfix-minimal-3.4.8\" -DUSE_DYNAMIC_LIBS -DUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat -Wno-comment -fPIC -g -O -I. -I../../include -DLINUX5 -c dns_str_resflags.c
dns_str_resflags.c:55:13: warning: RES_AAONLY is deprecated
     "RES_AAONLY", RES_AAONLY,
             ^~~~~~~~~~~~~~~~~         
dns_str_resflags.c:57:13: warning: RES_PRIMARY is deprecated
     "RES_PRIMARY", RES_PRIMARY,
             ^~~~~~~~~~~~~~~~~~~        
dns_str_resflags.c:63:22: error: ‘RES_INSECURE1’ undeclared here (not in a function); did you mean ‘RES_RECURSE’?
     "RES_INSECURE1", RES_INSECURE1,
                      ^~~~~~~~~~~~~
                      RES_RECURSE
--8<---------------cut here---------------end--------------->8---

Luckily, that was easily fixed by updating postfix to 3.5.0.

>>  When I hack around and create /etc/ailases.db, it works.
> I would like to add a service config for this.

I found we already have mail-aliases-service-type, so I used that,
together with running postalias.  Now, queuing mail works ootb...but
delivery seems not to work: it remains queued.

I rebased wip-postfix and added a couple of patches for this.  Please
feel free to revert them if you don't like it :-)

When starting postfix like so

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix system vm gnu/system/examples/postfix.tmpl`\
   --nographic -m 1G\
   --nic user,model=virtio-net-pci,hostfwd=tcp::12025-:25,hostfwd=tcp:127.0.0.1:12022-:2222
--8<---------------cut here---------------end--------------->8---

I'm seeing

--8<---------------cut here---------------start------------->8---
07:39:18 janneke <at> dundal:~/src/guix/wip-postfix [env]
$ telnet localhost 12025
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 komputilo.localdomain ESMTP Postfix
mail from: root
mail from: root
250 2.1.0 Ok
rcpt to: alice
rcpt to: alice
250 2.1.5 Ok
data
data
354 End data with <CR><LF>.<CR><LF>
hello Alice!
hello Alice!
.
.
250 2.0.0 Ok: queued as E26BA3116
quit
quit
221 2.0.0 Bye
Connection closed by foreign host.
08:03:53 janneke <at> dundal:~/src/guix/wip-postfix [env]
$ ssh -p 12022 root <at> localhost /gnu/store/mydn0wr0bs7mz3rx9fwihpma26r0dpqq-postfix-minimal-3.5.0/mailq -C /gnu/store/nj5pa9l9zy6vx5484pbdsqnilva8bivc-postfix-config-dir
-Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
E26BA3116*      175 Mon Aug 10 08:00:50  root <at> komputilo.localdomain
                                         alice <at> komputilo.localdomain

-- 0 Kbytes in 1 Request.
--8<---------------cut here---------------end--------------->8---

Ideas?

>>  It looks like most everything is installed in a single, flat directory
>>
>>      /gnu/store/pyv0rpd6zs0m2i482cb8qxd6mhf5b47z-postfix-minimal-3.4.8
>>
>>  executables, copies of readmes, (unused?) config files (main.cf,
>>  aliases)?
>
> Yes, but can be easily separated. The config files are installer
> generated, and not used.

Ok => TODO :-)

>> Anyhow, this is a great start; next Mailman?
>
> One thing that blocks me from finishing this is that the setuid
> programs in the os declatation should be extended, so that we can use
> the privilege separation of postfix. I would like to propose a patch
> later this week.

Any insight here, something blocking maybe?

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (5):
  gnu: postfix-minimal: Updato to 3.5.0.
  system: examples: Add postfix.tmpl.
  gnu: postfix-minimal: Fix startup warnings.
  service: postfix: Use mail-aliases-service-type.
  system: postfix.tmpl: Add mail-aliases-service.

 gnu/packages/mail.scm            | 32 ++++++++++++-------
 gnu/services/mail.scm            | 12 ++++++-
 gnu/system/examples/postfix.tmpl | 54 ++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+), 12 deletions(-)
 create mode 100644 gnu/system/examples/postfix.tmpl

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Mon, 10 Aug 2020 06:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: "Jan (janneke) Nieuwenhuizen" <janneke <at> gnu.org>
To: Gábor Boskovits <boskovits <at> gmail.com>,
 35619 <at> debbugs.gnu.org
Subject: [PATCH 1/5] gnu: postfix-minimal: Updato to 3.5.0.
Date: Mon, 10 Aug 2020 08:51:08 +0200
* gnu/packages/mail.scm (postfix-minimal): Update to 3.5.0.  Fixes build with
glibc-2.30.
---
 gnu/packages/mail.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a2708ed1a2..94236bbbcd 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -3558,7 +3558,7 @@ based on asyncio.")
 (define-public postfix-minimal
   (package
     (name "postfix-minimal")
-    (version "3.4.8")
+    (version "3.5.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://cdn.postfix.johnriley.me/"
@@ -3566,7 +3566,7 @@ based on asyncio.")
                                   "postfix-" version ".tar.gz"))
               (sha256
                (base32
-                "0hw9kbr05qdzvfqhxi4dp4n3s9xvdh0gr0la08a4bip06ybl4pcd"))))
+                "1k2mxx9yx8lif804ff7zjyllizv4najfv3dca912k6j46fbr5b12"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Mon, 10 Aug 2020 06:52:01 GMT) Full text and rfc822 format available.

Message #14 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: "Jan (janneke) Nieuwenhuizen" <janneke <at> gnu.org>
To: Gábor Boskovits <boskovits <at> gmail.com>,
 35619 <at> debbugs.gnu.org
Subject: [PATCH 2/5] system: examples: Add postfix.tmpl.
Date: Mon, 10 Aug 2020 08:51:09 +0200
* gnu/system/examples/postfix.tmpl: New file.
---
 gnu/system/examples/postfix.tmpl | 52 ++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 gnu/system/examples/postfix.tmpl

diff --git a/gnu/system/examples/postfix.tmpl b/gnu/system/examples/postfix.tmpl
new file mode 100644
index 0000000000..e0b335954e
--- /dev/null
+++ b/gnu/system/examples/postfix.tmpl
@@ -0,0 +1,52 @@
+;; This is an operating system configuration template for testing postfix.
+
+(use-modules (gnu))
+(use-service-modules mail networking ssh)
+(use-package-modules ssh)
+
+(operating-system
+  (host-name "komputilo")
+  (timezone "Europe/Berlin")
+  (locale "en_US.utf8")
+
+  ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
+  ;; target hard disk, and "my-root" is the label of the target
+  ;; root file system.
+  (bootloader (bootloader-configuration
+                (bootloader grub-bootloader)
+                (target "/dev/sdX")))
+
+  ;; Allow run-vm.sh --nographic
+  (kernel-arguments '("console=tty0" "console=ttyS0"))
+  (file-systems (cons (file-system
+                        (device (file-system-label "guix"))
+                        (mount-point "/")
+                        (type "ext4"))
+                      %base-file-systems))
+
+  ;; This is where user accounts are specified.  The "root"
+  ;; account is implicit, and is initially created with the
+  ;; empty password.
+  (users (cons (user-account
+                (name "alice")
+                (comment "Bob's sister")
+                (group "users")
+
+                ;; Adding the account to the "wheel" group
+                ;; makes it a sudoer.
+                (supplementary-groups '("wheel")))
+               %base-user-accounts))
+
+  ;; Add services to the baseline: a DHCP client, POSTFIX and
+  ;; an SSH server.
+  (services (append (list (service dhcp-client-service-type)
+                          (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (use-pam? #f)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                          (service postfix-service-type))
+                    %base-services)))
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Mon, 10 Aug 2020 06:52:02 GMT) Full text and rfc822 format available.

Message #17 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: "Jan (janneke) Nieuwenhuizen" <janneke <at> gnu.org>
To: Gábor Boskovits <boskovits <at> gmail.com>,
 35619 <at> debbugs.gnu.org
Subject: [PATCH 3/5] gnu: postfix-minimal: Fix startup warnings.
Date: Mon, 10 Aug 2020 08:51:10 +0200
This avoids kind of funny replacements like these of `rm'

    find -prune -perm -020
=>
    find -prune -pe/gnu/store/zibwkb5xavnv6z3gzknfqjsxb9b0izh0-coreutils-8.31/bin/rm -020

* gnu/packages/mail.scm (postfix-minimal)[phases]: Set PATH rather than
substituting individual commands.
---
 gnu/packages/mail.scm | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 94236bbbcd..5f622595c9 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -35,6 +35,7 @@
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020 Michael Rohleder <mike <at> rohleder.de>
 ;;; Copyright © 2020 Brant Gardner <brantcgardner <at> brantware.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3569,7 +3570,10 @@ based on asyncio.")
                 "1k2mxx9yx8lif804ff7zjyllizv4najfv3dca912k6j46fbr5b12"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
+     '(#:modules ((srfi srfi-26)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+       #:phases
        (modify-phases %standard-phases
          (add-before 'build 'patch-/bin/sh
            (lambda _
@@ -3601,14 +3605,20 @@ based on asyncio.")
            (lambda _
              (invoke "make" "makefiles" "pie=yes" "dynamicmaps=yes")))
          (add-before 'install 'fix-postfix-scripts-path
-           (lambda _
-             (for-each
-              (lambda (command)
-                (substitute* '("postfix-install" "conf/post-install" "conf/postfix-script")
-                  (((string-append command " ")) (string-append (which command) " "))))
-              '("awk" "chmod" "chown" "chgrp" "cp" "find" "ln" "mkdir" "mv" "rm" "sed"
-                "sleep" "sort" "touch" "uname"))
-             #t))
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((path (string-join
+                          (map (compose (cute string-append <> "/bin")
+                                        (cute assoc-ref inputs <>))
+                               '("bash" "coreutils" "findutils" "gawk" "grep"
+                                 "sed"))
+                          ":")))
+               (substitute* '("postfix-install"
+                              "conf/post-install"
+                              "conf/postfix-script")
+                 (("^SHELL=/bin/sh")
+                  (string-append "PATH=" path "\n"
+                                 "SHELL=" (assoc-ref inputs "bash") "/bin/sh")))
+               #t)))
          (add-before 'install 'configure-install
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Mon, 10 Aug 2020 06:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: "Jan (janneke) Nieuwenhuizen" <janneke <at> gnu.org>
To: Gábor Boskovits <boskovits <at> gmail.com>,
 35619 <at> debbugs.gnu.org
Subject: [PATCH 4/5] service: postfix: Use mail-aliases-service-type.
Date: Mon, 10 Aug 2020 08:51:11 +0200
* gnu/services/mail.scm (postfix-service-type): Extend mail-aliases-service-type.
(postfix-shepherd-service): Generate /etc/aliases.db if necessary.
---
 gnu/services/mail.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 59cb373fbf..9a0066d920 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington <at> gmail.com>
 ;;; Copyright © 2020 Gábor Boskovits <boskovits <at> gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1956,9 +1957,17 @@ inet_protocols = ipv4
   (match-record config <postfix-configuration>
     (postfix)
     (let* ((postfix-binary (file-append postfix "/postfix"))
+           (postalias-binary (file-append postfix "/postalias"))
            (postfix-action
             (lambda (action)
               #~(lambda _
+                  (when (or (not (file-exists? "/etc/aliases.db"))
+                            (> (stat:mtime (stat "/etc/aliases"))
+                               (stat:mtime (stat "/etc/aliases.db"))))
+                    (invoke #$postalias-binary
+                            "-c"
+                            #$(postfix-configuration-directory config)
+                            "/etc/aliases"))
                   (invoke #$postfix-binary "-c"
                           #$(postfix-configuration-directory config)
                           #$action)))))
@@ -1974,6 +1983,7 @@ inet_protocols = ipv4
    (name 'postfix)
    (extensions (list (service-extension account-service-type postfix-accounts)
                      (service-extension activation-service-type postfix-activation)
-                     (service-extension shepherd-root-service-type postfix-shepherd-service)))
+                     (service-extension shepherd-root-service-type postfix-shepherd-service)
+                     (service-extension mail-aliases-service-type (const '()))))
    (description "Run the Postfix MTA.")
    (default-value (postfix-configuration))))
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Mon, 10 Aug 2020 06:52:03 GMT) Full text and rfc822 format available.

Message #23 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: "Jan (janneke) Nieuwenhuizen" <janneke <at> gnu.org>
To: Gábor Boskovits <boskovits <at> gmail.com>,
 35619 <at> debbugs.gnu.org
Subject: [PATCH 5/5] system: postfix.tmpl: Add mail-aliases-service.
Date: Mon, 10 Aug 2020 08:51:12 +0200
* gnu/system/examples/postfix.tmpl: Add mail-aliases-service-type.
---
 gnu/system/examples/postfix.tmpl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/system/examples/postfix.tmpl b/gnu/system/examples/postfix.tmpl
index e0b335954e..7ebc8544f5 100644
--- a/gnu/system/examples/postfix.tmpl
+++ b/gnu/system/examples/postfix.tmpl
@@ -48,5 +48,7 @@
                               (permit-root-login #t)
                               (allow-empty-passwords? #t)
                               (password-authentication? #t)))
+                          (service mail-aliases-service-type
+                                   '(("postmaster" "root")))
                           (service postfix-service-type))
                     %base-services)))
-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Tue, 11 Aug 2020 02:17:02 GMT) Full text and rfc822 format available.

Message #26 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: Guix-devel <guix-devel <at> gnu.org>, 35619 <at> debbugs.gnu.org
Subject: Re: wip-postfix
Date: Tue, 11 Aug 2020 04:16:12 +0200
[Message part 1 (text/plain, inline)]
Hello Jan,

Jan Nieuwenhuizen <janneke <at> gnu.org> ezt írta (időpont: 2020. aug. 10., Hét
8:50):

> Gábor Boskovits writes:
>
> Hello!
>
> >> Jan Nieuwenhuizen <janneke <at> gnu.org> ezt írta (időpont: 2020. márc.
> 17., Ke 9:02):
> >
> >  Gábor Boskovits writes:
>
> I took the liberty of rebasing wip-postfix on latest master and
> found it does not compile
>
> --8<---------------cut here---------------start------------->8---
> gcc -fPIC -I. -I../../include -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\"no\"
> -DHAS_DEV_URANDOM
> -DDEF_SHLIB_DIR=\"/gnu/store/hbdrbb84krvjvw58vmr1pvzb6l3gbmyv-postfix-minimal-3.4.8\"
> -DUSE_DYNAMIC_LIBS -DUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat
> -Wno-comment -fPIC -g -O -I. -I../../include -DLINUX5 -c dns_str_resflags.c
> dns_str_resflags.c:55:13: warning: RES_AAONLY is deprecated
>      "RES_AAONLY", RES_AAONLY,
>              ^~~~~~~~~~~~~~~~~
> dns_str_resflags.c:57:13: warning: RES_PRIMARY is deprecated
>      "RES_PRIMARY", RES_PRIMARY,
>              ^~~~~~~~~~~~~~~~~~~
> dns_str_resflags.c:63:22: error: ‘RES_INSECURE1’ undeclared here (not in a
> function); did you mean ‘RES_RECURSE’?
>      "RES_INSECURE1", RES_INSECURE1,
>                       ^~~~~~~~~~~~~
>                       RES_RECURSE
> --8<---------------cut here---------------end--------------->8---
>
> Luckily, that was easily fixed by updating postfix to 3.5.0.
>

Thanks for having a look.

>
> >>  When I hack around and create /etc/ailases.db, it works.
> > I would like to add a service config for this.
>
> I found we already have mail-aliases-service-type, so I used that,
> together with running postalias.  Now, queuing mail works ootb...but
> delivery seems not to work: it remains queued.
>
> I rebased wip-postfix and added a couple of patches for this.  Please
> feel free to revert them if you don't like it :-)
>
> When starting postfix like so
>
> --8<---------------cut here---------------start------------->8---
> ./pre-inst-env guix system vm gnu/system/examples/postfix.tmpl`\
>    --nographic -m 1G\
>    --nic
> user,model=virtio-net-pci,hostfwd=tcp::12025-:25,hostfwd=tcp:127.0.0.1:12022
> -:2222
> --8<---------------cut here---------------end--------------->8---
>
> I'm seeing
>
> --8<---------------cut here---------------start------------->8---
> 07:39:18 janneke <at> dundal:~/src/guix/wip-postfix [env]
> $ telnet localhost 12025
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> 220 komputilo.localdomain ESMTP Postfix
> mail from: root
> mail from: root
> 250 2.1.0 Ok
> rcpt to: alice
> rcpt to: alice
> 250 2.1.5 Ok
> data
> data
> 354 End data with <CR><LF>.<CR><LF>
> hello Alice!
> hello Alice!
> .
> .
> 250 2.0.0 Ok: queued as E26BA3116
> quit
> quit
> 221 2.0.0 Bye
> Connection closed by foreign host.
> 08:03:53 janneke <at> dundal:~/src/guix/wip-postfix [env]
> $ ssh -p 12022 root <at> localhost
> /gnu/store/mydn0wr0bs7mz3rx9fwihpma26r0dpqq-postfix-minimal-3.5.0/mailq -C
> /gnu/store/nj5pa9l9zy6vx5484pbdsqnilva8bivc-postfix-config-dir
> -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
> E26BA3116*      175 Mon Aug 10 08:00:50  root <at> komputilo.localdomain
>                                          alice <at> komputilo.localdomain
>
> -- 0 Kbytes in 1 Request.
> --8<---------------cut here---------------end--------------->8---
>
> Ideas?
>

I will have a look early next week. Most probably the setuid stuff is
missing, and access is denied to something.

>
> >>  It looks like most everything is installed in a single, flat directory
> >>
> >>      /gnu/store/pyv0rpd6zs0m2i482cb8qxd6mhf5b47z-postfix-minimal-3.4.8
> >>
> >>  executables, copies of readmes, (unused?) config files (main.cf,
> >>  aliases)?
> >
> > Yes, but can be easily separated. The config files are installer
> > generated, and not used.
>
> Ok => TODO :-)
>
> >> Anyhow, this is a great start; next Mailman?
> >
> > One thing that blocks me from finishing this is that the setuid
> > programs in the os declatation should be extended, so that we can use
> > the privilege separation of postfix. I would like to propose a patch
> > later this week.
>
> Any insight here, something blocking maybe?
>

Nothing in particular. I had little time recently. I just finished a bigger
project, and I was on holiday. I will try to propose an interface for this
next week.


> Greetings,
> Janneke
>

Regards,
g_bor

>
> Jan (janneke) Nieuwenhuizen (5):
>   gnu: postfix-minimal: Updato to 3.5.0.
>   system: examples: Add postfix.tmpl.
>   gnu: postfix-minimal: Fix startup warnings.
>   service: postfix: Use mail-aliases-service-type.
>   system: postfix.tmpl: Add mail-aliases-service.
>
>  gnu/packages/mail.scm            | 32 ++++++++++++-------
>  gnu/services/mail.scm            | 12 ++++++-
>  gnu/system/examples/postfix.tmpl | 54 ++++++++++++++++++++++++++++++++
>  3 files changed, 86 insertions(+), 12 deletions(-)
>  create mode 100644 gnu/system/examples/postfix.tmpl
>
> --
> Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
> Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
>
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 29 Jul 2021 16:20:02 GMT) Full text and rfc822 format available.

Message #29 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Christine Lemmer-Webber <cwebber <at> dustycloud.org>
To: Gábor Boskovits <boskovits <at> gmail.com>
Cc: guix-devel <at> gnu.org, 35619 <at> debbugs.gnu.org,
 Jan Nieuwenhuizen <janneke <at> gnu.org>
Subject: Re: wip-postfix
Date: Thu, 29 Jul 2021 12:19:06 -0400
Gábor Boskovits writes:

> Hello Jan,
>
>> I took the liberty of rebasing wip-postfix on latest master and
>> found it does not compile
>>
>> --8<---------------cut here---------------start------------->8---
>> gcc -fPIC -I. -I../../include -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\"no\"
>> -DHAS_DEV_URANDOM
>> -DDEF_SHLIB_DIR=\"/gnu/store/hbdrbb84krvjvw58vmr1pvzb6l3gbmyv-postfix-minimal-3.4.8\"
>> -DUSE_DYNAMIC_LIBS -DUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat
>> -Wno-comment -fPIC -g -O -I. -I../../include -DLINUX5 -c dns_str_resflags.c
>> dns_str_resflags.c:55:13: warning: RES_AAONLY is deprecated
>>      "RES_AAONLY", RES_AAONLY,
>>              ^~~~~~~~~~~~~~~~~
>> dns_str_resflags.c:57:13: warning: RES_PRIMARY is deprecated
>>      "RES_PRIMARY", RES_PRIMARY,
>>              ^~~~~~~~~~~~~~~~~~~
>> dns_str_resflags.c:63:22: error: ‘RES_INSECURE1’ undeclared here (not in a
>> function); did you mean ‘RES_RECURSE’?
>>      "RES_INSECURE1", RES_INSECURE1,
>>                       ^~~~~~~~~~~~~
>>                       RES_RECURSE
>> --8<---------------cut here---------------end--------------->8---
>>
>> Luckily, that was easily fixed by updating postfix to 3.5.0.
>>
>
> Thanks for having a look.
>
>>
>> >>  When I hack around and create /etc/ailases.db, it works.
>> > I would like to add a service config for this.
>>
>> I found we already have mail-aliases-service-type, so I used that,
>> together with running postalias.  Now, queuing mail works ootb...but
>> delivery seems not to work: it remains queued.
>>
>> I rebased wip-postfix and added a couple of patches for this.  Please
>> feel free to revert them if you don't like it :-)
>>
>> When starting postfix like so
>>
>> --8<---------------cut here---------------start------------->8---
>> ./pre-inst-env guix system vm gnu/system/examples/postfix.tmpl`\
>>    --nographic -m 1G\
>>    --nic
>> user,model=virtio-net-pci,hostfwd=tcp::12025-:25,hostfwd=tcp:127.0.0.1:12022
>> -:2222
>> --8<---------------cut here---------------end--------------->8---
>>
>> I'm seeing
>>
>> --8<---------------cut here---------------start------------->8---
>> 07:39:18 janneke <at> dundal:~/src/guix/wip-postfix [env]
>> $ telnet localhost 12025
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>> 220 komputilo.localdomain ESMTP Postfix
>> mail from: root
>> mail from: root
>> 250 2.1.0 Ok
>> rcpt to: alice
>> rcpt to: alice
>> 250 2.1.5 Ok
>> data
>> data
>> 354 End data with <CR><LF>.<CR><LF>
>> hello Alice!
>> hello Alice!
>> .
>> .
>> 250 2.0.0 Ok: queued as E26BA3116
>> quit
>> quit
>> 221 2.0.0 Bye
>> Connection closed by foreign host.
>> 08:03:53 janneke <at> dundal:~/src/guix/wip-postfix [env]
>> $ ssh -p 12022 root <at> localhost
>> /gnu/store/mydn0wr0bs7mz3rx9fwihpma26r0dpqq-postfix-minimal-3.5.0/mailq -C
>> /gnu/store/nj5pa9l9zy6vx5484pbdsqnilva8bivc-postfix-config-dir
>> -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
>> E26BA3116*      175 Mon Aug 10 08:00:50  root <at> komputilo.localdomain
>>                                          alice <at> komputilo.localdomain
>>
>> -- 0 Kbytes in 1 Request.
>> --8<---------------cut here---------------end--------------->8---
>>
>> Ideas?
>>
>
> I will have a look early next week. Most probably the setuid stuff is
> missing, and access is denied to something.

Good news, the new setuid stuff is in now in git master.

This probably means wip-postfix could be rebased on top of it again and
could take advantage of it?




Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 29 Jul 2021 16:23:02 GMT) Full text and rfc822 format available.

Message #32 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Christine Lemmer-Webber <cwebber <at> dustycloud.org>
To: "Jan (janneke) Nieuwenhuizen" <janneke <at> gnu.org>
Cc: Gábor Boskovits <boskovits <at> gmail.com>,
 35619 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#35619] [PATCH 5/5] system: postfix.tmpl: Add
 mail-aliases-service.
Date: Thu, 29 Jul 2021 12:22:54 -0400
Now that the new setuid tooling is in, we should probably try updating
this and getting it going again.  The wip-postfix branch should probably
be rebased as a first step and adjusted to use the new setuid tooling?

Anything else that should be done to make it happen?

 - Christine




Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 29 Jul 2021 16:23:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 29 Jul 2021 18:50:01 GMT) Full text and rfc822 format available.

Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: Christine Lemmer-Webber <cwebber <at> dustycloud.org>
Cc: 35619 <at> debbugs.gnu.org, guix-patches <at> gnu.org,
 "Jan \(janneke\) Nieuwenhuizen" <janneke <at> gnu.org>
Subject: Re: [bug#35619] [PATCH 5/5] system: postfix.tmpl: Add
 mail-aliases-service.
Date: Thu, 29 Jul 2021 20:49:30 +0200
[Message part 1 (text/plain, inline)]
Hello,

yup, that should be the first step. Once that is done I can have a look at
this again, and see what is missing.


Christine Lemmer-Webber <cwebber <at> dustycloud.org> ezt írta (időpont: 2021.
júl. 29., Cs, 18:22):

> Now that the new setuid tooling is in, we should probably try updating
> this and getting it going again.  The wip-postfix branch should probably
> be rebased as a first step and adjusted to use the new setuid tooling?
>
> Anything else that should be done to make it happen?
>
>  - Christine
>


-- 
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 29 Jul 2021 18:50:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Fri, 30 Jul 2021 14:17:02 GMT) Full text and rfc822 format available.

Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christine Lemmer-Webber <cwebber <at> dustycloud.org>
To: Gábor Boskovits <boskovits <at> gmail.com>
Cc: 35619 <at> debbugs.gnu.org, guix-patches <at> gnu.org,
 "Jan \(janneke\) Nieuwenhuizen" <janneke <at> gnu.org>
Subject: Re: [bug#35619] [PATCH 5/5] system: postfix.tmpl: Add
 mail-aliases-service.
Date: Fri, 30 Jul 2021 10:16:00 -0400
I've rebased wip-postfix and pushed it up.

The new setuid stuff is not yet added, I just rebased the older commits
on top.

Gábor Boskovits writes:

> Hello,
>
> yup, that should be the first step. Once that is done I can have a look at
> this again, and see what is missing.
>
>
> Christine Lemmer-Webber <cwebber <at> dustycloud.org> ezt írta (időpont: 2021.
> júl. 29., Cs, 18:22):
>
>> Now that the new setuid tooling is in, we should probably try updating
>> this and getting it going again.  The wip-postfix branch should probably
>> be rebased as a first step and adjusted to use the new setuid tooling?
>>
>> Anything else that should be done to make it happen?
>>
>>  - Christine
>>





Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Fri, 30 Jul 2021 14:17:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Sun, 12 Jun 2022 10:32:02 GMT) Full text and rfc822 format available.

Message #50 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 35619 <at> debbugs.gnu.org
Cc: Gábor Boskovits <gboskovits <at> gmail.com>,
 Christine Lemmer-Webber <cwebber <at> dustycloud.org>,
 Jan Nieuwenhuizen <janneke <at> gnu.org>
Subject: WIP version of postfix.scm
Date: Sun, 12 Jun 2022 12:29:20 +0200
I just rebased all of this, changed the input style to plain lists,
removed trailing #t from build phases, and upgraded postfix to 3.7.

What is missing to get this merged?

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 07 Sep 2023 16:17:01 GMT) Full text and rfc822 format available.

Message #53 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 35619 <at> debbugs.gnu.org
Subject: WIP version of postfix.scm
Date: Thu, 07 Sep 2023 18:13:13 +0200
I rebased again and upgraded to 3.7.7.

What remains to be done?  People above mentioned something about setuid,
but I don’t know if that’s something that needs to change in the service
definition or the example configuration, or both.

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#35619; Package guix-patches. (Thu, 07 Sep 2023 19:35:01 GMT) Full text and rfc822 format available.

Message #56 received at 35619 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 35619 <at> debbugs.gnu.org
Subject: WIP version of postfix.scm
Date: Thu, 07 Sep 2023 21:32:23 +0200
Okay, I made a few more changes:

- fixed typos

- fixed installation locations so the executables aren’t dumped into
  the prefix directory
  
- let the postfix-service-type conditionally extend
  setuid-program-service-type to setgid on the executables

What’s missing:

- rough tests to see if this works at all
- documentation of the service

Any takers?

-- 
Ricardo




This bug report was last modified 1 year and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.