#802048 libmail-dkim-perl: reports mail as failing when DKIM-Signature header is folded with spaces

#802048#5
Date:
2015-10-17 10:19:22 UTC
From:
To:
If a DKIM-Signature header is unfolded and refolded with spaces (which seems to be a
somewhat valid operation) then dkimproxy-verify will report the message as
"fail (message has been altered)".  To fix a prolem with such a message you just have
to replace the spaces with tabs for folding that field.

This is a problem in that some versions of Mailman (such as 1:2.1.15-1+deb7u1 in
wheezy) refold the messages in that manner.  If libmail-dkim-perl was to treat a space
and a tab equally in the folding then it would correctly process signatures in Mailman
mail.

In a header such as the following dkimproxy-verify will happily accept spaces or tabs
for the start of the last 2 lines (IE during the b= part) but insists on tabs for the
first 3 continuation lines.  dkimproxy-verify is behaving inconsistently at best in
this regard.

DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=coker.com.au; s=2008;
        t=1444964800; bh=7596ihno1HYY/GD9qa21P7bjJEwMazstX8qEtki1p+M=;
        l=109; h=From:To:Subject:Date:From;
        b=MLKvwuhurZcRtq8BQGC0jKsDGwKiA3m7euJ/9oqVxUdwDNg+L5tOqyKq/baSXdZWS
         wYPzszDwG4qz/slhRW8imFuBennQwmaMmMXHyHo9MzI3/u2pGyY5kjez3kOAMZPNF2
         rwOus3SRxYqJmv9PAg+QiDoczFL/QBH9rZI9P9yg=