Add initial support for DKIM signature verification

The function has been extracted from the while loop in PR #712