leading dot causes wrong signature
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\
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
Changed in dkimpy: | |
status: | New → Invalid |
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. /www.rfc- editor. org/rfc/ rfc5321# section- 4.5.2
https:/
The problem was caused by the used OpenSMTPD -> dkimpy integration. /gist.github. com/palant/ c6ad869a1dd2cd7 9506898e4e84014 38
https:/