Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: info-gnus-english@gnu.org
Subject: Re: mail splitting doesn't work
Date: Thu, 27 Mar 2008 00:52:46 +0200	[thread overview]
Message-ID: <87ve39m729.fsf@kobe.laptop> (raw)
In-Reply-To: <87veends6d.fsf@thalassa.lan.informatimago.com>

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

      parent reply	other threads:[~2008-03-26 22:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-20 22:52 Pascal Bourguignon
2007-05-21  4:39 ` Katsumi Yamaoka
2007-05-21  4:59   ` Pascal Bourguignon
2008-03-26 22:52 ` Giorgos Keramidas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ve39m729.fsf@kobe.laptop \
    --to=keramida@ceid.upatras.gr \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).