1

I'm using emacs' gnus to connect to a gmail and a hotmail account, I'm currently unable to split email into specific groups. All of my email is collecting in their respective inboxes, regardless of my efforts to split it. How can I ensure that I can write rules that will split mail coming to my gmail account and my hotmail account? I've read the gnus documentation for splitting mail several times, but my code is not working. Here's what I've got written down:

  (setq gnus-secondary-select-methods '((nntp "news.gwene.org")
                                  (nnimap "hotmail"
                                          (nnimap-address "imap-mail.outlook.com")
                                          (nnimap-server-port 993)
                                          (nnimap-stream ssl)
                                          (nnimap-streaming t)
                                          (nnimap-split-method default)
                                          (nnir-search-engine imap))))



 (setq gnus-select-method
  '(nnimap "gmail"
           (nnimap-inbox "Google")
           (nnimap-address "imap.gmail.com")  
           (nnimap-server-port "993")
           (nnimap-stream ssl)
           (nnimap-split-method default)))



   (setq nnimap-split-methods
       '(("Accrisoft Support" "^From:.*[email protected].*")
         ("Basecamp" "^From:.*[email protected].*")
         ("arch" "^To:.*[email protected].*$")
         ("emacs devel" "^To:.*[email protected].*")
         ("emacs devel" "^CC:.*[email protected].*")
         ("bug-hurd" "^To:.*[email protected].*")
         ("bug-hurd" "^Cc:.*[email protected].*")))

What am I doing wrong?

1

3 Answers 3

2

I tried something similar and the problem is this. When doing imap splitting, the splits go on the server side, not on the client side. So when you split gmail, the splits go to gmail groups. This caught me by surprise when I tried to split AOL mail[1] and make it go to gmail groups. What happened instead was that new groups (folders) were created on the AOL side.

The way to do what you want is to fetch your IMAP mail into local folders, outside of Emacs, using something like dovecot. Then you can split mail any which-way. But that probably isn't the solution you want; it certainly wasn't the solution I wanted.

[1] It's fun to have an AOL account for some things, and the irony of using Gnus to send AOL mail is delicious.

2

I think the problem is:

(nnimap-split-method default)

which is missing an 's' (methods), and then the variable nnimap-split-methods should be called nnmail-split-methods in your setq afterwards.

At least that seems to be what the documentation says:

nnimap-split-methods

Uses the same syntax as nnmail-split-methods (see section Splitting Mail), except the symbol default, which means that it should use the value of the nnmail-split-methods variable.

The next major thing is:

nnmail-split-methods

The last element should always have "" as the regexp.

So try replacing what you have above with this:

(setq gnus-select-method
      '(nnimap "gmail"
               (nnimap-inbox "Google")
               (nnimap-address "imap.gmail.com")
               (nnimap-server-port "993")
               (nnimap-stream ssl)
               (nnimap-split-methods default)))

(setq gnus-secondary-select-methods
      '((nntp "news.gwene.org")
        (nnimap "hotmail"
                (nnimap-address "imap-mail.outlook.com")
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnimap-streaming t)
                (nnimap-split-methods default)
                (nnir-search-engine imap))))

(setq nnmail-split-methods
      '(("Accrisoft Support" "^From:.*support@accrisoft\\.com.*")
        ("Basecamp" "^From:.*notifications@basecamp\\.com.*")
        ("arch" "^To:.*arch-general@archlinux\\.org.*")
        ("emacs devel" "^\\(To\\|Cc\\):.*emacs-devel@gnu\\.org.*")
        ("bug-hurd" "^\\(To\\|Cc\\):.*bug-hurd@gnu\\.org.*")
        ("mail.misc" "")))
7
  • Thanks for answering, but I don't really understand your solution. I've read through it several times, and I'm still confused. What part of my code needs to be changed? Are you saying I should add (setq nnimap-split-method-default) and change (setq nnimap-split-methods '(("Accrisoft Support" "^From:.*[email protected].*") ;; ... ("bug-hurd" "^Cc:.*[email protected].*"))) to (setq nnmail-split-methods '(("Accrisoft Support" "^From:.*[email protected].*") ;; ... ("bug-hurd" "^Cc:.*[email protected].*")))
    – Joshua
    Commented Feb 13, 2016 at 17:25
  • I don't know how I can be more specific in my answer. I write the exact three changes you need to make. I have now extended my answer with your configuration example, where I have made the three changes I proposed. Please compare the two, and see if it makes sense to you now.
    – asjo
    Commented Feb 13, 2016 at 22:45
  • Well I've done the changes you recommended. It doesn't seem to be working, but thanks for the help. I'll probably ask my question on the mailing list.
    – Joshua
    Commented Feb 16, 2016 at 12:28
  • Good idea. What happens if you press B q on an email you expected to be split? How aout B t ?
    – asjo
    Commented Feb 16, 2016 at 15:11
  • It says "This message would go to arch"! That's something new! Do I need to create the group arch?
    – Joshua
    Commented Feb 16, 2016 at 17:41
1

I've actually decided that the best way to fix this is not to have client side email splitting, because gnus is quite slow at that. I've instead decided to let the server do the email splitting for me. That makes gnus much faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.