Skip to content

Commit 1201986

Browse files
authored
warn when the PublicSuffixList file is more than 6 months old (#416)
On startup or config reload, stat() the PSL file after a successful load and emit a LOG_WARNING pointing to the canonical download URL if the mtime is older than 180 days.
1 parent b0123d3 commit 1201986

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

opendmarc/opendmarc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,22 @@ dmarcf_config_reload(void)
16671667
dmarcf_config_free(new);
16681668
err = TRUE;
16691669
}
1670+
else if (new->conf_dolog)
1671+
{
1672+
struct stat pslst;
1673+
1674+
if (stat(new->conf_pslist, &pslst) == 0)
1675+
{
1676+
time_t age = time(NULL) - pslst.st_mtime;
1677+
/* 180 days in seconds */
1678+
if (age > 180 * 24 * 60 * 60)
1679+
{
1680+
syslog(LOG_WARNING,
1681+
"%s: public suffix list is more than 6 months old; consider getting a fresh copy from https://publicsuffix.org/list/public_suffix_list.dat",
1682+
new->conf_pslist);
1683+
}
1684+
}
1685+
}
16701686
}
16711687

16721688
if (!err)

0 commit comments

Comments
 (0)