nixos-config/hosts/phantom/email.nix

62 lines
1.7 KiB
Nix
Raw Normal View History

{
pkgs,
inputs,
config,
...
}:
{
2024-03-28 21:56:52 -03:00
# It's important to let Digital Ocean set the hostname so we get rDNS to work
networking.hostName = "";
imports = [ inputs.nixos-mailserver.nixosModules.mailserver ];
2024-03-28 21:56:52 -03:00
mailserver = {
enable = true;
2024-05-11 18:00:19 -03:00
fqdn = "lelgenio.com";
2024-04-06 20:38:35 -03:00
domains = [
"lelgenio.xyz"
"git.lelgenio.xyz"
2024-05-11 18:00:19 -03:00
"lelgenio.com"
"git.lelgenio.com"
"social.lelgenio.com"
2024-04-06 20:38:35 -03:00
];
2024-03-28 21:56:52 -03:00
certificateScheme = "acme-nginx";
2024-04-06 20:38:35 -03:00
# Create passwords with
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
2024-03-28 21:56:52 -03:00
loginAccounts = {
2024-05-11 18:00:19 -03:00
"lelgenio@lelgenio.com" = {
hashedPassword = "$2y$05$z5s7QCXcs5uTFsfyYpwNJeWzb3RmzgWxNgcPCr0zjSytkLFF/qZmS";
aliases = [ "postmaster@lelgenio.com" ];
};
2024-03-28 21:56:52 -03:00
"lelgenio@lelgenio.xyz" = {
hashedPassword = "$2y$05$z5s7QCXcs5uTFsfyYpwNJeWzb3RmzgWxNgcPCr0zjSytkLFF/qZmS";
aliases = [ "postmaster@lelgenio.xyz" ];
};
2024-05-11 18:00:19 -03:00
"noreply@git.lelgenio.com" = {
2024-04-06 20:38:35 -03:00
hashedPassword = "$2b$05$TmR1R7ZwXfec7yrOfeBL7u3ZtyXf0up5dEO6uMWSvb/O7LPEm.j0.";
};
2024-05-11 18:32:05 -03:00
"noreply@social.lelgenio.com" = {
hashedPassword = "$2b$05$DcA9xMdvHqqQMZw2.zybI.vfKsQAJtaQ/JB.t9AHu6psstWq97m2C";
};
2024-03-28 21:56:52 -03:00
};
};
2024-05-03 12:32:45 -03:00
# Prefer ipv4 and use main ipv6 to avoid reverse DNS issues
services.postfix.extraConfig = ''
smtp_address_preference = ipv4
'';
2024-03-28 21:56:52 -03:00
# Webmail
2024-05-03 12:32:45 -03:00
services.roundcube = {
2024-03-28 21:56:52 -03:00
enable = true;
package = pkgs.roundcube.withPlugins (p: [ p.carddav ]);
2024-05-11 18:00:19 -03:00
hostName = "mail.lelgenio.com";
2024-03-28 21:56:52 -03:00
extraConfig = ''
2024-05-03 12:32:45 -03:00
$config['smtp_host'] = "tls://${config.mailserver.fqdn}:587";
2024-03-28 21:56:52 -03:00
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
2024-04-08 22:14:06 -03:00
$config['plugins'] = [ "carddav", "archive" ];
2024-03-28 21:56:52 -03:00
'';
};
}