From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.123]) by gnuweeb.org (Postfix) with ESMTPSA id 51BE380AB2; Thu, 20 Oct 2022 08:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666255160; bh=GIsaFHStl3rI6zUmh/tYHnA5Nw5xhn8Cuku0qAszIv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dBAkyIhCmJyB9QKgFJb5XRFSNX1Lj7E4GxCWdu/XHpSQqe50YmWnztUt4p04cXWIu 1aKmaxAEycHEEvhdNUDV3+UltN1ZLSRkNL8x4zKz9+gBxKedqhtj0Bmfz2kBs5vjY4 qIKWZlcr1zvPtyj8lKjbKkMjnBAx/6XBqw8XAPpPGsusJBhOgqY7aSkr0cyIvHopkY rWXGFKvszupqmwpUcPZ47uZD6Jk3f0hlKZeAVDpxWg50bOOQyLnMZ9DUS9H+adXwAE uT8RTpKpD79yDuMKaa8VkT5aocSU5ic+8Y6b4k0rvGnmmlbAMiX4FQv7Cqz/op+UNc LljQL5yidv7Rw== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 8/8] atom: Improve extract_body() Date: Thu, 20 Oct 2022 15:38:45 +0700 Message-Id: <20221020083845.907-9-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221020083845.907-1-kiizuha@gnuweeb.org> References: <20221020083845.907-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add an if statement to ignore whenever the email payload containing a text/html content-type header. Signed-off-by: Muhammad Rizki --- daemon/atom/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/atom/utils.py b/daemon/atom/utils.py index e8b9d80..cdfa5a7 100644 --- a/daemon/atom/utils.py +++ b/daemon/atom/utils.py @@ -150,6 +150,9 @@ def extract_body(thread: Message, platform: str): fname = p.get_filename() payload = p.get_payload(decode=True) + if p.get("content-type").split(";")[0] == "text/html": + continue + if not payload: continue -- Muhammad Rizki