Email configuration #9
69
modules/mail.nix
Normal file
|
@ -0,0 +1,69 @@
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
let hostname = "mail.test.stramke.com";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
in {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
networking.firewall.allowedTCPPorts = [ 25 587 143];
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
services = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
postfix = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
enable = true;
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
hostname = "${hostname}";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
config = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
myorigin = "mail.test.stramke.com";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
mydestination = "127.0.0.1";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
smtpd_recipient_restrictions = [
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
"reject_unauth_destination"
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
"permit_sasl_authenticated"
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
];
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
smtpd_sasl_auth_enable = true;
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
smtpd_sasl_path = "/var/lib/postfix/auth";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
smtpd_sasl_type = "dovecot";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
smtpd_relay_restrictions = [
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
"reject_unauth_destination"
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
# "relay_domains = "${hostname}"
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
"permit_sasl_authenticated"
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
];
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
dovecot2 = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
enable = true;
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
enableImap = true;
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
enableQuota = false;
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
mailboxes = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
Spam = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
auto = "create";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
specialUse = "Junk";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
Sent = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
auto = "create";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
specialUse = "Sent";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
Drafts = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
auto = "create";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
specialUse = "Drafts";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
Trash = {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
auto = "create";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
specialUse = "Trash";
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
extraConfig = ''
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
mail_location = mbox:~/mail:INBOX=/var/mail/%u
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
# auth_mechanisms = plain login
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
# disable_plaintext_auth = no
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
userdb {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
driver = passwd
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
args = blocking=no
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
}
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
service auth {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
unix_listener /var/lib/postfix/auth {
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
group = postfix
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
mode = 0660
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
user = postfix
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
}
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
user = dovecot2
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
}
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
'';
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
};
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
}
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
|||||||
|
|
||||||
`sops.config.secrets.portunus_search.path`
`/var/lib/mail`
`rspamd.ifsr.de`
|
sops.config.secrets.portunus_search.path
/var/lib/mail
rspamd.ifsr.de