From a73ad71269a0e1a3cef6a565fbf688f757de82a6 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 28 May 2012 08:40:40 +0200 Subject: [PATCH] Only abort attachment insertion if an attachment with that hash was found for the currently parsed e-mail --- parse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse b/parse index 5b92fa8..f0b2503 100755 --- a/parse +++ b/parse @@ -184,7 +184,7 @@ for email_file in file_list: for attachment in attachment_list: if options['forced'] == False: - cursor.execute("SELECT * FROM attachments WHERE `Hash` = ?", (attachment[2],)) + cursor.execute("SELECT * FROM attachments WHERE `hash` = ? AND `message_hash` = ?", (attachment[2], sha1_hash)) if len(cursor.fetchall()) > 0: print "Skipping attachment %s, already exists in the database." % attachment[2] continue