all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* nnimap splitting
@ 2020-12-09 22:38 Phillip Lord
  2020-12-09 23:26 ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: Phillip Lord @ 2020-12-09 22:38 UTC (permalink / raw)
  To: help-gnu-emacs



I am trying to set up imap splitting (for about the third time!), as I
move toward an fully imap setup. I find that I cannot get it to work in
even a basic way. I suspect that I have done something daft, but I can't
find it.

My set up is long unfortunately, so hard to reproduce it all here, but
I'd welcome anyone giving me ideas. The select methods look like this:

(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
      '(
        (nnimap "localhost"
                (nnimap-address "localhost")
                (nnimap-server-port 143)
                ;; [...]
                (nnimap-inbox "INBOX")
                (nnimap-split-methods 'nnimap-split-fancy)
                (nnimap-split-fancy
                 (|
                  ("subject" "split-into-temp" "temp")
                  ;; [...]
                  ;; otherwise, leave mail in INBOX
                  "INBOX")))
        (nnml ""
              (nnir-search-engine notmuch))))


Obviously that nnimap-split-fancy is temporary.

However, any use of B t `gnus-summary-respool-trace' results in "this
message would go to bogus". More over, if I check the server buffer and
"Show" I get

(nnimap "localhost")

Just this. None of the rest of the server variables. On the nnml server
I get:

(nnml ""
      (nnir-search-engine notmuch))

So, my interpretation here is that the rest of the nnimap form above is
not being interpreted.


I did think that there might be a caching problem, because these values
are not in `gnus-server-method-cache' but I have checked this out, and
it seems unlikely as this variable is not bound when I set
gnus-secondary-select-methods.

I'm fairly sure I am doing something daft, but I cannot think what.

Any thoughts?

Phil



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-09 22:38 nnimap splitting Phillip Lord
@ 2020-12-09 23:26 ` Eric Abrahamsen
  2020-12-10 10:26   ` Phillip Lord
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2020-12-09 23:26 UTC (permalink / raw)
  To: help-gnu-emacs

Phillip Lord <phillip.lord@russet.org.uk> writes:

> I am trying to set up imap splitting (for about the third time!)

I feel your pain!

> , as I move toward an fully imap setup. I find that I cannot get it to
> work in even a basic way. I suspect that I have done something daft,
> but I can't find it.
>
> My set up is long unfortunately, so hard to reproduce it all here, but
> I'd welcome anyone giving me ideas. The select methods look like this:
>
> (setq gnus-select-method '(nnnil ""))
> (setq gnus-secondary-select-methods
>       '(
>         (nnimap "localhost"
>                 (nnimap-address "localhost")
>                 (nnimap-server-port 143)
>                 ;; [...]
>                 (nnimap-inbox "INBOX")
>                 (nnimap-split-methods 'nnimap-split-fancy)

Don't quote 'nnimap-split-fancy in this line. In fact, it's possible
that you can do without this dance altogether -- the manual makes it
look like that's okay. Maybe take this clause out and see if it works,
and if it doesn't, put it back in but don't quote nnimap-split-fancy.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-09 23:26 ` Eric Abrahamsen
@ 2020-12-10 10:26   ` Phillip Lord
  2020-12-10 17:41     ` Eric Abrahamsen
  2020-12-10 18:36     ` Pankaj Jangid
  0 siblings, 2 replies; 14+ messages in thread
From: Phillip Lord @ 2020-12-10 10:26 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: help-gnu-emacs

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Phillip Lord <phillip.lord@russet.org.uk> writes:
>
>> I am trying to set up imap splitting (for about the third time!)
>
> I feel your pain!
>
>> , as I move toward an fully imap setup. I find that I cannot get it to
>> work in even a basic way. I suspect that I have done something daft,
>> but I can't find it.
>>
>> My set up is long unfortunately, so hard to reproduce it all here, but
>> I'd welcome anyone giving me ideas. The select methods look like this:
>>
>> (setq gnus-select-method '(nnnil ""))
>> (setq gnus-secondary-select-methods
>>       '(
>>         (nnimap "localhost"
>>                 (nnimap-address "localhost")
>>                 (nnimap-server-port 143)
>>                 ;; [...]
>>                 (nnimap-inbox "INBOX")
>>                 (nnimap-split-methods 'nnimap-split-fancy)
>
> Don't quote 'nnimap-split-fancy in this line. In fact, it's possible
> that you can do without this dance altogether -- the manual makes it
> look like that's okay. Maybe take this clause out and see if it works,
> and if it doesn't, put it back in but don't quote nnimap-split-fancy.



Alas no. I am still confused as to whether the server are being set at
all.

Phil



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 10:26   ` Phillip Lord
@ 2020-12-10 17:41     ` Eric Abrahamsen
  2020-12-10 18:48       ` phillip.lord
  2020-12-10 18:36     ` Pankaj Jangid
  1 sibling, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2020-12-10 17:41 UTC (permalink / raw)
  To: help-gnu-emacs

Phillip Lord <phillip.lord@russet.org.uk> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>
>>> I am trying to set up imap splitting (for about the third time!)
>>
>> I feel your pain!
>>
>>> , as I move toward an fully imap setup. I find that I cannot get it to
>>> work in even a basic way. I suspect that I have done something daft,
>>> but I can't find it.
>>>
>>> My set up is long unfortunately, so hard to reproduce it all here, but
>>> I'd welcome anyone giving me ideas. The select methods look like this:
>>>
>>> (setq gnus-select-method '(nnnil ""))
>>> (setq gnus-secondary-select-methods
>>>       '(
>>>         (nnimap "localhost"
>>>                 (nnimap-address "localhost")
>>>                 (nnimap-server-port 143)
>>>                 ;; [...]
>>>                 (nnimap-inbox "INBOX")
>>>                 (nnimap-split-methods 'nnimap-split-fancy)
>>
>> Don't quote 'nnimap-split-fancy in this line. In fact, it's possible
>> that you can do without this dance altogether -- the manual makes it
>> look like that's okay. Maybe take this clause out and see if it works,
>> and if it doesn't, put it back in but don't quote nnimap-split-fancy.
>
>
>
> Alas no. I am still confused as to whether the server are being set at
> all.

You mean the server variables? If they're specified correctly, and it
looks like they are apart from the quoting issue, they should all be
honored. Can you get non-fancy splitting working? Try the simplest case.

FWIW, my local imap settings look like:

(nnimap "EA"
	(nnimap-address "localhost")
	(nnimap-stream network)
	(nnimap-authenticator login)
	(nnimap-user "eric@ericabrahamsen.net"))

With passwords kept in the pass utility via ~/.authinfo.gpg. I don't do
client-side splitting, though.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 10:26   ` Phillip Lord
  2020-12-10 17:41     ` Eric Abrahamsen
@ 2020-12-10 18:36     ` Pankaj Jangid
  2020-12-10 18:58       ` phillip.lord
  1 sibling, 1 reply; 14+ messages in thread
From: Pankaj Jangid @ 2020-12-10 18:36 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Eric Abrahamsen, help-gnu-emacs

Phillip Lord <phillip.lord@russet.org.uk> writes:

>>> (setq gnus-select-method '(nnnil ""))
>>> (setq gnus-secondary-select-methods
>>>       '(
>>>         (nnimap "localhost"
>>>                 (nnimap-address "localhost")
>>>                 (nnimap-server-port 143)
>>>                 ;; [...]
>>>                 (nnimap-inbox "INBOX")
>>>                 (nnimap-split-methods 'nnimap-split-fancy)
>>
>> Don't quote 'nnimap-split-fancy in this line. In fact, it's possible
>> that you can do without this dance altogether -- the manual makes it
>> look like that's okay. Maybe take this clause out and see if it works,
>> and if it doesn't, put it back in but don't quote nnimap-split-fancy.
>
> Alas no. I am still confused as to whether the server are being set at
> all.

As pointed out by Eric, this is a quoting issue. I had some rough days
setting it up. But with help from others, I got to know this. I am not
using fancy splitting. I am using simple splitting and here is my setup:

--8<---------------cut here---------------start------------->8---
1 (add-to-list 'gnus-secondary-select-methods ; codeisgreat.org
2 	     `(nnimap "codeisgreat"
3 		      (nnimap-address "imap.gmail.com")
4 		      (nnimap-inbox "INBOX")
5 		      (nnimap-expunge immediately)
6 		      (nnimap-stream ssl)
7 		      (nnimap-split-methods ,nnmail-split-methods)))
--8<---------------cut here---------------end--------------->8---

Notice backquote on line 2 and comma on line 7. And
‘nnmail-split-methods’ is defined like this:

--8<---------------cut here---------------start------------->8---
(setq nnmail-split-methods
      '(("cron" "^from:.*Cron Daemon")
	("cron" "^from: OSSEC HIDS <ossecm@app0>")
	("cron" "^from: OSSEC HIDS <ossecm@app1>")))
--8<---------------cut here---------------end--------------->8---



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 17:41     ` Eric Abrahamsen
@ 2020-12-10 18:48       ` phillip.lord
  0 siblings, 0 replies; 14+ messages in thread
From: phillip.lord @ 2020-12-10 18:48 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: help-gnu-emacs

On 2020-12-10 17:41, Eric Abrahamsen wrote:
> Phillip Lord <phillip.lord@russet.org.uk> writes:
> 
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> 
>>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>> 

>>> Don't quote 'nnimap-split-fancy in this line. In fact, it's possible
>>> that you can do without this dance altogether -- the manual makes it
>>> look like that's okay. Maybe take this clause out and see if it 
>>> works,
>>> and if it doesn't, put it back in but don't quote nnimap-split-fancy.
>> 
>> 
>> 
>> Alas no. I am still confused as to whether the server are being set at
>> all.
> 
> You mean the server variables?

Yes, apologies


> If they're specified correctly, and it
> looks like they are apart from the quoting issue, they should all be
> honored. Can you get non-fancy splitting working? Try the simplest 
> case.


No, I can't. Simple or otherwise, nothing seems to work. I do have an 
extensive set of `nnmail-split-fancy` rules, which I use for the nnml 
backend that I am trying to deprecate. For those, I haven't user 
server-variables, but just set nnmail-split-methods and the rest.


> FWIW, my local imap settings look like:
> 
> (nnimap "EA"
> 	(nnimap-address "localhost")
> 	(nnimap-stream network)
> 	(nnimap-authenticator login)
> 	(nnimap-user "eric@ericabrahamsen.net"))
> 
> With passwords kept in the pass utility via ~/.authinfo.gpg. I don't do
> client-side splitting, though.



Yeah, well, I have a similar set up.

I have tried debugging `gnus-summary-respool-query'. This has a bit 
`let' form like so:

	 (let ((nnmail-split-methods
			(cond
			 ((eq nnimap-split-methods 'default)
			  nnmail-split-methods)
			 (nnimap-split-methods
			  nnimap-split-methods)
			 (nnimap-split-fancy
			  'nnmail-split-fancy)))
		       (nnmail-split-fancy (or nnimap-split-fancy
					       nnmail-split-fancy)))
		   (nnmail-article-group 'identity trace))


While evaluating this using an article in a nnimap group, all of the 
`nnimap-' variables evaluate to nil. I am not even sure how server 
variables would work; are they something like buffer-locals -- I can't 
see how these forms are going to return anything other than the global 
value for the nnimap- variables!

Phil



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 18:36     ` Pankaj Jangid
@ 2020-12-10 18:58       ` phillip.lord
  2020-12-10 19:22         ` phillip.lord
  2020-12-11  5:13         ` Pankaj Jangid
  0 siblings, 2 replies; 14+ messages in thread
From: phillip.lord @ 2020-12-10 18:58 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Eric Abrahamsen, help-gnu-emacs

On 2020-12-10 18:36, Pankaj Jangid wrote:
> Phillip Lord <phillip.lord@russet.org.uk> writes:
> 
>>>> (setq gnus-select-method '(nnnil ""))
>>>> (setq gnus-secondary-select-methods
>>>>       '(
>>>>         (nnimap "localhost"
>>>>                 (nnimap-address "localhost")
>>>>                 (nnimap-server-port 143)
>>>>                 ;; [...]
>>>>                 (nnimap-inbox "INBOX")
>>>>                 (nnimap-split-methods 'nnimap-split-fancy)
>>> 
>>> Don't quote 'nnimap-split-fancy in this line. In fact, it's possible
>>> that you can do without this dance altogether -- the manual makes it
>>> look like that's okay. Maybe take this clause out and see if it 
>>> works,
>>> and if it doesn't, put it back in but don't quote nnimap-split-fancy.
>> 
>> Alas no. I am still confused as to whether the server are being set at
>> all.
> 
> As pointed out by Eric, this is a quoting issue. I had some rough days
> setting it up. But with help from others, I got to know this. I am not
> using fancy splitting. I am using simple splitting and here is my 
> setup:
> 
> --8<---------------cut here---------------start------------->8---
> 1 (add-to-list 'gnus-secondary-select-methods ; codeisgreat.org
> 2 	     `(nnimap "codeisgreat"
> 3 		      (nnimap-address "imap.gmail.com")
> 4 		      (nnimap-inbox "INBOX")
> 5 		      (nnimap-expunge immediately)
> 6 		      (nnimap-stream ssl)
> 7 		      (nnimap-split-methods ,nnmail-split-methods)))
> --8<---------------cut here---------------end--------------->8---
> 
> Notice backquote on line 2 and comma on line 7. And
> ‘nnmail-split-methods’ is defined like this:
> 
> --8<---------------cut here---------------start------------->8---
> (setq nnmail-split-methods
>       '(("cron" "^from:.*Cron Daemon")
> 	("cron" "^from: OSSEC HIDS <ossecm@app0>")
> 	("cron" "^from: OSSEC HIDS <ossecm@app1>")))
> --8<---------------cut here---------------end--------------->8---


Just out of curiosity, why do you not use `(nnimap-split-methods 
default)` which should do the same thing without the backtick.

Unfortunately the quoting isn't my problem as I have tried it. I think I 
am looking in the wrong place and my configuration here is not the issue 
at all. I have no idea, unfortunately, what the issue is. If this is 
supposed to work in Gnus, I think, it is getting all the server 
information from somehwere else. NOt sure where!

Phil





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 18:58       ` phillip.lord
@ 2020-12-10 19:22         ` phillip.lord
  2020-12-11  0:07           ` Eric Abrahamsen
                             ` (2 more replies)
  2020-12-11  5:13         ` Pankaj Jangid
  1 sibling, 3 replies; 14+ messages in thread
From: phillip.lord @ 2020-12-10 19:22 UTC (permalink / raw)
  To: Phillip Lord; +Cc: Eric Abrahamsen, help-gnu-emacs

On 2020-12-10 18:58, phillip.lord@russet.org.uk wrote:
> On 2020-12-10 18:36, Pankaj Jangid wrote:
>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>> 
> I think
> I am looking in the wrong place and my configuration here is not the
> issue at all. I have no idea, unfortunately, what the issue is. If
> this is supposed to work in Gnus, I think, it is getting all the
> server information from somehwere else. NOt sure where!


And this turns out to be the problem. I tried changing 
secondary-select-methods to this:


(setq gnus-secondary-select-methods
       '(
         (nnimap "localhost"
                 ;;(nnimap-address "localhost")
                 ;;(nnimap-server-port 143)
                 (nnimap-address "i-dont-exist")
                 (nnimap-server-port 'random-nonsense)
                 ;; [...]
                 (nnimap-inbox "INBOX")
                 (nnimap-split-methods
                  (("temp" "^Subject: split-into-temp")
                   ("INBOX" "")))
        (nnml ""
               (nnir-search-engine notmuch))))

And Gnus still works, still looks up the nnimap back end, still access 
the email
despite the clearly incorrect address and server port. It doesn't appear 
to be using
the information here at all. Confusing as it is using the nnml 
information.

I am now officially very confused.

Phil



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 19:22         ` phillip.lord
@ 2020-12-11  0:07           ` Eric Abrahamsen
  2020-12-11  0:09           ` Eric Abrahamsen
  2020-12-11 12:24           ` Leo Butler
  2 siblings, 0 replies; 14+ messages in thread
From: Eric Abrahamsen @ 2020-12-11  0:07 UTC (permalink / raw)
  To: help-gnu-emacs

phillip.lord@russet.org.uk writes:

> On 2020-12-10 18:58, phillip.lord@russet.org.uk wrote:
>> On 2020-12-10 18:36, Pankaj Jangid wrote:
>>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>> 
>> I think
>> I am looking in the wrong place and my configuration here is not the
>> issue at all. I have no idea, unfortunately, what the issue is. If
>> this is supposed to work in Gnus, I think, it is getting all the
>> server information from somehwere else. NOt sure where!

Coincidentally, this is the subject of the talk I "gave" at Emacsconf
last week! All server variables defined with defvoo (so all the nnimap-*
symbols in your server config) are global variables, but the
server-specific values are copied into the global variables while that
server is the "current server". So you'll only see the relevant value --
the value Gnus is actually using -- if you edebug a live connection to
the server. I hope that makes sense, apparently I still have trouble
articulating how this works.

> And this turns out to be the problem. I tried changing
> secondary-select-methods to this:
>
>
> (setq gnus-secondary-select-methods
>       '(
>         (nnimap "localhost"
>                 ;;(nnimap-address "localhost")
>                 ;;(nnimap-server-port 143)
>                 (nnimap-address "i-dont-exist")
>                 (nnimap-server-port 'random-nonsense)
>                 ;; [...]
>                 (nnimap-inbox "INBOX")
>                 (nnimap-split-methods
>                  (("temp" "^Subject: split-into-temp")
>                   ("INBOX" "")))
>        (nnml ""
>               (nnir-search-engine notmuch))))
>
> And Gnus still works, still looks up the nnimap back end, still access
> the email
> despite the clearly incorrect address and server port. It doesn't
> appear to be using
> the information here at all. Confusing as it is using the nnml
> information.

I would close the connection to this imap server, edebug
`nnimap-open-connection-1', re-open the server, and check out what's
going on. You'll be guaranteed to see the server variables as Gnus sees
them. Given your config above, I would expect nnimap-stream to be set to
'network, but I don't see how Gnus would be setting nnimap-address back
to "localhost" since you gave it a value.

I'm also confused.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 19:22         ` phillip.lord
  2020-12-11  0:07           ` Eric Abrahamsen
@ 2020-12-11  0:09           ` Eric Abrahamsen
  2020-12-11 12:24           ` Leo Butler
  2 siblings, 0 replies; 14+ messages in thread
From: Eric Abrahamsen @ 2020-12-11  0:09 UTC (permalink / raw)
  To: help-gnu-emacs

phillip.lord@russet.org.uk writes:

> On 2020-12-10 18:58, phillip.lord@russet.org.uk wrote:
>> On 2020-12-10 18:36, Pankaj Jangid wrote:
>>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>> 
>> I think
>> I am looking in the wrong place and my configuration here is not the
>> issue at all. I have no idea, unfortunately, what the issue is. If
>> this is supposed to work in Gnus, I think, it is getting all the
>> server information from somehwere else. NOt sure where!
>
>
> And this turns out to be the problem. I tried changing
> secondary-select-methods to this:
>
>
> (setq gnus-secondary-select-methods
>       '(
>         (nnimap "localhost"
>                 ;;(nnimap-address "localhost")
>                 ;;(nnimap-server-port 143)
>                 (nnimap-address "i-dont-exist")
>                 (nnimap-server-port 'random-nonsense)
>                 ;; [...]
>                 (nnimap-inbox "INBOX")
>                 (nnimap-split-methods
>                  (("temp" "^Subject: split-into-temp")
>                   ("INBOX" "")))
>        (nnml ""
>               (nnir-search-engine notmuch))))

This may be an artifact of copy-and-paste, but the above is short one
closing parenthesis on the nnimap declaration.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 18:58       ` phillip.lord
  2020-12-10 19:22         ` phillip.lord
@ 2020-12-11  5:13         ` Pankaj Jangid
  1 sibling, 0 replies; 14+ messages in thread
From: Pankaj Jangid @ 2020-12-11  5:13 UTC (permalink / raw)
  To: phillip.lord; +Cc: Eric Abrahamsen, help-gnu-emacs

phillip.lord@russet.org.uk writes:

>> --8<---------------cut here---------------start------------->8---
>> 1 (add-to-list 'gnus-secondary-select-methods ; codeisgreat.org
>> 2 	     `(nnimap "codeisgreat"
>> 3 		      (nnimap-address "imap.gmail.com")
>> 4 		      (nnimap-inbox "INBOX")
>> 5 		      (nnimap-expunge immediately)
>> 6 		      (nnimap-stream ssl)
>> 7 		      (nnimap-split-methods ,nnmail-split-methods)))
>> --8<---------------cut here---------------end--------------->8---
>> Notice backquote on line 2 and comma on line 7. And
>> ‘nnmail-split-methods’ is defined like this:
>> --8<---------------cut here---------------start------------->8---
>> (setq nnmail-split-methods
>>       '(("cron" "^from:.*Cron Daemon")
>> 	("cron" "^from: OSSEC HIDS <ossecm@app0>")
>> 	("cron" "^from: OSSEC HIDS <ossecm@app1>")))
>> --8<---------------cut here---------------end--------------->8---
>
>
> Just out of curiosity, why do you not use `(nnimap-split-methods
> default)` which should do the same thing without the backtick.

This has a little history. I have many IMAP servers to fetch from. And I
had different variables to set splitting for each. Quoting was necessary
then. It is only recently, after looking at an 11 year old message from
Lars in a mailing list, that I have switched to using a common variable,
which, as you said, could be replaced with default.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-10 19:22         ` phillip.lord
  2020-12-11  0:07           ` Eric Abrahamsen
  2020-12-11  0:09           ` Eric Abrahamsen
@ 2020-12-11 12:24           ` Leo Butler
  2020-12-11 21:37             ` phillip.lord
  2 siblings, 1 reply; 14+ messages in thread
From: Leo Butler @ 2020-12-11 12:24 UTC (permalink / raw)
  To: help-gnu-emacs

phillip.lord@russet.org.uk writes:
> On 2020-12-10 18:58, phillip.lord@russet.org.uk wrote:
>> On 2020-12-10 18:36, Pankaj Jangid wrote:
>>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>> 
>> I think
>> I am looking in the wrong place and my configuration here is not the
>> issue at all. I have no idea, unfortunately, what the issue is. If
>> this is supposed to work in Gnus, I think, it is getting all the
>> server information from somehwere else. NOt sure where!

C-h v gnus-server-alist RET

gnus-server-alist is a variable defined in ‘gnus.el’.
Its value is shown below.

Documentation:
Servers created by Gnus, or via the server buffer.
Servers defined in the user’s config files do not appear here.
This variable is persisted in the user’s .newsrc.eld file.

Value:
...


You need to edit this variable.

It's an odd design and I banged my head against this one for years
before I finally figured out why Gnus kept trying to open servers that I
had deleted from gnus-secondary-select-methods.

Leo


>
>
> And this turns out to be the problem. I tried changing
> secondary-select-methods to this:
>
>
> (setq gnus-secondary-select-methods
>       '(
>         (nnimap "localhost"
>                 ;;(nnimap-address "localhost")
>                 ;;(nnimap-server-port 143)
>                 (nnimap-address "i-dont-exist")
>                 (nnimap-server-port 'random-nonsense)
>                 ;; [...]
>                 (nnimap-inbox "INBOX")
>                 (nnimap-split-methods
>                  (("temp" "^Subject: split-into-temp")
>                   ("INBOX" "")))
>        (nnml ""
>               (nnir-search-engine notmuch))))
>
> And Gnus still works, still looks up the nnimap back end, still access
> the email
> despite the clearly incorrect address and server port. It doesn't
> appear to be using
> the information here at all. Confusing as it is using the nnml
> information.
>
> I am now officially very confused.
>
> Phil



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-11 12:24           ` Leo Butler
@ 2020-12-11 21:37             ` phillip.lord
  2020-12-11 22:04               ` Leo Butler
  0 siblings, 1 reply; 14+ messages in thread
From: phillip.lord @ 2020-12-11 21:37 UTC (permalink / raw)
  To: Leo Butler; +Cc: help-gnu-emacs

On 2020-12-11 12:24, Leo Butler wrote:
> phillip.lord@russet.org.uk writes:
>> On 2020-12-10 18:58, phillip.lord@russet.org.uk wrote:
>>> On 2020-12-10 18:36, Pankaj Jangid wrote:
>>>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>>> 
>>> I think
>>> I am looking in the wrong place and my configuration here is not the
>>> issue at all. I have no idea, unfortunately, what the issue is. If
>>> this is supposed to work in Gnus, I think, it is getting all the
>>> server information from somehwere else. NOt sure where!
> 
> C-h v gnus-server-alist RET
> 
> gnus-server-alist is a variable defined in ‘gnus.el’.
> Its value is shown below.
> 
> Documentation:
> Servers created by Gnus, or via the server buffer.
> Servers defined in the user’s config files do not appear here.
> This variable is persisted in the user’s .newsrc.eld file.
> 
> Value:
> ...
> 
> 
> You need to edit this variable.
> 
> It's an odd design and I banged my head against this one for years
> before I finally figured out why Gnus kept trying to open servers that 
> I
> had deleted from gnus-secondary-select-methods.
> 



Yes, indeed, after extensive debugging, this does indeed appear to be 
the problem.

Gnus seems to be getting the imap address from .newsrc.eld during start 
up and all
rest of the info from .authinfo.gpg, although in this case from 
gnus-newsrc-alist which
is saved in .newsrc.eld. Everything in gnus-secondary-select-methods is 
thus ignored.

I have tried just tried ditching the server variables instead.

(setq
   nnimap-inbox "INBOX"
   nnimap-split-methods 'nnimap-split-fancy
   nnimap-split-fancy
   '(|
     ("subject" "split-into-temp" "temp-test")
     "temp-test"
     ))


This sort of works in that "B t" shows that mail messages go to 
"temp-test" as expected.
However, attempting to respool with "B r" fails. Took me a while to 
debug this and the
cause is because despite "B t" saying "temp-test", nnimap actually sends 
this command:

21:08:18 [localhost] 323 APPEND "mail.misc" {112079}


I am guessing that gnus does not like to be configured for both nnmail 
and nnimap splitting
even when operating within a single backend. The solution might be just 
to start afresh.

Hmmm. This is not going smoothly!

Phil



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: nnimap splitting
  2020-12-11 21:37             ` phillip.lord
@ 2020-12-11 22:04               ` Leo Butler
  0 siblings, 0 replies; 14+ messages in thread
From: Leo Butler @ 2020-12-11 22:04 UTC (permalink / raw)
  To: phillip.lord; +Cc: help-gnu-emacs

phillip.lord@russet.org.uk writes:

> ********************************************************
> Caution: This message was sent from outside the University of Manitoba.
> ********************************************************
>
> On 2020-12-11 12:24, Leo Butler wrote:
>> phillip.lord@russet.org.uk writes:
>>> On 2020-12-10 18:58, phillip.lord@russet.org.uk wrote:
>>>> On 2020-12-10 18:36, Pankaj Jangid wrote:
>>>>> Phillip Lord <phillip.lord@russet.org.uk> writes:
>>>>> 
>>>> I think
>>>> I am looking in the wrong place and my configuration here is not the
>>>> issue at all. I have no idea, unfortunately, what the issue is. If
>>>> this is supposed to work in Gnus, I think, it is getting all the
>>>> server information from somehwere else. NOt sure where!
>> C-h v gnus-server-alist RET
>> gnus-server-alist is a variable defined in ‘gnus.el’.
>> Its value is shown below.
>> Documentation:
>> Servers created by Gnus, or via the server buffer.
>> Servers defined in the user’s config files do not appear here.
>> This variable is persisted in the user’s .newsrc.eld file.
>> Value:
>> ...
>> 
>> You need to edit this variable.
>> It's an odd design and I banged my head against this one for years
>> before I finally figured out why Gnus kept trying to open servers
>> that I
>> had deleted from gnus-secondary-select-methods.
>> 
>
>
>
> Yes, indeed, after extensive debugging, this does indeed appear to be
> the problem.
>
> Gnus seems to be getting the imap address from .newsrc.eld during
> start up and all
> rest of the info from .authinfo.gpg, although in this case from
> gnus-newsrc-alist which
> is saved in .newsrc.eld. Everything in gnus-secondary-select-methods
> is thus ignored.
>
> I have tried just tried ditching the server variables instead.
>
> (setq
>   nnimap-inbox "INBOX"
>   nnimap-split-methods 'nnimap-split-fancy
>   nnimap-split-fancy
>   '(|
>     ("subject" "split-into-temp" "temp-test")
>     "temp-test"
>     ))
>
>
> This sort of works in that "B t" shows that mail messages go to
> "temp-test" as expected.
> However, attempting to respool with "B r" fails. Took me a while to
> debug this and the
> cause is because despite "B t" saying "temp-test", nnimap actually
> sends this command:
>
> 21:08:18 [localhost] 323 APPEND "mail.misc" {112079}
>
>
> I am guessing that gnus does not like to be configured for both nnmail
> and nnimap splitting
> even when operating within a single backend. The solution might be
> just to start afresh.
>
> Hmmm. This is not going smoothly!

Ahhh, you have found the downside to Gnus.  Gnus stores so much state
that it is hard/nearly impossible to re-configure.

For example, my .newsrc.eld is a monster that is impossible to load
into an emacs buffer to edit or inspect. So I found out about
gnus-server-alist by using the debugger while trying to edit (or delete,
can't recall) a server in the *Server* buffer.

What I would do (I am on linux), is create a fresh user account with a
clean home directory and build a working .gnus configuration tailored to
my wants. That way, you maintain a working Gnus for your main account
and can fiddle with your toy account without fear. It's not a pretty
solution, but it will avoid the heart/headache of other options.

Leo




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-12-11 22:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-09 22:38 nnimap splitting Phillip Lord
2020-12-09 23:26 ` Eric Abrahamsen
2020-12-10 10:26   ` Phillip Lord
2020-12-10 17:41     ` Eric Abrahamsen
2020-12-10 18:48       ` phillip.lord
2020-12-10 18:36     ` Pankaj Jangid
2020-12-10 18:58       ` phillip.lord
2020-12-10 19:22         ` phillip.lord
2020-12-11  0:07           ` Eric Abrahamsen
2020-12-11  0:09           ` Eric Abrahamsen
2020-12-11 12:24           ` Leo Butler
2020-12-11 21:37             ` phillip.lord
2020-12-11 22:04               ` Leo Butler
2020-12-11  5:13         ` Pankaj Jangid

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.