postfix: increase privacy by removing the first received header if the mail was sent to the submission port by an authorized user

This commit is contained in:
Daniel Frank 2019-06-21 22:12:58 +02:00
parent a2c0849d11
commit 8fb8cd65d5
Signed by: tokudan
GPG key ID: 063CCCAD04182D32

View file

@ -1,6 +1,9 @@
{ config, lib, pkgs, ... }:
let
submission_header_cleanup_regex = pkgs.writeText "submission_header_cleanup_regex" ''
/^Received:.*by ${config.variables.myFQDN} \(Postfix/ IGNORE
'';
pfvirtual_mailbox_domains = pkgs.writeText "virtual_mailbox_domains.cf" ''
dbpath = ${config.variables.pfadminDataDir}/postfixadmin.db
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'
@ -75,6 +78,13 @@ in
virtual_mailbox_maps = "proxy:sqlite:${pfvirtual_mailbox_maps}, proxy:sqlite:${pfvirtual_alias_domain_mailbox_maps}";
virtual_transport = "lmtp:unix:${config.variables.dovecotLmtpSocket}";
};
masterConfig.submission.args = [ "-o" "cleanup_service_name=submission_cleanup" ];
masterConfig."submission_cleanup" = {
command = "cleanup";
args = [ "-o" "header_checks=regexp:${submission_header_cleanup_regex}" ];
private = false;
maxproc = 0;
};
rootAlias = config.variables.mailAdmin;
postmasterAlias = config.variables.mailAdmin;
};