Activity log for bug #1999434

Date Who What changed Old value New value Message
2022-12-12 19:52:28 Matthias Hunstock bug added bug
2022-12-12 19:52:28 Matthias Hunstock attachment added Fix subdomain matching with SigningTable/KeyTable https://bugs.launchpad.net/bugs/1999434/+attachment/5635422/+files/subdomain-matching.patch
2022-12-12 20:02:00 Matthias Hunstock description Expected behaviour: Given the following setup: root@mailrouter:/etc/dkimpy-milter# cat KeyTable.txt key1 example.com:dkim-1:/etc/ssl/private/dkim-1.key key2 example.net:dkim-2:/etc/ssl/private/dkim-2.key root@mailrouter:/etc/dkimpy-milter# cat SigningTable.txt *@example.com key1 *example.com key1 *@example.net key2 *example.net key2 it should be possible - according to docs - to sign all subdomains of example.com with dkim-1._domainkey.example.com instead of having to create a DNS entry for each subdomain. Actual result: No signing takes place. Probable cause: In get_identities_sign in the milter class self.domains is an empty array since the config values Domain etc. are not used, and in the code path executed when using the Table files the domain array is not pre-filled with all known domains but instead the current domain is added on-the-fly when a match is found. Since self.domains is not pre-filled, the get_parent_domain also does cannot do its job. Proposed fix: The attached patch adds a domain found in the keytable - at a point in the code where it is decided that the corresponding credentials can be used for signing - to self.domains so that the if-condition later on (around line 204) can succeed and signing actually takes place. It is found to be a working minimal change. Expected behaviour: Given the following setup: root@mailrouter:/etc/dkimpy-milter# cat KeyTable.txt key1 example.com:dkim-1:/etc/ssl/private/dkim-1.key key2 example.net:dkim-2:/etc/ssl/private/dkim-2.key root@mailrouter:/etc/dkimpy-milter# cat SigningTable.txt *@example.com key1 *example.com key1 *@example.net key2 *example.net key2 it should be possible - according to docs - to sign all subdomains of example.com with dkim-1._domainkey.example.com instead of having to create a DNS entry for each subdomain. Actual result: No signing takes place. Probable cause: In get_identities_sign in the milter class self.domains is an empty array since the config values Domain etc. are not used, and in the code path executed when using the Table files the domain array is not pre-filled with all known domains but instead the current domain is added on-the-fly when a match is found. Since self.domains is not pre-filled, the get_parent_domain also cannot do its job. Proposed fix: The attached patch adds a domain found in the keytable - at a point in the code where it is decided that the corresponding credentials can be used for signing - to self.domains so that the if-condition later on (around line 204) can succeed and signing actually takes place. It is found to be a working minimal change.
2022-12-12 23:03:52 Scott Kitterman dkimpy-milter: importance Undecided Medium
2022-12-12 23:03:52 Scott Kitterman dkimpy-milter: status New Triaged
2022-12-12 23:03:52 Scott Kitterman dkimpy-milter: milestone 1.2.3
2023-02-27 00:49:27 Scott Kitterman dkimpy-milter: status Triaged Fix Committed
2023-02-27 01:16:49 Scott Kitterman dkimpy-milter: status Fix Committed Fix Released