-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alias.txt
188 lines (156 loc) · 5.2 KB
/
alias.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Alias API -- Refactor Alias Handling
- Create an Alias library -- separate the code from the rest of NeoMutt
- Create an API (list of functions) that everyone uses
This library should be only be dependent on libmutt and libemail.
The library only needs to store and serve up the aliases and their associated
data. Parsing the config file should remain part of the NeoMutt code.
Separating the alias code will make it easier to test and maintain.
---
An "alias" is a short name you can assign to an email address to save you having
to remember it. NeoMutt's config looks like this:
```
alias jd John Doe <[email protected]> # Met in Vegas
```
Extra info:
- aliases can be put in groups ("alias -group")
- an alias can refer to multiple addresses ("alias x, y, ...")
- an alias can refer to the user ("alternates")
- patterns can check if the address:
- is an alias
- is to the user
- is a mailing list
See also:
- [Aliases](https://neomutt.org/guide/configuration#alias)
- [Address Groups](https://neomutt.org/guide/configuration#addrgroup)
- [Alternates](https://neomutt.org/guide/configuration#alternates)
- [Mailing Lists](https://neomutt.org/guide/configuration#lists)
- [Patterns](https://neomutt.org/guide/advancedusage.html#patterns)
---
Once complete, there are some optional extra challenges:
- Improve the storage of aliases (currently a branched linked list)
- Add tagging/labelling to the aliases
- Create a database backend, e.g. sqlite
------------------------------------------------------------
Ideas for Aliases
account-specific aliases
where do they get saved?
ac-spec file, if not, then global file
librarify alias code -- only dep on addr code and idna
change aliases from list to hash
how big?
100s?
remote config option
alias files
special reader for alias file, that parses comments, e.g.
# labels:red,blue,green phone:'1234'
or json (one-line)
2016-08-09
01:35 <SvenG> but giving a color to "known" addresses (via aliases) would be a killer
when parsing aliases, store which file they came from
when displaying aliases:
if one file, just display a list
if multiple files, use the sidebar
All aliases
- File1
- File2
if labels exist, use the sidebar
Unlabelled
Labelled
- Label1
- Label2
Allow the user to add to label-combination list
add expandos for "file" and "label"
add function <display-alias> to show a persons complete details
allow <modify-label> function
add function <add-metadata> -- free-form text field in editor
Alias: flatcap
Real Name: Richard Russon
Labels: self, neomutt
free form text
turn into an "alias" module (.so)
create an ldap alias module
initially read-only
sql/sqlite backend
scripts to export db contents as json, csv, text
api
functions to query aliases
alias file as definitive source
if this becomes a list, then where do we save?
first? last?
header: generated file - do we store other comments?
how? where?
needs to work as normal alias file
ALIAS SHORT NAME1 NAME2 ... <EMAIL> # COMMENT
encode extra data into comment, in form
tag:"data" [tag:...]
{tag/group/label} nick, irc, addr, etc
allow embedded '\n'
when do aliases get saved?
on creation? on exit? on command?
functions
get alias by name
get all -> R/O
set_{short|name|comment|email}
get_{short|name|comment|email}
get fields -> list of extra data
get field(a, fname)
count aliaes
add alias
del alias
create sidebar ∀ fields
split display
sidebar with groups/tags
index 1-line list of aliases
pager extra data
for completion or display, get all data then filter, etc
data can't be opaque
tag for "self"
need fn to get list of groups for an EmailList
hard. iterate through list instead
when you create an alias, it only offers you the "from" (or "reply-to")
can't alias other recipients
3 parts:
pure - add,remove,free,etc
file - read file, parse line, write file
menu - r/o selection, r/w editing
commands: alias, group, alternates, lists, subscribe
files: alias.[ch], addrbook.[ch], init.[ch]
Contacts with sidebar could display: alternates, mailing lists
tag-alias doesn't work in index or query menus
limit command
match patterns against fields
~f (from) alias name
~t (to) to address
~y (tags)
~m (message number)
~T tagged
~D deleted
~s (subject) comments
parse 'magic' comment string 'labels=label[,label[,...]]'
add labels field to Alias
add labels expando to $alias_format
add sidebar to alias, fields:
All Aliases, Unlabelled, Self, Labels: tag1, tag2, ...
auto-width to match labels
self is all matching alternates, but not unalternates
functions
tag-pattern
delete-pattern
undelete-pattern
add sort function
add comment sort option
`:alias` command opens addrbook (and does what?)
or `<addrbook-open>`
expando %f flag: 'S' for 'Self' (overridden by 'D')
check alternates/unalternates
//QWQ const size_t len = strlen(buf); // for efficiency
menu cursor position isn't preserved on updates (insertion/deletion)
function to scan a mailbox and create a menu of all addresses found
functions to turn them into aliases
alias sidebar
bool visible
bool auto-labels (self, each separate label found)
alias_label tony,oscar [optional desc]
alias_label oscar,emmy [optional desc]
define special labels so that the auto-labels can be recreated manually
but with custom labels