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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# ================================================================================
# `himalaya` configuration file.
#
# Loaded from the first valid path among:
# - $XDG_CONFIG_HOME/himalaya/config.toml
# - $HOME/.config/himalaya/config.toml
# - $HOME/.himalayarc
#
# Override with `himalaya -c <PATH>`. Multiple paths can be passed at once,
# separated by `:`; the first one is the base and the rest are deep-merged on
# top of it.
#
# Run bare `himalaya` (no subcommand) to launch the wizard, which discovers
# IMAP/SMTP/JMAP defaults via PACC, Thunderbird Autoconfiguration and RFC 6186
# SRV, then prints a ready-to-save account on stdout (prompts go to stderr), so
# `himalaya > <path>` writes it here. Re-run it anytime to generate another
# account and append it.
# ================================================================================
# --------------------------------------------------------------------------------
# Global config
# --------------------------------------------------------------------------------
# Default download directory for attachments. Falls back to `$TMPDIR`.
#downloads-dir = "~/downloads"
# https://docs.rs/comfy-table/latest/comfy_table/presets/index.html
#table.preset = "││──╞═╪╡┆ ┬┴┌┐└┘"
# https://docs.rs/comfy-table/latest/comfy_table/enum.ContentArrangement.html
#table.arrangement = "dynamic"
#table.arrangement = "dynamic-full-width"
#table.arrangement = "disabled"
# `chrono` strftime format used to render the DATE column of `envelopes list`.
# Defaults to `"%F %R%:z"`, e.g. `2026-05-06 14:30+02:00`.
#envelope.list.datetime-fmt = "%F %R%:z"
# Convert each envelope's `Date` header offset to the system's local timezone
# before formatting. Defaults to `false`, which preserves the wire offset.
#envelope.list.datetime-local-tz = false
# Default page size for `envelopes list`. The `-s/--page-size` CLI flag wins
# when passed; otherwise the merged account/global value wins; otherwise the
# hard fallback is 25.
#envelope.list.page-size = 50
# --------------------------------------------------------------------------------
# Table rendering — envelopes list
# --------------------------------------------------------------------------------
# Per-column foreground colors for the `envelopes list` table. Each value is
# a crossterm-style color: a named variant (`"red"`, `"dark-magenta"`,
# `"reset"`, …), or a `{ Rgb = { r, g, b } }` / `{ AnsiValue = N }` table.
# Applied to both shared `envelopes list` and the protocol-specific
# `imap`/`jmap`/`maildir` envelope listings so a single key affects every
# backend. The values below are the v1.2.0 defaults and are used when the
# key is left unset.
#envelope.list.table.id-color = "red"
#envelope.list.table.flags-color = "reset"
#envelope.list.table.att-color = "reset"
#envelope.list.table.subject-color = "green"
#envelope.list.table.from-color = "blue"
#envelope.list.table.to-color = "blue"
#envelope.list.table.date-color = "dark-yellow"
#envelope.list.table.size-color = "reset"
# Single-character glyphs used inside the FLAGS / ATT columns of the
# envelopes table. Defaults match v1.2.0.
#envelope.list.table.unseen-char = "*" # FLAGS slot 1, when `\Seen` is absent
#envelope.list.table.replied-char = "R" # FLAGS slot 2, when `\Answered` is set
#envelope.list.table.flagged-char = "!" # FLAGS slot 3, when `\Flagged` is set
#envelope.list.table.attachment-char = "@" # ATT column, when the message carries an attachment
# --------------------------------------------------------------------------------
# Table rendering — mailboxes list
# --------------------------------------------------------------------------------
# The `name-color` default matches v1.2.0 (`folder.list.table.name-color`);
# the other columns are new in v2 and default to the terminal foreground.
#mailbox.list.table.id-color = "reset"
#mailbox.list.table.name-color = "blue"
#mailbox.list.table.total-color = "reset"
#mailbox.list.table.unread-color = "reset"
# --------------------------------------------------------------------------------
# Table rendering — attachments list
# --------------------------------------------------------------------------------
# No v1 precedent; every column defaults to the terminal foreground.
#attachment.list.table.id-color = "reset"
#attachment.list.table.filename-color = "reset"
#attachment.list.table.type-color = "reset"
#attachment.list.table.size-color = "reset"
#attachment.list.table.inline-color = "reset"
#attachment.list.table.path-color = "reset"
# --------------------------------------------------------------------------------
# Table rendering — account list
# --------------------------------------------------------------------------------
# Defaults match v1.2.0.
#account.list.table.name-color = "green"
#account.list.table.backends-color = "blue"
#account.list.table.default-color = "reset"
# --------------------------------------------------------------------------------
# Mailbox aliases
# --------------------------------------------------------------------------------
# Map a friendly name to a backend-native mailbox id. Alias names are
# case-insensitive on lookup AND on storage, so `INBOX`, `Inbox` and `inbox`
# all hit the same entry. Ids are stored verbatim.
#
# The entry named `inbox` (case-insensitive) is the implicit default mailbox:
# shared commands fall back to this id when `-m/--mailbox` is not passed.
#
# Account-level entries override same-named global entries.
#
# The wizard pre-fills these from the server: JMAP reads the mailbox roles,
# Gmail/Microsoft Graph use their well-known label/folder ids, and IMAP pins
# only `inbox` (= INBOX) for now — the other IMAP special-use roles (sent,
# drafts, trash, …) are not yet discovered automatically, so set them by hand.
#mailbox.alias.inbox = "INBOX"
#mailbox.alias.sent = "[Gmail]/Sent Mail"
#mailbox.alias.drafts = "[Gmail]/Drafts"
#mailbox.alias.trash = "[Gmail]/Trash"
# --------------------------------------------------------------------------------
# Account config
# --------------------------------------------------------------------------------
# Declare one section per account. Pick one with `-a/--account <NAME>` or let
# himalaya use the entry flagged `default = true`.
[]
# Use this account when `-a/--account` is not passed.
= true
# Per-account overrides for the global options above.
#downloads-dir = "~/downloads/example"
#table.preset = "││──╞═╪╡┆ ┬┴┌┐└┘"
#table.arrangement = "dynamic"
#envelope.list.datetime-fmt = "%F %R%:z"
#envelope.list.datetime-local-tz = false
# --------------------------------------------------------------------------------
# IMAP config
# https://www.iana.org/go/rfc9051
# --------------------------------------------------------------------------------
# IMAP server. Either a bare authority (`host[:port]`, treated as
# `imaps://<authority>` by default), or a full URL with `imap://` (cleartext,
# optionally upgraded via STARTTLS) or `imaps://` (implicit TLS) scheme.
= "example.com"
#imap.server = "imap.example.com:143"
#imap.server = "imap://example.com:143"
#imap.server = "imaps://example.com:993"
# TLS provider, defaults to the first available at runtime.
#imap.tls.provider = "rustls"
#imap.tls.provider = "native-tls"
# Crypto provider for rustls, defaults to the first available at runtime.
#imap.tls.rustls.crypto = "ring"
#imap.tls.rustls.crypto = "aws"
# Custom TLS certificate (extra root, PEM-encoded).
#imap.tls.cert = "/path/to/custom/cert.pem"
# Enable STARTTLS (only valid when the server resolves to `imap://`).
#imap.starttls = false
# ALPN protocol identifiers offered during the TLS handshake (rustls only;
# native-tls ignores it). Defaults to ["imap"]; set to [] to skip ALPN.
#imap.alpn = ["imap"]
#imap.alpn = []
# Pick exactly one SASL mechanism among `anonymous`, `login`, `plain`,
# `oauthbearer`, `xoauth2`, `scram-sha-256`. Omit the whole `imap.sasl` table
# to skip authentication entirely (no `AUTHENTICATE` command sent).
# SASL ANONYMOUS
# https://datatracker.ietf.org/doc/html/rfc4505
#imap.sasl.anonymous.message = "himalaya"
# SASL PLAIN
# https://datatracker.ietf.org/doc/html/rfc4616
= "user@example.com"
= "***"
#imap.sasl.plain.password.command = "pass show example"
# SASL LOGIN
# https://datatracker.ietf.org/doc/html/draft-murchison-sasl-login-00
#imap.sasl.login.username = "user@example.com"
#imap.sasl.login.password.raw = "***"
# SASL OAUTHBEARER (host/port for the GS2 header are derived from the
# IMAP server URL at connect time).
# https://datatracker.ietf.org/doc/html/rfc7628
#imap.sasl.oauthbearer.username = "user@example.com"
#imap.sasl.oauthbearer.token.raw = "***"
#imap.sasl.oauthbearer.token.command = ["ortie", "token", "show", "-a", "example"]
# SASL XOAUTH2 (Google's pre-standard OAuth 2.0 SASL).
# https://developers.google.com/gmail/imap/xoauth2-protocol
#imap.sasl.xoauth2.username = "user@example.com"
#imap.sasl.xoauth2.token.raw = "***"
# SASL SCRAM-SHA-256.
# https://datatracker.ietf.org/doc/html/rfc7677
#imap.sasl.scram-sha-256.username = "user@example.com"
#imap.sasl.scram-sha-256.password.raw = "***"
# RFC 2971 ID extension. Some providers (mail.qq.com, fastmail) require an `ID`
# exchange straight after authentication; set `auto = true` to opt in.
# https://www.rfc-editor.org/rfc/rfc2971.html
#imap.id.auto = false
# Per-field policy for the auto-ID command. Keys not listed here are NOT sent.
# `true` substitutes himalaya's canned value for the well-known keys (name,
# version, vendor, support-url); unknown keys with `true` fall back to NIL with
# a warning. `false` always sends NIL. An empty map sends `ID NIL`.
#imap.id.fields = { name = true, version = true, vendor = true, support-url = true }
# RFC 5256 SORT fallback. When the server lacks the SORT capability, himalaya
# sorts client-side via SEARCH + FETCH. Leave unset to follow the capability;
# set `true` to always sort client-side, or `false` to always issue a server SORT.
# https://www.rfc-editor.org/rfc/rfc5256.html
#imap.sort.fallback = false
# --------------------------------------------------------------------------------
# JMAP config
# https://www.iana.org/go/rfc8620
# https://www.iana.org/go/rfc8621
# --------------------------------------------------------------------------------
# JMAP server address. Either a bare authority (auto-discovered via
# `GET /.well-known/jmap`) or a full session URL.
#jmap.server = "fastmail.com"
#jmap.server = "https://api.fastmail.com/jmap/session"
# JMAP TLS provider (mirrors the imap.tls block above).
#jmap.tls.provider = "rustls"
#jmap.tls.rustls.crypto = "ring"
#jmap.tls.cert = "/path/to/custom/cert.pem"
# ALPN protocol identifiers offered during the TLS handshake. Defaults to
# ["http/1.1"] (JMAP rides on HTTP/1.1); set to [] to skip ALPN.
#jmap.alpn = ["http/1.1"]
#jmap.alpn = []
# Pick exactly one of `header`, `bearer`, `basic`.
# Raw `Authorization` header value, used verbatim.
#jmap.auth.header.raw = "Bearer eyJhbGciOiJ..."
#jmap.auth.header.command = ["pass", "show", "fastmail-token"]
# OAuth 2.0 / API token bearer.
#jmap.auth.bearer.token.raw = "***"
#jmap.auth.bearer.token.command = ["ortie", "token", "show", "-a", "fastmail"]
# HTTP Basic.
#jmap.auth.basic.username = "user@example.com"
#jmap.auth.basic.password.raw = "***"
#jmap.auth.basic.password.command = "pass show fastmail"
# Identity to send as, for `messages send` over JMAP. Optional: when
# omitted, the account's default identity (the first `Identity/get`
# reports) is used. Set it to pin a specific one; list them with
# `himalaya jmap identity get`.
#jmap.identity-id = "I0123abc"
# Drafts mailbox id used to stage outgoing messages before submission,
# for `messages send` over JMAP. Optional: when omitted, the mailbox
# with the `drafts` role is used. Set it to pin a specific one; find it
# with `himalaya jmap mailbox query --role drafts`.
#jmap.drafts-mailbox-id = "M0123abc"
# --------------------------------------------------------------------------------
# Gmail config
# --------------------------------------------------------------------------------
#
# Gmail REST API backend (https://gmail.googleapis.com). Labels are
# exposed as mailboxes and Gmail system labels back the shared flags
# (\Seen is the absence of UNREAD). Reachable through the shared
# commands (`mailboxes`, `envelopes`, `flags`, `messages`); select it
# with `--backend gmail` when an account configures several backends.
# --------------------------------------------------------------------------------
# Gmail user id (the mailbox owner). Defaults to "me", the authenticated user.
#gmail.user-id = "me"
# Gmail TLS provider (mirrors the imap.tls block above).
#gmail.tls.provider = "rustls"
#gmail.tls.rustls.crypto = "ring"
#gmail.tls.cert = "/path/to/custom/cert.pem"
# ALPN protocol identifiers offered during the TLS handshake. Defaults to
# ["http/1.1"] (the Gmail REST API rides on HTTP/1.1); set to [] to skip ALPN.
#gmail.alpn = ["http/1.1"]
# Gmail only accepts OAuth 2.0 bearer tokens; supply a short-lived access token
# (token refresh is the caller's responsibility). The client adds the `Bearer `
# prefix itself.
#gmail.auth.token.raw = "***"
#gmail.auth.token.command = ["ortie", "token", "show", "-a", "gmail"]
# --------------------------------------------------------------------------------
# Microsoft Graph config
# --------------------------------------------------------------------------------
#
# Microsoft Graph API backend (https://graph.microsoft.com). Mail folders are
# exposed as mailboxes and message fields back the shared flags (\Seen is isRead,
# \Flagged is the follow-up flag, $Important is importance=high). Reachable
# through the shared commands (`mailboxes`, `envelopes`, `flags`, `messages`);
# select it with `--backend msgraph` when an account configures several backends.
# --------------------------------------------------------------------------------
# Graph user id (the mailbox owner). Defaults to "me", the authenticated user.
#msgraph.user-id = "me"
# Graph TLS provider (mirrors the imap.tls block above).
#msgraph.tls.provider = "rustls"
#msgraph.tls.rustls.crypto = "ring"
#msgraph.tls.cert = "/path/to/custom/cert.pem"
# ALPN protocol identifiers offered during the TLS handshake. Defaults to
# ["http/1.1"] (the Graph API rides on HTTP/1.1); set to [] to skip ALPN.
#msgraph.alpn = ["http/1.1"]
# Graph only accepts OAuth 2.0 bearer tokens; supply a short-lived access token
# (token refresh is the caller's responsibility). The client adds the `Bearer `
# prefix itself.
#msgraph.auth.token.raw = "***"
#msgraph.auth.token.command = ["ortie", "token", "show", "-a", "msgraph"]
# --------------------------------------------------------------------------------
# Maildir config
# --------------------------------------------------------------------------------
# Root directory containing one subdirectory per mailbox (Maildir++ layout).
#maildir.root = "~/Mail/example"
# --------------------------------------------------------------------------------
# SMTP config
# https://www.iana.org/go/rfc5321
# --------------------------------------------------------------------------------
# SMTP server. Either a bare authority (`host[:port]`, treated as
# `smtps://<authority>` by default), or a full URL with `smtp://` (cleartext,
# optionally upgraded via STARTTLS) or `smtps://` (implicit TLS) scheme.
= "example.com"
#smtp.server = "smtp.example.com:587"
#smtp.server = "smtp://example.com:587"
#smtp.server = "smtps://example.com:465"
# TLS provider, defaults to the first available at runtime.
#smtp.tls.provider = "rustls"
#smtp.tls.provider = "native-tls"
# Crypto provider for rustls, defaults to the first available at runtime.
#smtp.tls.rustls.crypto = "ring"
#smtp.tls.rustls.crypto = "aws"
# Custom TLS certificate (extra root, PEM-encoded).
#smtp.tls.cert = "/path/to/custom/cert.pem"
# Enable STARTTLS (only valid when the server resolves to `smtp://`).
#smtp.starttls = false
# ALPN protocol identifiers offered during the TLS handshake. Defaults to
# ["smtp"]; set to [] to skip ALPN.
#smtp.alpn = ["smtp"]
#smtp.alpn = []
# Pick exactly one SASL mechanism among `anonymous`, `login`, `plain`,
# `oauthbearer`, `xoauth2`, `scram-sha-256`. Omit the whole `smtp.sasl` table
# to skip authentication entirely.
# SASL ANONYMOUS
#smtp.sasl.anonymous.message = "himalaya"
# SASL PLAIN
= "user@example.com"
= "***"
#smtp.sasl.plain.password.command = "pass show example"
# SASL LOGIN
#smtp.sasl.login.username = "user@example.com"
#smtp.sasl.login.password.raw = "***"
# SASL OAUTHBEARER (host/port for the GS2 header are derived from the
# SMTP server URL at connect time).
#smtp.sasl.oauthbearer.username = "user@example.com"
#smtp.sasl.oauthbearer.token.raw = "***"
# SASL XOAUTH2
#smtp.sasl.xoauth2.username = "user@example.com"
#smtp.sasl.xoauth2.token.raw = "***"
# SASL SCRAM-SHA-256
#smtp.sasl.scram-sha-256.username = "user@example.com"
#smtp.sasl.scram-sha-256.password.raw = "***"