2024-05-30 16:54:58 -03:00
|
|
|
{
|
|
|
|
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 = "";
|
|
|
|
|
2024-05-30 16:54:58 -03:00
|
|
|
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";
|
2024-05-31 21:46:49 -03:00
|
|
|
aliases = [
|
|
|
|
"postmaster@lelgenio.com"
|
|
|
|
"lelgenio@lelgenio.xyz"
|
|
|
|
"lelgenio@lelgenio.xyz"
|
|
|
|
];
|
2024-03-28 21:56:52 -03:00
|
|
|
};
|
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
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|