unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: gnuforever <help@tuyizere.org>
To: help-gnu-emacs@gnu.org
Subject: How to split (IMAP client side split) incoming mails into groups for multiple emails addresses with Gnus
Date: Sun, 07 Jan 2018 08:07:19 +0000	[thread overview]
Message-ID: <87d12mgki0.fsf@tuyizere.org> (raw)


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



             reply	other threads:[~2018-01-07  8:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07  8:07 gnuforever [this message]
2018-01-09  8:42 ` How to split (IMAP client side split) incoming mails into groups for multiple emails addresses with Gnus Alberto Luaces
     [not found] <mailman.6956.1515312486.27995.help-gnu-emacs@gnu.org>
2018-01-07 21:01 ` Emanuel Berg
2018-01-08 22:08   ` gnuforever
     [not found]   ` <mailman.7044.1515449313.27995.help-gnu-emacs@gnu.org>
2018-01-08 23:20     ` Emanuel Berg
2018-01-10 23:02       ` gnuforever
2018-01-11 12:36         ` Alberto Luaces
     [not found]         ` <mailman.7197.1515674209.27995.help-gnu-emacs@gnu.org>
2018-01-11 18:32           ` Emanuel Berg
     [not found]       ` <mailman.7178.1515625372.27995.help-gnu-emacs@gnu.org>
2018-01-10 23:42         ` Emanuel Berg
2018-01-14 21:05           ` gnuforever
     [not found]           ` <mailman.7391.1515963940.27995.help-gnu-emacs@gnu.org>
2018-01-15  0:18             ` Emanuel Berg
2018-01-15  5:35               ` gnuforever
     [not found]               ` <mailman.7409.1515994562.27995.help-gnu-emacs@gnu.org>
2018-01-15  7:38                 ` Emanuel Berg
2018-01-16 19:44                   ` gnuforever
     [not found]                   ` <mailman.7478.1516131886.27995.help-gnu-emacs@gnu.org>
2018-01-17  2:13                     ` Emanuel Berg
2018-01-17  9:45                       ` gnuforever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d12mgki0.fsf@tuyizere.org \
    --to=help@tuyizere.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).