about summary refs log tree commit diff
path: root/bubger.1
blob: 794303c5af0f8183ed50706f71590e15970a3dce (plain) (blame)
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
.Dd March  1, 2021
.Dt BUBGER 1
.Os
.
.Sh NAME
.Nm bubger
.Nd IMAP archive generator
.
.Sh SYNOPSIS
.Nm
.Op Fl iqv
.Op Fl C Ar path
.Op Fl H Ar head
.Op Fl S Ar search
.Op Fl a Ar algo
.Op Fl h Ar host
.Op Fl m Ar addr
.Op Fl p Ar port
.Op Fl s Ar url
.Op Fl t Ar title
.Op Fl u Ar base
.Op Fl w Ar file
.Op Fl y Ar css
.Ar user
.Op Ar mailbox
.
.Sh DESCRIPTION
The
.Nm
utility renders an HTML, Atom and mboxrd archive
of an IMAP mailbox
arranged into threads.
It requires the IMAP SORT and THREAD extensions.
Partial output is cached and reused
by subsequent runs.
.
.Pp
The arguments are as follows:
.
.Bl -tag -width Ds
.It Fl C Ar path
Change directory to
.Ar path
before reading and writing files.
.
.It Fl H Ar head
Append the contents of the file
.Ar head
to the
.Sy <head>
element of HTML pages.
.
.It Fl S Ar search
Limit threads to messages matching
.Ar search .
The default search is
.Sy ALL .
.
.It Fl a Ar algo
Set the threading algorithm to one of
.Sy ORDEREDSUBJECT
or
.Sy REFERENCES .
The default algorithm is
.Sy REFERENCES .
.
.It Fl h Ar host
Connect to IMAP on
.Ar host .
The default host is determined by
SRV record lookup on the domain name of
.Ar user .
.
.It Fl i
Continually wait for
new messages in the mailbox
using IMAP IDLE.
Writes to
.Pa UIDNEXT
indicate that the
rendered archive
has been updated.
.
.It Fl m Ar addr
Add a
.Dq write
mailto link of
.Ar addr
to the index page navigation.
.
.It Fl p Ar port
Connect to IMAP on
.Ar port .
The default port is
.Sy imaps
.Pq 993 .
TLS without STARTTLS is assumed.
.
.It Fl q
Exit non-zero if the mailbox has not changed.
.
.It Fl s Ar url
Add a
.Dq subscribe
link of
.Ar url
to the index page navigation.
.
.It Fl t Ar title
Set the title for the index HTML page and Atom feed.
The default title is the mailbox name.
.
.It Fl u Ar base
Set the base URL for links in Atom feeds.
.
.It Fl v
Log IMAP protocol to standard error.
.
.It Fl w Ar file
Read the IMAP password from
.Ar file .
By default the password is set by the
.Ev BUBGER_IMAP_PASSWORD
environment variable.
.
.It Fl y Ar css
Use the stylesheet URL
.Ar css .
The default is an inline stylesheet.
.
.It Ar user
Log in to IMAP as
.Ar user .
.
.It Ar mailbox
Render threads from
.Ar mailbox .
The default mailbox is
.Qq Archive .
.El
.
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev BUBGER_IMAP_PASSWORD
The IMAP password.
.El
.
.Sh FILES
.Bl -tag -width Ds
.It Pa index.atom
Rendered Atom feed of all messages.
.It Pa index.html
Rendered HTML index of all threads.
.It Pa thread/*.atom , Pa thread/*.html , Pa thread/*.mbox
Rendered Atom, HTML and mboxrd files for each thread.
.It Pa attachment/*/*/*.*
Attached files.
.It Pa message/*.mbox
Rendered mboxrd files for each message.
.It Pa UID/*.atom , Pa UID/*.html , Pa UID/*.mbox
Cached Atom, HTML and mboxrd fragments for each message.
.It Pa UIDNEXT
Stores the next UID of the mailbox.
Remove this file to force re-render
the index page and feed.
.It Pa UIDVALIDITY
Stores the mailbox UID validity.
.El
.
.Sh EXAMPLES
.Bd -literal
bubger -q list@example.org \e
&& rsync -a index.* message thread attachment example.org:public_html/
.Ed
.
.Sh STANDARDS
.Bl -item
.It
.Rs
.%A T. Berners-Lee
.%A L. Masinter
.%A M. McCahill
.%T Uniform Resource Locators (URL)
.%I IETF
.%R RFC 1738
.%U https://tools.ietf.org/html/rfc1738
.%D December 1994
.Re
.It
.Rs
.%A N. Borenstein
.%A N. Freed
.%T Format of Internet Message Bodies
.%I IETF
.%R RFC 2045
.%U https://tools.ietf.org/html/rfc2045
.%D November 1996
.Re
.It
.Rs
.%A M. Crispin
.%T INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1
.%I IETF
.%R RFC 3501
.%U https://tools.ietf.org/html/rfc3501
.%D March 2003
.Re
.It
.Rs
.%A M. Crispin
.%A K. Murchison
.%T Internet Message Access Protocol - SORT and THREAD Extensions
.%I IETF
.%R RFC 5256
.%U https://tools.ietf.org/html/rfc5256
.%D June 2008
.Re
.It
.Rs
.%A S. Dorner
.%A K. Moore
.%A R. Troost
.%T The Content-Disposition Header Field
.%I IETF
.%R RFC 2183
.%U https://tools.ietf.org/html/rfc2183
.%D August 1997
.Re
.It
.Rs
.%A L. Esibov
.%A A. Gulbrandsen
.%A P. Vixie
.%T A DNS RR for specifying the location of services (DNS SRV)
.%I IETF
.%R RFC 2782
.%U https://tools.ietf.org/html/rfc2782
.%D February 2000
.Re
.It
.Rs
.%A P. Hoffman
.%A L. Masinter
.%A J. Zawinski
.%T The mailto URL scheme
.%I IETF
.%R RFC 2368
.%U https://tools.ietf.org/html/rfc2368
.%D July 1998
.Re
.It
.Rs
.%A B. Leiba
.%T IMAP4 IDLE command
.%I IETF
.%R RFC 2177
.%U https://tools.ietf.org/html/rfc2177
.%D June 1997
.Re
.It
.Rs
.%A E. Levinson
.%T Content-ID and Message-ID Uniform Resource Locators
.%I IETF
.%R RFC 2392
.%U https://tools.ietf.org/html/rfc2392
.%D August 1998
.Re
.It
.Rs
.%A P. Mockapetris
.%T DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION
.%I IETF
.%R RFC 1035
.%U https://tools.ietf.org/html/rfc1035
.%D November 1987
.Re
.It
.Rs
.%A K. Moore
.%T Message Header Extensions for Non-ASCII Text
.%I IETF
.%R RFC 2047
.%U https://tools.ietf.org/html/rfc2047
.%D November 1996
.Re
.It
.Rs
.%A M. Nottingham
.%A R. Sayre
.%T The Atom Syndication Format
.%I IETF
.%R RFC 4287
.%U https://tools.ietf.org/html/rfc4287
.%D December 2005
.Re
.El
.
.Sh AUTHORS
.An June Bug Aq Mt june@causal.agency
.
.Sh BUGS
Send mail to
.Aq Mt list+bubger@causal.agency .