]> Untitled Git - MarigoldOS/.git/blob - profiles/mail.nix
Initial Commit
[MarigoldOS/.git] / profiles / mail.nix
1 { config, pkgs, ... }:
2 let
3   fqdn = "${config.networking.hostName}.${config.networking.domain}";
4 in{
5   mailserver = {
6     enable = true;
7     fqdn = "mail.${fqdn}";
8     domains = [ "${fqdn}" ];
9     # A list of all login accounts. To create the password hashes, use
10     # mkpasswd -m sha-512 "super secret password"
11     loginAccounts = {
12       "admin@${fqdn}" = {
13         # nix-shell -p mkpasswd --run "mkpasswd -m sha-512 easypassword"
14         hashedPassword = "$6$mwL/Pqv4WZHIP7j.$rU2inAQ8QCICBPCF5MiITptHcbZopBqwHYDudxBHun3zfnaAINqCDaeC/uq7CrzgNtDF2HbFEikz7GYNX6kXZ.";
15         aliases = [
16           "postmaster@${fqdn}"
17           "webmaster@${fqdn}"
18           "abuse@${fqdn}"
19         ];
20       };
21     };
22     # Extra virtual aliases. These are email addresses that are forwarded to
23     # loginAccounts addresses.
24     extraVirtualAliases = {
25       # address = forward address;
26       #"abuse@${fqdn}" = "postmaster@${fqdn}";
27     };
28     # Use Let's Encrypt certificates. Note that this needs to set up a stripped
29     # down nginx and opens port 80.
30     certificateScheme = 3;
31     # Enable IMAP and POP3
32     enableImap = false;
33     enableImapSsl = true;
34     enableSubmission = false;
35     enableSubmissionSsl = true;
36     # Enable the ManageSieve protocol
37     enableManageSieve = true;
38     # whether to scan inbound emails for viruses (note that this requires at least
39     # 1 Gb RAM for the server. Without virus scanning 256 MB RAM should be plenty)
40     virusScanning = false;
41     localDnsResolver = false;
42   };
43 }