info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mail splitting doesn't work


From: Giorgos Keramidas
Subject: Re: mail splitting doesn't work
Date: Thu, 27 Mar 2008 00:52:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Mon, 21 May 2007 00:52:10 +0200, Pascal Bourguignon wrote:
> I customized nnmail split as indicated in info for gnu, but it doesn't
> work, no splitting occurs either when I fetch new mail nor when I
> respool the bogus mail group where all mails land eventually...
>
> (custom-set-variables
>  '(nnmail-split-fancy
>    (quote (| (: nnmail-split-fancy-with-parent)
>              ("From:" ".*Cron Daemon.*" "mail.cron")
>              (To: ".*vms-list@voynich.net.*" "mail.voynich")
>              (From: ".*gentoo.*" "mail.gentoo")
>              (From: ".*zenith.*@zenit.org.*" "mail.zenith")
>              (To: ".*\\(lisp.it\\|slime.*@common-lisp.net\\).*" "mail.lisp")
>              (From: ".*\\(@freelance.com\\|@dice.com\\).*" "mail.jobs"))))
>  '(nnmail-split-methods (quote nnmail-split-fancy))
>  '(gnus-secondary-select-methods (quote ((nnml "")))))
>
> What should I do to have my emails split into the right groups?

Hi Pascal,

As Katsumi Yamaoka-san has written, you have to use either a string in
the first element of each `split', or one of the supported keywords
(extending the keyword list is easy too, but it's not necessary here).

The above split could be written as:

    '(| (: nnmail-split-fancy-with-parent)
        (from ".*cron daemon.*" "mail.cron")
        (to ".*vms-list@voynich.net.*" "mail.voynich")
        (from ".*gentoo.*" "mail.gentoo")
        (from ".*zenith.*@zenit.org.*" "mail.zenith")
        (to ".*\\(lisp.it\\|slime.*@common-lisp.net\\).*" "mail.lisp")
        (from ".*\\(@freelance.com\\|@dice.com\\).*"
        "mail.jobs"))))

The nice thing about keywords is that they match more than one type of
email header:

,----[ Gnus manual.  Node: Fancy Mail Splitting ]-----------------------
|
| Predefined entries in `nnmail-split-abbrev-alist' include:
|
| `from'
|      Matches the `From', `Sender' and `Resent-From' fields.
|
| `to'
|      Matches the `To', `Cc', `Apparently-To', `Resent-To' and
|      `Resent-Cc' fields.
|
| `any'
|      Is the union of the `from' and `to' entries.
|
`-----------------------------------------------------------------------

The `from' keyword is probably less useful if you only want to split on
the "From:" header, but the `to' keyword is my all times favorite :-)

Cheers,
Giorgos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]