Active state in DNS DMARC editor not shown correctly
Summary
There are at least three places where the active status of the DNS DMARC record can be viewed or set. Two places seem to work, while the third does not work.
-
DNS->Zones->example.com->Records The first interface lets you view the active status, but not change the active status of the DMARC record. The first interface works correctly.
-
DNS->Zones->example.com->Records->RAW TXT Edit The second interface lets you view and set the active status of the DMARC record. The second interface works correctly.
-
DNS->Zones->example.com->DMARC Button Edit The third interface lets you view and set the active status of the DMARC record. The third interface does not work correctly. The third interface will always say that the DMARC record is inactive (not checked), no matter what the actual active status of the DMARC record really is. If you save the record using the third interface, the record will be saved with whichever active or inactive option you selected. However, when the record is saved, the page is refreshed and it will still say that the record is inactive (unchecked), no matter what the true active status of the DMARC record really is.
Proposed fix
I tried to fix this by editing the following files: dns/form/dns_dmarc.tform.php dns/dns_dmarc_edit.php
There is some commented code in the dns/dns_dmarc_edit.php file which makes me think that someone else has already tried to fix this issue but was also unsuccesful. Maybe that's why this bug has existed for many many many years. Hopefully someone else who knows the code better than I can look at it and easily fix this bug. I look forward to seeing the fix so that I can learn the ISPC code a little bettter.
Commented code in dns/dns_dmarc_edit.php file
//if ($rec['active'] == 'Y') $app->tpl->setVar("active", "CHECKED"); else $app->tpl->setVar("active", "UNCHECKED");
Environment
ISPConfig 3.2.11p2 Debian 11
Related log entries
issue-fix-dmarc-ui