Discussion:
using nnimap-split-fancy to split mail on server?
Stephen Leake
2014-12-22 16:48:55 UTC
Permalink
I've been using Gnus with a POP backend forever, but I've recently
decided it would be nice to occasionally reference an email on my
smartphone.

So I'm switching to imap. I have several groups set up, and was hoping
that Gnus would automagically create the same groups on the sever as
separate IMAP mailboxes. But that doesn't seem to work.

The Gnus manual does not specifically address this, as far as I can see.
Browsing thru the ding archive on gmane I find some articles that seem
to imply it should work. Browsing thru nnimap.el I find
nnimap-request-move-article, so the infrastructure for this seems to be
there.

Here's my setup:

(setq mail-sources
'((imap :server "mail.stephe-leake.org"
:user "***@stephe-leake.org"
:port 143
:stream 'network
:fetchflag "\\Seen"
)
))

(setq nnimap-split-fancy
'(|
;; spam
("subject" "SPAMSPAM" "spam")
("from" "strat laios <***@verizon.net>" "spam")

;; These are before 'home' rules because people reply "to:" me,
;; "cc:" group
("to\\|cc" "bbdb-info" "bbdb-info")
("to\\|cc" "debian-ada" "debian-ada")
("to\\|cc" "debian" "spam")

...
))

This splits mail as expected in Gnus on my laptop. But when I access the
same server account via the GMail app on my smartphone, it does not show
the mailboxes/folders (it shows only the default 4 folders: Drafts,
Junk, Sent, Trash). I can search to find the mail I'm looking for, but
the folders would be very nice.

Is there anything else I need to do?
--
-- Stephe
Lars Ingebrigtsen
2015-01-26 03:29:48 UTC
Permalink
Post by Stephen Leake
(setq nnimap-split-fancy
'(|
;; spam
("subject" "SPAMSPAM" "spam")
;; These are before 'home' rules because people reply "to:" me,
;; "cc:" group
("to\\|cc" "bbdb-info" "bbdb-info")
("to\\|cc" "debian-ada" "debian-ada")
("to\\|cc" "debian" "spam")
...
))
This splits mail as expected in Gnus on my laptop. But when I access the
same server account via the GMail app on my smartphone, it does not show
the mailboxes/folders (it shows only the default 4 folders: Drafts,
Junk, Sent, Trash). I can search to find the mail I'm looking for, but
the folders would be very nice.
Is there anything else I need to do?
That seems very odd. Gnus really creates the folders on the server, so
you should be able to see them with any client. So either there's
something wrong with that other client, or Gmail is doing something
wonky here again...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Stephen Leake
2015-01-26 10:04:29 UTC
Permalink
Post by Lars Ingebrigtsen
Post by Stephen Leake
(setq nnimap-split-fancy
'(|
;; spam
("subject" "SPAMSPAM" "spam")
;; These are before 'home' rules because people reply "to:" me,
;; "cc:" group
("to\\|cc" "bbdb-info" "bbdb-info")
("to\\|cc" "debian-ada" "debian-ada")
("to\\|cc" "debian" "spam")
...
))
This splits mail as expected in Gnus on my laptop. But when I access the
same server account via the GMail app on my smartphone, it does not show
the mailboxes/folders (it shows only the default 4 folders: Drafts,
Junk, Sent, Trash). I can search to find the mail I'm looking for, but
the folders would be very nice.
Is there anything else I need to do?
That seems very odd. Gnus really creates the folders on the server, so
you should be able to see them with any client. So either there's
something wrong with that other client, or Gmail is doing something
wonky here again...
I figured out what is going on.

There are (at least) two ways to use imap in Gnus:

nnml back-end with mail-sources set to '(imap ...)

nnimap back-end


It would be better if the Gnus manual section on imap mentioned both of
these.

I was using the nnml backend; the imap interface for that does not
create folders on the server. In fact, it ignores nnimap-split-fancy, so
my testing with the above setting was confused.

I tried to use the nnimap back-end, but never got splitting to work. I
did discover it is _much_ slower than nnml when reading mail (in moving
from one message to the next; I assume because it is telling the server
that message has now been read). Splitting on the server is not critical
for me (I only access this account thru gmail occasionally), so I'm
sticking with the nnml back-end.


It might make sense for the nnml imap interface to also split mail on
the server, as long as it does not talk to the server after that
splitting. I can see there could be problems with that.
--
-- Stephe
Lars Ingebrigtsen
2015-01-27 00:55:38 UTC
Permalink
Post by Stephen Leake
It might make sense for the nnml imap interface to also split mail on
the server, as long as it does not talk to the server after that
splitting. I can see there could be problems with that.
If you're using IMAP as a mail source, then Gnus will download the
messages and delete them from the server, right? So there's nothing to
"split" on the server.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Stephen Leake
2015-01-27 09:25:52 UTC
Permalink
Post by Lars Ingebrigtsen
Post by Stephen Leake
It might make sense for the nnml imap interface to also split mail on
the server, as long as it does not talk to the server after that
splitting. I can see there could be problems with that.
If you're using IMAP as a mail source, then Gnus will download the
messages and delete them from the server, right? So there's nothing to
"split" on the server.
I have :fetchflag set to \Seen, so the messages are left on the server
(as described in (info "(gnus) Mail Source Specifiers")).

I'm not clear if they are ever deleted from the server; I hope nnml does
that when expired; I'll have to check.
--
-- Stephe
Stephen Leake
2015-01-27 10:16:42 UTC
Permalink
Post by Stephen Leake
Post by Lars Ingebrigtsen
Post by Stephen Leake
It might make sense for the nnml imap interface to also split mail on
the server, as long as it does not talk to the server after that
splitting. I can see there could be problems with that.
If you're using IMAP as a mail source, then Gnus will download the
messages and delete them from the server, right? So there's nothing to
"split" on the server.
I have :fetchflag set to \Seen, so the messages are left on the server
(as described in (info "(gnus) Mail Source Specifiers")).
I'm not clear if they are ever deleted from the server; I hope nnml does
that when expired; I'll have to check.
Apparently not; nnmail-delete-file-function is set to delete-file.

So I'll have to customize that to do what nnimap-delete-article does.
--
-- Stephe
Loading...