diff --git a/src/signature.rs b/src/signature.rs index 481947c..6392c27 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -71,8 +71,10 @@ impl Signature { hasher.update(&header); } } - let dkim_header = self.get_header(); - let dkim_header = self.canonicalization.process_header(dkim_header.as_bytes()); + let dkim_header = format!("{}\r\n", self.get_header()); + let mut dkim_header = self.canonicalization.process_header(dkim_header.as_bytes()); + dkim_header.pop(); + dkim_header.pop(); hasher.update(dkim_header); hasher.finalize().to_vec() }