From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30943 invoked from network); 28 Oct 2021 14:36:59 -0000 Received: from lists.gnu.org (209.51.188.17) by inbox.vuxu.org with ESMTPUTF8; 28 Oct 2021 14:36:59 -0000 Received: from localhost ([::1]:33172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mg6WX-0005ax-BJ for ml@inbox.vuxu.org; Thu, 28 Oct 2021 10:36:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg0hX-0001Cz-U2 for info-gnus-english@gnu.org; Thu, 28 Oct 2021 04:23:55 -0400 Received: from mail2.netnod.se ([192.71.80.75]:52061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg0hV-0006ka-Jk for info-gnus-english@gnu.org; Thu, 28 Oct 2021 04:23:55 -0400 Received: from hiptop.liman.net (localhost [IPv6:::1]) by hiptop.liman.net (Postfix) with ESMTP id A79B810D8DC6; Thu, 28 Oct 2021 10:23:48 +0200 (CEST) (envelope-from liman@netnod.se) From: Lars-Johan Liman To: Lars-Johan Liman Subject: Re: Filtering out calendar invites? References: <22lf2eqym5.fsf@hiptop.liman.net> Date: Thu, 28 Oct 2021 10:23:48 +0200 In-Reply-To: <22lf2eqym5.fsf@hiptop.liman.net> (Lars-Johan Liman's message of "Wed, 27 Oct 2021 17:24:50 +0200") Message-ID: <22ilxhimln.fsf@hiptop.liman.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=192.71.80.75; envelope-from=liman@netnod.se; helo=mail2.netnod.se X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 28 Oct 2021 10:34:17 -0400 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: info-gnus-english@gnu.org Errors-To: info-gnus-english-bounces+ml=inbox.vuxu.org@gnu.org Sender: "info-gnus-english" Whooa! I'm backing up! My hack actually seems to work! ;-) In case anyone googles this thread: this seems to work for me. Happy to hear feedback from others. I put this as one of the entries in my nnmail-split-fancy variable. It's a bit crude as it doesn't assert that the string is actually a MIME tag and not just part of the text in the message, but I'll live with the risk ... ;-) (: (lambda nil (save-excursion (save-restriction (widen) (goto-char (point-min)) (when (re-search-forward ;; The regexp "\\s-+" means "one or more whitespace chars". "^Content-Type:\\s-+text/calendar" nil t) "calendar") )))) Cheers, /Liman info-gnus-english@cafax.se 2021-10-27 17:24 [+0200]: > Hi again! > (I'm positively surprised at the amount of list traffic my previous > simple question generated and very thankful for the attention it got, so > let's see about this one. ;-) ) > I use the "imap" backend to download all mail and I want to filter out > messages that contain calendar invites in my incoming mail flow. > The trigger is that they contain a MIME message part with "Content-Type: > text/calendar". > I understand that the body may not be downloaded at the point of > splitting, but the IMAP protocol has the ability to list the > content-type of all MIME parts of a message on the server. > Is it possible to access that list of MIME parts and use it in a custom > function "(: (lambda nil ( ...)) )"in the nnmail-split-fancy variable? > If so, please hint or point me to RTFM. > Or is there a better/simpler way? > Cheers, > /Liman > -- > #------------------------------------------------------------------------- > # Lars-Johan Liman, M.Sc. ! E-mail: info-gnus-english@cafax.se > # Cafax AB ! HTTP : //www.cafax.se/ > # Computer Consultants, Sweden ! Voice : +46 8 - 564 702 30 > #-------------------------------------------------------------------------