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 0470481214; Fri, 21 Oct 2022 13:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666359954; bh=33Ll5POuE/rKL10bH6RIuSaVPpgUBEIPLGmP5bPcUlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ohfu89BriX9dyvKtkN60sXOYyCWMout+yEHUcJxZoQRN83cyg7QitDENksISgkMYM UWJetj9lqM607Q+pafogRZUUiWrlPf6gAdq5jfQAnxkHac0hl6RSpuvE8mzt2wahHQ 3u6UGt/Kb8NRqYwEfwKujS8QGfKvjEK+wYA+WnP9plQRuRO/f3NfR1nqy33/1LUxlz YdjrtSU665RezCujoFmyJMus8SXLXM4/IhK1msytqhK60b3/ax5b6baY9435H4Poag qoiQKis/H8/CFArPliKbsSbUSi4z0bk2ObKlujmkj//UwIiGUdUGrQg5+FQyaMpOPk zczmxwRmhR8UA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v3 7/9] atom: Improve extract_body() Date: Fri, 21 Oct 2022 20:45:18 +0700 Message-Id: <20221021134520.701-8-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221021134520.701-1-kiizuha@gnuweeb.org> References: <20221021134520.701-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 ed5ca03..6a9e5c8 100644 --- a/daemon/atom/utils.py +++ b/daemon/atom/utils.py @@ -151,6 +151,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