all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: 宋文武 <iyzsong@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] services: Add opensmtpd-service.
Date: Wed, 23 Nov 2016 23:24:27 +0100	[thread overview]
Message-ID: <8760nd4yxw.fsf@gnu.org> (raw)
In-Reply-To: <20161119072920.17518-1-iyzsong@gmail.com> ("宋文武"'s message of "Sat, 19 Nov 2016 15:29:20 +0800")

宋文武 <iyzsong@gmail.com> skribis:

> * gnu/services/mail.scm (<opensmtpd-configuration>): New record type.
> (%default-opensmtpd-config-file, %opensmtpd-accounts): New variables.
> (opensmtpd-shepherd-service, opensmtpd-activation): New procedures.
> (opensmtpd-service-type): New variable.
> (opensmtpd-service): New procedure.
> * doc/guix.texi (Mail Services): Document it.

Nice!

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -9996,16 +9996,9 @@ For MariaDB, the root password is empty.
>  @cindex mail
>  @cindex email
>  The @code{(gnu services mail)} module provides Guix service definitions
> -for mail services.  Currently the only implemented service is Dovecot,
> -an IMAP, POP3, and LMTP server.
> +for following mail services:

I think we shouldn’t put a colon just before an @subsubheading.  How
about something like this instead:

  The @code{(gnu services mail)} module provides Guix service
  definitions for email services: IMAP, POP3, and LMTP servers, as well
  as mail transport agents (MTAs).  Lots of acronyms!  These services
  are detailed in the subsections below.

> +@subsubheading OpenSMTPD Service
> +
> +@deffn {Scheme Procedure} opensmtpd-service [#:config (opensmtpd-configuration)]
> +Return a service that runs the @command{smtpd} daemon of OpenSMTPD
> +package, an implementation of SMTP server as defined by RFC 5321.

s/OpenSMTP package/@uref{https://www.opensmtpd.org, OpenSMTPD}/

However, as discussed elsewhere, I prefer that we document
‘opensmtpd-service-type’ and not provide an ‘opensmtpd-service’
procedure at all.

> +(define opensmtpd-activation
> +  (match-lambda
> +    (($ <opensmtpd-configuration> package config-file)
> +     (let ((smtpd (file-append package "/sbin/smtpd")))
> +       #~(begin
> +           ;; Create the mbox directory.
> +           (mkdir-p "/var/mail")
> +           ;; Check the configuration file for validity.
> +           (system* #$smtpd "-n" "-f" #$config-file))))))

I think the configuration check belongs in the ‘start’ function of the
service rather than here.

Otherwise looks fine.

Could you send an updated patch?

Of course, bonus point if you can get a system test.  :-)

Thank you!

Ludo’.

  reply	other threads:[~2016-11-23 22:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-19  7:29 [PATCH] services: Add opensmtpd-service 宋文武
2016-11-23 22:24 ` Ludovic Courtès [this message]
2016-11-24 14:10   ` 宋文武
2016-11-26 18:33     ` Ludovic Courtès
2016-11-27  2:22       ` 宋文武

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760nd4yxw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=iyzsong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.