[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gnus splitting question
From: |
Leo Butler |
Subject: |
Re: Gnus splitting question |
Date: |
Mon, 07 Dec 2020 06:15:16 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
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