Re: fcc-hooks for nested groups of addresses
- To: mutt-users@xxxxxxxx
- Subject: Re: fcc-hooks for nested groups of addresses
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Mon, 28 Jul 2008 11:00:07 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=tcOBrtyvMARPNNGSWI22YS2s2j0=; b=Kf7/ rIL1OBG5dcVMHvK3ghRzTndz+30zSZkIwjX7PYF8/Wclv8KSa8T2gV+d9okbhTiU 2wiaT148PIkzIKcz20fVXOqkdj8pjmGrDjlDAmf2qevhbdX/Cehe6u924go2xFtN 8D09o7vplUguKTb95cOCVKoB8DfarLZ0pkab/kQ=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=UhoEGGgjnR2DQEazQKUTTet6YolaYMcqy7+yuyHG3mlktQKXpNP3m7krZNp26vrZuqKmiZiWv6AeG7ZddaPFcFkVF9ldQYp26Nbw8mD/fuUj9pcCzK8PFC90k0IfTZa+gAwMLxzAmnxmYVUYW3oA08DgKZByoa/F2p87L/Gvk9w=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:OpenPGP:User-Agent;
- In-reply-to: <20080728133131.GC14678@xxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- Openpgp: id=CA8E235E; url=http://www.memoryhole.net/~kyle/kyle-pgp.asc; preference=signencrypt
- References: <20080728133131.GC14678@xxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.18 (2008-07-21)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday, July 28 at 03:31 PM, quoth Ludo Pagie:
> I recently switched from pine to mutt and have a bunch of things I
> would like to settle in mutt. But one at a time.
Welcome!
> I use aliases to define some groups of addresses I regularly use.
> Some of these groups are subgroups of other groups, or partially
> overlap.
Unless you use these alias "groups" to *send* mail (and maybe even
then), I think you probably want to use mutt's own "groups" feature.
> For all these separate groups I want to write FCC to files named
> after the alias. But also for the individual members of these groups
> I want to write FCC when I write mail to each of them personally.
Sounds reasonable.
> So, I want something like the following:
>
> alias a1 a1@xxxxxxxxxxx
> alias a2 a2@xxxxxxxxxxx
> alias a3 a3@xxxxxxxxxxx
> alias a12 a1, a2
> alias a123 a1,a2,a3
> fcc-hook '^~C a1@xxxxxxxxxxx' +a1
> fcc-hook '^~C a2@xxxxxxxxxxx' +a2
> fcc-hook '^~C a3@xxxxxxxxxxx' +a3
> fcc-hook '^(~C a1@xxxxxxxxxxx ~C a2@xxxxxxxxxxx)' =a12
> fcc-hook '^~C a[123]@example.org' =a123
Try this:
alias -group a12 -group a123 a1 <a1@xxxxxxxxxxx>
alias -group a12 -group a123 a2 <a2@xxxxxxxxxxx>
alias -group a123 a3 <a3@xxxxxxxxxxx>
fcc-hook '^~C a1@xxxxxxxxxxx' =a1
fcc-hook '^~C a2@xxxxxxxxxxx' =a2
fcc-hook '^~C a3@xxxxxxxxxxx' =a3
fcc-hook '^%C a12' =a12
fcc-hook '^%C a123' =a123
So, if you send to a1, it gets caught by the first hook. Send to a2,
it gets caught by the second hook. Send to a1 and a2, and it'll get
caught by the a12 hook. Of course, this only works because there are
only two members of a12.
The real problem here is that the a123 rule (or any group rule with
more than two members) triggers even if only some of the members of
group a123 are present. For example, if you send to a1 and a3, it
won't get caught by any of the previous hooks, but will be caught by
the a123 hook. The only thing the ^ guarantees is that all addresses
you're sending to are in the a123 group (which, in this case, they
are).
There isn't a really *simple* way of doing that. The only ways I can
think of to guarantee that all members of the group are present end up
long and need to be modified every time you modify a group (which is a
bit of a pain). Something like this:
fcc-hook '~C a1@xxxxxxxxxxx ~C a2@xxxxxxxxxxx ~C a3@xxxxxxxxxxx ^%C a123' =a123
Literally, what that says is:
1. The message must be addressed to a1
2. The message must be addressed to a2
3. The message must be addressed to a3
4. The message must not be addressed to anyone else
But this idea of group expansion such that all members of a group must
be present is interesting. You may want to file a feature-request with
the developers. Maybe syntax like "%^ GROUP"
~Kyle
- --
If man was meant to be nude, he would have been born that way.
-- Oscar Wilde
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iEYEARECAAYFAkiN7QcACgkQBkIOoMqOI15irgCfYTvBg6cUoGyaVSga1LzP6crD
EIYAnj+FiAnv+8BWVq3+QjxfWeWbZkuI
=+QzG
-----END PGP SIGNATURE-----