GNU bug report logs - #35170
[PATCH] services: Add 'imap4d-service-type'.

Previous Next

Package: guix-patches;

Reported by: 宋文武 <iyzsong <at> member.fsf.org>

Date: Sat, 6 Apr 2019 14:11:01 UTC

Severity: normal

Tags: patch

Done: iyzsong <at> member.fsf.org (宋文武)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35170 in the body.
You can then email your comments to 35170 AT debbugs.gnu.org in the normal way.

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#35170; Package guix-patches. (Sat, 06 Apr 2019 14:11:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 宋文武 <iyzsong <at> member.fsf.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 06 Apr 2019 14:11:01 GMT) Full text and rfc822 format available.

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

From: 宋文武 <iyzsong <at> member.fsf.org>
To: guix-patches <at> gnu.org
Cc: 宋文武 <iyzsong <at> member.fsf.org>
Subject: [PATCH] services: Add 'imap4d-service-type'.
Date: Sat,  6 Apr 2019 22:09:39 +0800
* gnu/services/mail.scm (<imap4d-configuration>): New record type.
(imap4d-shepherd-service): New procedure.
(%default-imap4d-config-file, imap4d-service-type): New variables.
* gnu/services/mail.scm (Mail Services): Document it.
---
 doc/guix.texi         | 30 +++++++++++++++++++++++++++++
 gnu/services/mail.scm | 45 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1c82579afc..cecad64e0c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -16559,6 +16559,36 @@ the @code{operating-system}'s @code{user-accounts} in order to deliver
 the @code{postmaster} mail to @code{bob} (which subsequently would
 deliver mail to @code{bob@@example.com} and @code{bob@@example2.com}).
 
+@subsubheading GNU Mailutils IMAP4 Daemon
+@cindex GNU Mailutils IMAP4 Daemon
+
+@deffn {Scheme Variable} imap4d-service-type
+This is the type of the GNU Mailutils IMAP4 Daemon (@pxref{(mailutils)
+imap4d}), whose value should be an @code{imap4d-configuration} object as in
+this example:
+
+@example
+(service imap4d-service-type
+         (imap4d-configuration
+           (config-file (local-file "imap4d.conf"))))
+@end example
+@end deffn
+
+@deftp {Data Type} imap4d-configuration
+Data type representing the configuration of @command{imap4d}.
+
+@table @asis
+@item @code{package} (default: @code{mailutils})
+The package that provides @command{imap4d}.
+
+@item @code{config-file} (default: @code{%default-imap4d-config-file})
+File-like object of the configuration file to use, by default it will listen
+on the tcp port 143 of @code{localhost}.  @xref{(mailutils) Conf-imap4d} for
+details.
+
+@end table
+@end deftp
+
 @node Messaging Services
 @subsection Messaging Services
 
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index a7e8c41d3a..0dabfed4cb 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -64,7 +64,12 @@
             exim-configuration
             exim-configuration?
             exim-service-type
-            %default-exim-config-file))
+            %default-exim-config-file
+
+            imap4d-configuration
+            imap4d-configuration?
+            imap4d-service-type
+            %defualt-imap4d-config-file))
 
 ;;; Commentary:
 ;;;
@@ -1776,3 +1781,41 @@ exim_group = exim
           (service-extension activation-service-type exim-activation)
           (service-extension profile-service-type exim-profile)
           (service-extension mail-aliases-service-type (const '()))))))
+
+
+;;;
+;;; GNU Mailutils IMAP4 Daemon.
+;;;
+
+(define %default-imap4d-config-file
+  (plain-file "imap4d.conf" "server localhost {};\n"))
+
+(define-record-type* <imap4d-configuration>
+  imap4d-configuration make-imap4d-configuration imap4d-configuration?
+  (package     imap4d-configuration-package
+               (default mailutils))
+  (config-file imap4d-configuration-config-file
+               (default %default-imap4d-config-file)))
+
+(define imap4d-shepherd-service
+  (match-lambda
+    (($ <imap4d-configuration> package config-file)
+     (list (shepherd-service
+            (provision '(imap4d))
+            (requirement '(networking syslogd))
+            (documentation "Run the imap4d daemon.")
+            (start (let ((imap4d (file-append package "/sbin/imap4d")))
+                     #~(make-forkexec-constructor
+                        (list #$imap4d "--daemon" "--foreground"
+                              "--config-file" #$config-file))))
+            (stop #~(make-kill-destructor)))))))
+
+(define imap4d-service-type
+  (service-type
+   (name 'imap4d)
+   (description
+    "Run the GNU @command{imap4d} to serve e-mail messages through IMAP.")
+   (extensions
+    (list (service-extension
+           shepherd-root-service-type imap4d-shepherd-service)))
+   (default-value (imap4d-configuration))))
-- 
2.19.2





Reply sent to iyzsong <at> member.fsf.org (宋文武):
You have taken responsibility. (Sun, 07 Apr 2019 06:22:02 GMT) Full text and rfc822 format available.

Notification sent to 宋文武 <iyzsong <at> member.fsf.org>:
bug acknowledged by developer. (Sun, 07 Apr 2019 06:22:02 GMT) Full text and rfc822 format available.

Message #10 received at 35170-done <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> member.fsf.org (宋文武)
To: 35170-done <at> debbugs.gnu.org
Subject: Re: [bug#35170] [PATCH] services: Add 'imap4d-service-type'.
Date: Sun, 07 Apr 2019 14:21:01 +0800
宋文武 <iyzsong <at> member.fsf.org> writes:

> * gnu/services/mail.scm (<imap4d-configuration>): New record type.
> (imap4d-shepherd-service): New procedure.
> (%default-imap4d-config-file, imap4d-service-type): New variables.
> * gnu/services/mail.scm (Mail Services): Document it.

Pushed now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 05 May 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 351 days ago.

Previous Next


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