Remove DKIM-Signature from incoming mail after checking

This commit is contained in:
link2xt
2025-03-25 02:19:56 +00:00
parent e004a5e2f6
commit 290525f0fc
4 changed files with 18 additions and 3 deletions

View File

@@ -2,6 +2,9 @@
## untagged ## untagged
- Remove `DKIM-Signature` from incoming mails after verifying
([#530](https://github.com/chatmail/server/pull/530))
- Send SNI when connecting to outside servers - Send SNI when connecting to outside servers
([#524](https://github.com/chatmail/server/pull/524)) ([#524](https://github.com/chatmail/server/pull/524))

View File

@@ -228,7 +228,6 @@ def _configure_opendkim(domain: str, dkim_selector: str = "dkim") -> bool:
) )
need_restart |= service_file.changed need_restart |= service_file.changed
return need_restart return need_restart
@@ -275,7 +274,18 @@ def _configure_postfix(config: Config, debug: bool = False) -> bool:
) )
need_restart |= master_config.changed need_restart |= master_config.changed
header_cleanup = files.put( incoming_header_cleanup = files.put(
src=importlib.resources.files(__package__).joinpath(
"postfix/incoming_header_cleanup"
),
dest="/etc/postfix/incoming_header_cleanup",
user="root",
group="root",
mode="644",
)
need_restart |= incoming_header_cleanup.changed
submission_header_cleanup = files.put(
src=importlib.resources.files(__package__).joinpath( src=importlib.resources.files(__package__).joinpath(
"postfix/submission_header_cleanup" "postfix/submission_header_cleanup"
), ),
@@ -284,7 +294,7 @@ def _configure_postfix(config: Config, debug: bool = False) -> bool:
group="root", group="root",
mode="644", mode="644",
) )
need_restart |= header_cleanup.changed need_restart |= submission_header_cleanup.changed
# Login map that 1:1 maps email address to login. # Login map that 1:1 maps email address to login.
login_map = files.put( login_map = files.put(

View File

@@ -0,0 +1 @@
/^DKIM-Signature:/ IGNORE

View File

@@ -52,6 +52,7 @@ smtps inet n - y - 5000 smtpd
#628 inet n - y - - qmqpd #628 inet n - y - - qmqpd
pickup unix n - y 60 1 pickup pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup cleanup unix n - y - 0 cleanup
-o header_checks=regexp:/etc/postfix/incoming_header_cleanup
qmgr unix n - n 300 1 qmgr qmgr unix n - n 300 1 qmgr
#qmgr unix n - n 300 1 oqmgr #qmgr unix n - n 300 1 oqmgr
tlsmgr unix - - y 1000? 1 tlsmgr tlsmgr unix - - y 1000? 1 tlsmgr