From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fernando de Morais Newsgroups: gmane.emacs.help Subject: Re: Rmail tips Date: Thu, 15 Feb 2024 10:21:55 -0300 Message-ID: <87y1blx3po.fsf@gmail.com> References: <87le7t68k5.fsf@benghancock.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2308"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Ben Hancock Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 15 14:24:14 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rabio-0000KA-OF for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 15 Feb 2024 14:24:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rabi1-0000Gj-PM; Thu, 15 Feb 2024 08:23:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rabi0-0000GQ-E5 for help-gnu-emacs@gnu.org; Thu, 15 Feb 2024 08:23:24 -0500 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rabhy-0003fZ-Or for help-gnu-emacs@gnu.org; Thu, 15 Feb 2024 08:23:24 -0500 Original-Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5d8b70b39efso758640a12.0 for ; Thu, 15 Feb 2024 05:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708003388; x=1708608188; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=uDsdXZLP1Jxjm+K4ZXk9e4Hh9AQDfukoqvvTPBqb1r4=; b=jFEw/+Y8ABu0KvbO6qyo/VxbfZ5H7p6n3o+k/sDO5pa8Fz2+PDsHvHUdHT3dXJ/L9u LifpSfSW/38FFJ92KH6xYvZ2X9x/4FGptr2rV8uhIYvr4KsEk5pGwg/GikRf5OdPfOlN UwYpNtUObgXau3v0gu++ZnySgHxiD0Qu6ln4W/jrWFMUgEqDtGKNJgtxzt1RFowaPeUR ftMEgqWNk22T6BI/1FQCaexgBZ8xx4f+wbnNOcM9W6Bdn9Opa28H/V2Mgh5GuXHv2SI5 t4qoWxlRwulppYn1vM3x3fuxz80ZFVERcv56+DobNxLm0EfW1AgmFXQyJFJlRKSfo2cG iHvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708003388; x=1708608188; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uDsdXZLP1Jxjm+K4ZXk9e4Hh9AQDfukoqvvTPBqb1r4=; b=n0MuyfMdwFlwUT0X7jLthuG0GTReJ+6c8aSpOsb4UpmyzNh3BCd7hZNhR80CnC+DiT tDIfrof9ofRGH/HmiOF+nQOJJDFBjVyjvhfg8lTKJ9J9GoN3AUZuBnS3OMPjwvGjELjP 0vG7ScAFawIrmJRhzFBDEUZ0zI867j39A8Hyt3gcb6CWLfY0eJvRlPmPBc2h1OR1bTFE qd3HGagCgdhCtSvp0aiX8Z1NSxN3cXb/rVNtTNDGpe9VTJZ3ktzA8GCsDG+mZxVgKe0Z +i2iUOsB++smvVb57mh4iYStOTF2qWMPXbOE4euw5GAg0ZwtnNUdpiJG5uuh3PogQ40k +wPQ== X-Gm-Message-State: AOJu0Yywy8NXdT8lG3duiaGbmID/DTmbrmKzOVaOQb4is+PY19LwdrU3 q7zJK/WG8XYrN32ItxnwSrskBsf7+iDdhQ11RJqURVlJnxuLh0VGon5W1lS8 X-Google-Smtp-Source: AGHT+IGaZyFayepaftCFMBciF7raCnYtI9sMHQFAwxbwAChsG9S+9k+JT9coGWUDcc1mI9INtYbdKQ== X-Received: by 2002:a17:90a:348c:b0:298:d216:a113 with SMTP id p12-20020a17090a348c00b00298d216a113mr1514108pjb.2.1708003387868; Thu, 15 Feb 2024 05:23:07 -0800 (PST) Original-Received: from sekai ([2804:14c:da80:9b02::3685]) by smtp.gmail.com with ESMTPSA id w64-20020a17090a6bc600b00298c373a820sm1519457pjj.23.2024.02.15.05.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 05:22:37 -0800 (PST) In-Reply-To: <87le7t68k5.fsf@benghancock.com> (Ben Hancock's message of "Fri, 09 Feb 2024 06:01:14 -0800") Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=fernandodemorais.jf@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145953 Archived-At: Hello Ben, Sorry for my late response (again). Ben Hancock writes: > Thanks for your kind reply and these helpful snippets, Fernando. I just > recently started using Mairix, which has been great. You're welcome! > I've tried using the rmail-automatic-folder-directives variable to > handle this, but it has the downside that mails are marked as seen when > they are filed away; they also still land in the main RMAIL file first. > > My MTA (maildrop) of course can put incoming mails into specific files > based on conditions. But if I just visit those files with RMAIL, i.e. by > using the 'i' command, there is also no distinction between what is old > and what is unseen. It seems that I would have to configure those files > as separate _inboxes_, and fetch mail from them into another RMAIL file. > > That's doable, but I'm wondering if there's another way ... or if I > should abandon filtering altogether and just search? Perhaps you can customize the `rmail-auto-file' function (which is called when Rmail is obeying the `rmail-automatic-folder-directives') to use `rmail-set-attribute' and, therefore, force the insertion of the `unseen' attribute in messages. Maybe like this: #+begin_src emacs-lisp (defun rmail-auto-file () ... (if (null directive-loop) (if (null folder) (rmail-delete-forward) (if (string= "/dev/null" folder) (rmail-delete-message) (rmail-set-attribute rmail-unseen-attr-index t) ; ==> Here? (rmail-output folder 1) (setq d nil)))) (setq d (cdr d)))))) #+end_src Unfortunately, at the moment, I can't test whether just this insertion is enough, but if you can (and if it works), do you think it would cover your use case? Hope it helps! -- Regards, Fernando de Morais.