leading dot causes wrong signature

Bug #2036189 reported by Stefan Krause
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkimpy
Invalid
Undecided
Unassigned

Bug Description

Hi,

found a serious error causing a miscalculated hash.

If any line from body starts with a dot (.), mail signing ends with a wrong signature.

You can test this with the following commands.

working:
echo "message text" | mail -s "Testmail" <email address hidden> -f <email address hidden>
printf "Subject: Testmail\n\nmessage text" | <email address hidden> -f <email address hidden>

causing error:
echo ".message text" | mail -s "Testmail" <email address hidden> -f <email address hidden>
printf "Subject: Testmail\n\n.message text" | <email address hidden> -f <email address hidden>

Reproduced the error with opensmtpd/jammy,now 6.8.0p2 on Ubuntu 22.04.3 LTS and opensmtpd-6.8.0,1 on FreeBSD 12.4.

Could you please fix this the problem?

Kind regards

Stefan

Stefan Krause (krauses)
Changed in dkimpy:
status: New → Invalid
Revision history for this message
Stefan Krause (krauses) wrote :

After some further research the problem is not related to dkimpy!

http://www.opendkim.org/libopendkim/dkim_body.html
"Dot stuffing and the terminating dot in the message body are expected to be removed by the caller." see the notes

openSMTPD masks a leading dot with an additional dot, which is a correct behaviour according to RFC.
https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2

The problem was caused by the used OpenSMTPD -> dkimpy integration.
https://gist.github.com/palant/c6ad869a1dd2cd79506898e4e8401438

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.