Commit Diff


commit - 5d06ccade46dd933c72765df1177d3feca380e33
commit + f5286ea3aa39c8294713b86bd5e283245349e9ea
blob - 99877fc2c48e4cfcd9822df4e394b9ead3a37b64
blob + d182879adf1a9824bfc75aef03796845e23c89b6
--- main.c
+++ main.c
@@ -234,11 +234,7 @@ dkim_dataline(char *type, int version, struct timespec
 	if (fprintf(session->origf, "%s\r\n", line) < linelen)
 		dkim_err(session, "Couldn't write to tempfile");
 
-	if (linelen !=  0 && session->parsing_headers) {
-		dkim_parse_header(session, line, 0);
-	} else if (linelen == 0 && session->parsing_headers) {
-		session->parsing_headers = 0;
-	} else if (line[0] == '.' && line[1] =='\0') {
+	 if (line[0] == '.' && line[1] =='\0') {
 		/* This entire section needs an error handling revamp */
 		if (canonbody == CANON_SIMPLE && !session->has_body) {
 			if (EVP_DigestUpdate(session->bh, "\r\n", 2) <= 0) {
@@ -328,8 +324,17 @@ dkim_dataline(char *type, int version, struct timespec
 			    "%s", tmp);
 		}
 		dkim_session_free(session);
-	} else
+	} else if (linelen !=  0 && session->parsing_headers) {
+		if (line[0] == '.')
+			line++;
+		dkim_parse_header(session, line, 0);
+	} else if (linelen == 0 && session->parsing_headers) {
+		session->parsing_headers = 0;
+	} else {
+		if (line[0] == '.')
+			line++;
 		dkim_parse_body(session, line);
+	}
 }
 
 struct dkim_session *