Jump to content

Stalwart: Difference between revisions

273 bytes added ,  Friday at 12:47
m
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


== Setup ==
== Setup ==
 
The following minimal configuration example is unsecure and for testing purpose only. It will run the Stalwart mail server on <code>localhost</code>, listening on port <code>143</code> (IMAP) and <code>587</code> (Submission). Users <code>alice</code> and <code>bob</code> are configured with the password <code>foobar</code>.{{file|/etc/nixos/configuration.nix|nix|3=services.stalwart-mail = {
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.stalwart-mail = {
   enable = true;
   enable = true;
  # Use newer, latest version in NixOS 24.05
  package = pkgs.stalwart-mail;
   settings = {
   settings = {
    certificate."snakeoil" = {
      cert = "file://${certs.${domain}.cert}";
      private-key = "file://${certs.${domain}.key}";
    };
     server = {
     server = {
       hostname = domain;
       hostname = "localhost";
       tls = {
       tls.enable = false;
        certificate = "snakeoil";
        enable = true;
        implicit = false;
      };
       listener = {
       listener = {
         "smtp-submission" = {
         "smtp-submission" = {
Line 29: Line 21:
       };
       };
     };
     };
     session = {
     imap.auth.allow-plain-text = true;
      rcpt.directory = "in-memory";
    session.auth = {
      auth = {
      mechanisms = "[plain, auth]";
        mechanisms = [ "PLAIN" ];
      directory = "'in-memory'";
        directory = "in-memory";
      };
     };
     };
     jmap.directory = "in-memory";
     storage.directory = "in-memory";
     queue.outbound.next-hop = [ "local" ];
    session.rcpt.directory = "'in-memory'";
     queue.outbound.next-hop = "'local'";
     directory."in-memory" = {
     directory."in-memory" = {
       type = "memory";
       type = "memory";
       users = [
       principals = [
         {
         {
          class = "individual";
           name = "alice";
           name = "alice";
           secret = "foobar";
           secret = "foobar";
           email = [ "alice@${domain}" ];
           email = [ "alice@localhost" ];
         }
         }
         {
         {
          class = "individual";
           name = "bob";
           name = "bob";
           secret = "foobar";
           secret = "foobar";
           email = [ "bob@${domain}" ];
           email = [ "bob@$localhost" ];
         }
         }
       ];
       ];
     };
     };
   };
   };
};
};}}
</nowiki>}}


== See also ==
== See also ==
63

edits