Skip to content

Commit 290525f

Browse files
committed
Remove DKIM-Signature from incoming mail after checking
1 parent e004a5e commit 290525f

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## untagged
44

5+
- Remove `DKIM-Signature` from incoming mails after verifying
6+
([#530](https://github.com/chatmail/server/pull/530))
7+
58
- Send SNI when connecting to outside servers
69
([#524](https://github.com/chatmail/server/pull/524))
710

cmdeploy/src/cmdeploy/__init__.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ def _configure_opendkim(domain: str, dkim_selector: str = "dkim") -> bool:
228228
)
229229
need_restart |= service_file.changed
230230

231-
232231
return need_restart
233232

234233

@@ -275,7 +274,18 @@ def _configure_postfix(config: Config, debug: bool = False) -> bool:
275274
)
276275
need_restart |= master_config.changed
277276

278-
header_cleanup = files.put(
277+
incoming_header_cleanup = files.put(
278+
src=importlib.resources.files(__package__).joinpath(
279+
"postfix/incoming_header_cleanup"
280+
),
281+
dest="/etc/postfix/incoming_header_cleanup",
282+
user="root",
283+
group="root",
284+
mode="644",
285+
)
286+
need_restart |= incoming_header_cleanup.changed
287+
288+
submission_header_cleanup = files.put(
279289
src=importlib.resources.files(__package__).joinpath(
280290
"postfix/submission_header_cleanup"
281291
),
@@ -284,7 +294,7 @@ def _configure_postfix(config: Config, debug: bool = False) -> bool:
284294
group="root",
285295
mode="644",
286296
)
287-
need_restart |= header_cleanup.changed
297+
need_restart |= submission_header_cleanup.changed
288298

289299
# Login map that 1:1 maps email address to login.
290300
login_map = files.put(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/^DKIM-Signature:/ IGNORE

cmdeploy/src/cmdeploy/postfix/master.cf.j2

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ smtps inet n - y - 5000 smtpd
5252
#628 inet n - y - - qmqpd
5353
pickup unix n - y 60 1 pickup
5454
cleanup unix n - y - 0 cleanup
55+
-o header_checks=regexp:/etc/postfix/incoming_header_cleanup
5556
qmgr unix n - n 300 1 qmgr
5657
#qmgr unix n - n 300 1 oqmgr
5758
tlsmgr unix - - y 1000? 1 tlsmgr

0 commit comments

Comments
 (0)