Add smtp and imap email server
This commit is contained in:
@@ -5,6 +5,7 @@ subdomains.
|
|||||||
|
|
||||||
## Current features:
|
## Current features:
|
||||||
- Automatic SSL certificates via ACME DNS challenges
|
- Automatic SSL certificates via ACME DNS challenges
|
||||||
|
- Automatic backups with restic
|
||||||
- NGINX webserver
|
- NGINX webserver
|
||||||
- ATProto PDS at https://pds.tty.garden
|
- ATProto PDS at https://pds.tty.garden
|
||||||
- Gitea instance at https://seed.tty.garden
|
- Gitea instance at https://seed.tty.garden
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
./modules/nginx.nix
|
./modules/nginx.nix
|
||||||
./modules/gitea.nix
|
./modules/gitea.nix
|
||||||
./modules/pds.nix
|
./modules/pds.nix
|
||||||
|
./modules/mail.nix
|
||||||
./modules/restic.nix
|
./modules/restic.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
39
modules/mail.nix
Normal file
39
modules/mail.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{pkgs, config, ...}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(builtins.fetchTarball {
|
||||||
|
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-25.11/nixos-mailserver-nixos-25.11.tar.gz";
|
||||||
|
sha256 = "0pqc7bay9v360x2b7irqaz4ly63gp4z859cgg5c04imknv0pwjqw";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
mailserver = {
|
||||||
|
enable = true;
|
||||||
|
stateVersion = 3;
|
||||||
|
fqdn = "mail.tty.garden";
|
||||||
|
domains = [ "tty.garden" ];
|
||||||
|
|
||||||
|
loginAccounts = {
|
||||||
|
"nmcdaniel@tty.garden" = {
|
||||||
|
hashedPasswordFile = "/root/email_hashed/admin";
|
||||||
|
aliases = [ "postmaster@tty.garden" "admin@tty.garden" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
certificateScheme = "acme";
|
||||||
|
acmeCertificateName = "tty.garden";
|
||||||
|
};
|
||||||
|
|
||||||
|
# SMTP Relay Configuration
|
||||||
|
# This can be omitted once SMTP outbound connections are unblocked
|
||||||
|
services.postfix = {
|
||||||
|
settings.main = {
|
||||||
|
relayhost = [ "[smtp.resend.com]:587" ];
|
||||||
|
# Must have associated .db made with postmap in the same directory
|
||||||
|
smtp_sasl_password_maps = "hash:/root/sasl_passwd";
|
||||||
|
smtp_sasl_auth_enable = true;
|
||||||
|
smtp_sasl_security_options = "";
|
||||||
|
smtp_use_tls = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
paths = [
|
paths = [
|
||||||
"/var/www" # Webserver data
|
"/var/www" # Webserver data
|
||||||
"/var/lib/pds" # ATProto PDS
|
"/var/lib/pds" # ATProto PDS
|
||||||
|
"/var/vmail" # Email Mailbox
|
||||||
"/home" # User data
|
"/home" # User data
|
||||||
"${config.services.gitea.stateDir}/dump" # Gitea repository
|
"${config.services.gitea.stateDir}/dump" # Gitea repository
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user