blob: 8259ce3ef6176592707860675b92b5722bfe429c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
alias-auto-add
==============
Adds unique aliases to a Mutt alias file.
When viewing an email in Mutt, this program is set as a display filter that
stores an alias for the from address. Aliases will thus be generated
automatically when reading email.
The program reads an email from STDIN and tries to add an alias for the from
address listed. If the given alias already exists, a new unique alias is
generated and used instead. This allows us to always capture an alias even if a
person has multiple email addresses.
Inspired by W. Caleb McDaniel's aliasing script published at:
http://wcm1.web.rice.edu/mutt-tips.html. This adds the advantage of creating a
new unique alias for all email addresses regardless of whether the sender's name
is duplicated.
## Install
A binary built for Mac OS X is available on the [releases][1] page. Download the
binary, put it in your `PATH`, and skip to step 2.
For other platforms, you'll need the [Rust][2] compiler.
1. Install with `cargo`:
$ cargo install --git https://github.com/teddywing/mutt-alias-auto-add.git --root /usr/local
2. Add the program as a Mutt display filter. Add the following line to your
`.muttrc`, specifying the location of your Mutt aliases file as an argument
to `alias-auto-add`:
set display_filter = '/usr/local/bin/alias-auto-add ~/.mutt/aliases'
## Uninstall
$ cargo uninstall --root /usr/local alias-auto-add
## Testing
Unit tests:
$ cargo test
Integration test:
$ make
## License
Copyright © 2016 Teddy Wing. Licensed under the GNU GPL (see the included
COPYING file).
[1]: https://github.com/teddywing/mutt-alias-auto-add/releases
[2]: https://www.rust-lang.org/
|