Browse Source

Get postfix working

mailold
m1cr0man 2 years ago
parent
commit
2dc17deff3
1 changed files with 10 additions and 7 deletions
  1. +10
    -7
      services/postfix/default.nix

+ 10
- 7
services/postfix/default.nix View File

@@ -3,16 +3,20 @@ let
common = import ../../common/variables.nix;

ldapCommon = ''
server_host = ldap://ldap.internal/
server_host = ldap://${common.ldapHost}/
version = 3
bind = no
'';

virtualMailboxMaps = pkgs.writeText "virt-mailbox-maps" ldapCommon + ''
virtualMailboxMaps = pkgs.writeText "virt-mailbox-maps" (ldapCommon + ''
search_base = ou=accounts,o=redbrick
query_filter = (&(objectClass=posixAccount)(uid=%u))
result_attribute = uid
result_format = %s@${common.tld}
'');

virtualMailboxDomains = pkgs.writeText "virt-mailbox-domains" ''
redbricktest.ml
'';

commonRestrictions = [
@@ -31,7 +35,7 @@ in {
setSendmail = true;
origin = common.tld;
hostname = "mail.${common.tld}";
destination = ["mail.${common.tld}" "localhost"];
destination = ["localhost"];
recipientDelimiter = "+";

sslCert = "${common.certsDir}/${common.tld}/fullchain.pem";
@@ -55,14 +59,13 @@ in {
# IP address used by postfix to send outgoing mail. You only need this if
# your machine has multiple IP addresses - set it to your MX address to
# satisfy your SPF record.
# TODO allow this machine to connect to public addresses to send mail
inet_protocols = "ipv4";
smtp_bind_address = "192.168.0.135";
# http://www.postfix.org/BASIC_CONFIGURATION_README.html#proxy_interfaces
proxy_interfaces = "136.206.15.5";

virtual_mailbox_domains = "static:${common.tld}";
virtual_mailbox_maps = "ldap:${virtualMailboxMaps}";
# virtual_alias_maps = "ldap:" ++ ./ldap-virtual-alias-maps.cf;
virtual_alias_domains = "${common.tld}";
virtual_alias_maps = "hash:/var/lib/postfix/aliases";

# Generate own DHParams
smtpd_tls_dh512_param_file = config.security.dhparams.params.smtpd_512.path;


Loading…
Cancel
Save