Files
Chickadee/modules/mail.nix
T

63 lines
1.3 KiB
Nix
Raw Normal View History

2026-07-29 18:21:26 -04:00
{ config, lib, pkgs, ... }:
{
2026-09-25 14:32:09 -04:00
services.maddy = {
enable = true;
ensureAccounts = [ "lilac@grasswren.net" ];
ensureCredentials."lilac@grasswren.net".passwordFile = config.sops.secrets.mxpass.path;
secrets = [ config.sops.secrets.cftoken.path ];
tls = {
loader = "acme";
extraConfig = ''
2026-09-26 16:59:53 -04:00
hostname $(hostname)
2026-09-25 14:32:09 -04:00
email lilac@grasswren.net
agreed
challenge dns-01
dns cloudflare {
api_token "{env:CFTOKEN}"
}
'';
};
2026-09-26 16:59:53 -04:00
primaryDomain = "grasswren.net";
hostname = "grasswren.net";
2026-09-25 14:32:09 -04:00
2026-09-26 16:59:53 -04:00
config = ''
auth.pass_table local_authdb {
table sql_table {
driver sqlite3
table_name passwords
dsn auth.db
}
2026-09-25 14:32:09 -04:00
}
2026-09-26 16:59:53 -04:00
storage.imapsql local_mailboxes {
2026-09-25 14:32:09 -04:00
driver sqlite3
dsn mailbox.db
}
smtp tcp://0.0.0.0:25 {
default_source {
destination grasswren.net {
modify {
replace_rcpt regexp ".*" "lilac@grasswren.net"
}
2026-09-26 16:59:53 -04:00
deliver_to &local_mailboxes
2026-09-25 14:32:09 -04:00
}
default_destination {
reject 550 5.1.1 "No Such User"
}
}
}
imap tls://0.0.0.0:993 {
2026-09-26 16:59:53 -04:00
auth &local_authdb
storage &local_mailboxes
2026-09-25 14:32:09 -04:00
}
'';
};
2026-07-29 18:21:26 -04:00
}