From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: gnuforever Newsgroups: gmane.emacs.help Subject: Re: How to split (IMAP client side split) incoming mails into groups for multiple emails addresses with Gnus Date: Mon, 08 Jan 2018 22:08:20 +0000 Message-ID: <87wp0sypez.fsf@tuyizere.org> References: <86d12ltmc7.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515449288 30252 195.159.176.226 (8 Jan 2018 22:08:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 Jan 2018 22:08:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 08 23:08:04 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYfaN-0007Od-PR for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Jan 2018 23:08:03 +0100 Original-Received: from localhost ([::1]:33981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYfcL-0004SD-5J for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Jan 2018 17:10:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYfao-0003pE-PL for help-gnu-emacs@gnu.org; Mon, 08 Jan 2018 17:08:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYfaj-0007jo-QK for help-gnu-emacs@gnu.org; Mon, 08 Jan 2018 17:08:30 -0500 Original-Received: from erza.lautre.net ([80.67.160.89]:43424) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYfaj-0007i9-CR for help-gnu-emacs@gnu.org; Mon, 08 Jan 2018 17:08:25 -0500 Original-Received: from 1bec0f88a5e1 (d54c403e7.access.telenet.be [84.196.3.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by erza.lautre.net (Postfix) with ESMTPSA id 251017B83 for ; Mon, 8 Jan 2018 22:52:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tuyizere.org; s=alternc; t=1515448322; bh=aBJ/Jb36vIx8bPD1OTzfmKW5irnc3yI7jlEO24OWOBw=; h=From:To:Subject:References:Date:In-Reply-To; b=K3oTpaB8FPmeHQmr7ZERJLY/FGIhjRvIREYcNwCFgBme/s32R9btwuciVryX/THmb DSS85M34cHSI1OkZToaT92fbBF1fpsUkK07Z/buP+SUgkbuDBYn+Siz4oNr139jkkx 4Q6aAEQj76rLqaiElMLPHIvjcAmDHukcZHBGgpQA= In-Reply-To: <86d12ltmc7.fsf@zoho.com> (Emanuel Berg's message of "Sun, 07 Jan 2018 22:01:28 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.67.160.89 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115620 Archived-At: How should I do the split for my 2 imap accounts? I don't understand why "nnmail-split-methods" in "gnus-secondary-select-methods" doesn't work. Emanuel Berg writes: > gnuforever wrote: > >> (setq nnmail-split-methods '(("INBOX.folder1" >> "from:.*friends@domain.com") ("INBOX.folder2" >> "from:.*family@domain.com") ("INBOX" ""))) > > Case 1-2 looks backwards? > > Here is how it should look. > > For example to filter away ML messages which > you get thru NGs anyway: > > (setq nnmail-split-methods > '( > ("mail.ml-ooa" "\\(To\\|Cc\\):.*\\(emacs-w3m@namazu.org\\|\\(help-gnu-emacs\\|emacs-devel\\)@gnu.org\\|gmane-discuss@quimby.gnus.org\\|tex-live@tug.org\\|gnuplot-info@lists.sourceforge.net\\)") > ;; etc etc > ("mail.misc" "") > )) Thanks for this example. gnuforever writes: > Hi all, > > Happy GNU year 2018. > > I have different email addresses. For each address, I want to split incoming mails into groups. > So far I have managed to split incoming mails for one address with the code below: > > ;; IMAP > (setq gnus-select-method > '(nnimap "firstEmail@domain.com" > (nnimap-address "imapserver") > (nnimap-inbox "INBOX") > (nnimap-split-methods default) > (nnimap-expunge t) > (nnimap-stream ssl) > (nnimap-user "firstEmail@domain.com"))) > > (setq nnmail-split-methods > '(("INBOX.folder1" "from:.*friends@domain.com") > ("INBOX.folder2" "from:.*family@domain.com") > ("INBOX" ""))) > > ;; Tree view for groups > (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) > ;; Manage groups > (eval-after-load 'gnus-topic > '(progn > (setq gnus-topic-topology '(("Gnus" visible) > (("firstEmail@domain.com" visible nil nil)))) > > (setq gnus-topic-alist '(("firstEmail@domain.com" > "INBOX" > "INBOX.folder1" > "INBOX.folder2" > "Sent" > "Drafts" > "Junk" > "Trash" > "Sent Messages") > ("Gnus"))))) > > My question is, how do I extend the code above to split incoming mails for my second email address (secondEmail@domain.com)? > > I have tried this code below, but it doesn't work. > > (setq gnus-secondary-select-methods > '((nnimap "secondEmail@domain.com" > (nnimap-address "imapserver") > (nnimap-inbox "nnimap+secondEmail@domain.com:INBOX") > (nnimap-split-methods default) > (nnimap-expunge t) > (nnimap-stream ssl) > (nnimap-user "secondEmail@domain.com")))) > > (setq nnmail-split-methods > '(("nnimap+secondEmail@domain.com:INBOX.work" "from:.*colleague@domain.com") > ("nnimap+secondEmail@domain.com:INBOX" ""))) > > > Cheers, > > Steve