unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Gnus splitting question
@ 2020-12-07  8:01 Pankaj Jangid
  2020-12-07 12:15 ` Leo Butler
  0 siblings, 1 reply; 3+ messages in thread
From: Pankaj Jangid @ 2020-12-07  8:01 UTC (permalink / raw)
  To: Emacs Help

If I split using a variable (`my-split-list' below), it creates a group
mail.misc on the IMAP server and rest of the emails end up in this.

--8<---------------cut here---------------start------------->8---
(defvar my-split-list
  '(("cron" "^From:.*Cron Daemon")
    ("cron" "^from: OSSEC HIDS <ossecm@app1>")
    ("cron" "^from: OSSEC HIDS <ossecm@app2>")
    ("cron" "^from: OSSEC HIDS <ossecm@app3>")
    ("cron" "^from: OSSEC HIDS <ossecm@db1>")))

(add-to-list 'gnus-secondary-select-methods
	     '(nnimap "otp"
		      (nnimap-address "imap.gmail.com")
		      (nnimap-inbox "INBOX")
		      (nnimap-expunge immediately)
		      (nnimap-split-methods my-split-list)))
--8<---------------cut here---------------end--------------->8---

But if I put the split rules inline, like the one below, rest of the
emails remain in INBOX.

--8<---------------cut here---------------start------------->8---
(add-to-list 'gnus-secondary-select-methods
	     '(nnimap "otp"
		      (nnimap-address "imap.gmail.com")
		      (nnimap-inbox "INBOX")
		      (nnimap-expunge immediately)
		      (nnimap-split-methods
                        (("cron" "^From:.*Cron Daemon")
                         ("cron" "^from: OSSEC HIDS <ossecm@app1>") 
                         ("cron" "^from: OSSEC HIDS <ossecm@app2>")
                         ("cron" "^from: OSSEC HIDS <ossecm@app3>")
                         ("cron" "^from: OSSEC HIDS <ossecm@db1>")))))
--8<---------------cut here---------------end--------------->8---

Why this difference in behaviour?



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

* Re: Gnus splitting question
  2020-12-07  8:01 Gnus splitting question Pankaj Jangid
@ 2020-12-07 12:15 ` Leo Butler
  2020-12-07 14:10   ` Pankaj Jangid
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Butler @ 2020-12-07 12:15 UTC (permalink / raw)
  To: Emacs Help

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> ********************************************************
> Caution: This message was sent from outside the University of Manitoba.
> ********************************************************
>
> If I split using a variable (`my-split-list' below), it creates a group
> mail.misc on the IMAP server and rest of the emails end up in this.
>
> --8<---------------cut here---------------start------------->8---
> (defvar my-split-list
>   '(("cron" "^From:.*Cron Daemon")
>     ("cron" "^from: OSSEC HIDS <ossecm@app1>")
>     ("cron" "^from: OSSEC HIDS <ossecm@app2>")
>     ("cron" "^from: OSSEC HIDS <ossecm@app3>")
>     ("cron" "^from: OSSEC HIDS <ossecm@db1>")))
>
> (add-to-list 'gnus-secondary-select-methods
> 	     '(nnimap "otp"
> 		      (nnimap-address "imap.gmail.com")
> 		      (nnimap-inbox "INBOX")
> 		      (nnimap-expunge immediately)
> 		      (nnimap-split-methods my-split-list)))
> --8<---------------cut here---------------end--------------->8---
>
>
> But if I put the split rules inline, like the one below, rest of the
> emails remain in INBOX.
>
> --8<---------------cut here---------------start------------->8---
> (add-to-list 'gnus-secondary-select-methods
> 	     '(nnimap "otp"
> 		      (nnimap-address "imap.gmail.com")
> 		      (nnimap-inbox "INBOX")
> 		      (nnimap-expunge immediately)
> 		      (nnimap-split-methods
>                         (("cron" "^From:.*Cron Daemon")
>                          ("cron" "^from: OSSEC HIDS <ossecm@app1>") 
>                          ("cron" "^from: OSSEC HIDS <ossecm@app2>")
>                          ("cron" "^from: OSSEC HIDS <ossecm@app3>")
>                          ("cron" "^from: OSSEC HIDS <ossecm@db1>")))))
> --8<---------------cut here---------------end--------------->8---
>
> Why this difference in behaviour?

Quoting. With '(...), everything inside the form evaluates to itself,
which is not what you want.

You want to use backtick quote `(...) and insert the value of
my-split-list using the comma ,my-split-list :

--8<---------------cut here---------------start------------->8---
(add-to-list 'gnus-secondary-select-methods
	     `(nnimap "otp"
		      (nnimap-address "imap.gmail.com")
		      (nnimap-inbox "INBOX")
		      (nnimap-expunge immediately)
		      (nnimap-split-methods ,my-split-list)))
--8<---------------cut here---------------end--------------->8---


Leo



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

* Re: Gnus splitting question
  2020-12-07 12:15 ` Leo Butler
@ 2020-12-07 14:10   ` Pankaj Jangid
  0 siblings, 0 replies; 3+ messages in thread
From: Pankaj Jangid @ 2020-12-07 14:10 UTC (permalink / raw)
  To: Leo Butler; +Cc: Emacs Help

Leo Butler <leo.butler@umanitoba.ca> writes:

>> Why this difference in behaviour?
>
> Quoting. With '(...), everything inside the form evaluates to itself,
> which is not what you want.
>
> You want to use backtick quote `(...) and insert the value of
> my-split-list using the comma ,my-split-list :
>
> (add-to-list 'gnus-secondary-select-methods
> 	     `(nnimap "otp"
> 		      (nnimap-address "imap.gmail.com")
> 		      (nnimap-inbox "INBOX")
> 		      (nnimap-expunge immediately)
> 		      (nnimap-split-methods ,my-split-list)))
>

Thanks. That worked for me.



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

end of thread, other threads:[~2020-12-07 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07  8:01 Gnus splitting question Pankaj Jangid
2020-12-07 12:15 ` Leo Butler
2020-12-07 14:10   ` Pankaj Jangid

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).