tfc-nixos/modules/mail.nix
2025-05-21 11:21:52 -05:00

52 lines
1.2 KiB
Nix

{ config, lib, pkgs, unstable, ... }:
let
dn = "mail.tfcconnection.org" ;
in
with lib;
{
mailserver = {
enable = true;
fqdn = dn;
domains = [ dn ];
mailboxes = {
Drafts = {
auto = "subscribe";
specialUse = "Drafts";
};
Junk = {
auto = "subscribe";
specialUse = "Junk";
};
Sent = {
auto = "subscribe";
specialUse = "Sent";
};
Trash = {
auto = "no";
specialUse = "Trash";
};
Archive = {
auto = "no";
specialUse = "Archive";
};
};
# A list of all login accounts. To create the password hashes, use
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
loginAccounts = {
"chris@${dn}" = {
hashedPassword = "$2b$05$xHEdyWDJPeJMJ1kp2imf/Ozcxe9BuAMvKfejxFM24AQga/cHw80M.";
aliases = ["postmaster@example.com"];
};
"no-reply@${dn}" = {
hashedPassword = "$2b$05$CT4nc60DaPlB01lft.HECuzz1q8a7iPWED86.9hDzL1kxbYwTK/Ga";
};
};
# Use Let's Encrypt certificates. Note that this needs to set up a stripped
# down nginx and opens port 80.
certificateScheme = "acme-nginx";
};
}