A new alpha version is up for test/review. It’s starting to look like a real client! Get it here. Some highlights are:
- Support for async IO using the
smol
runtime.IMAP
backend is now async. - imap:
add server_password_command
- add optional SMTP client. Instead of using an external command (I was using
msmtp
for example) meli can connect to an SMTP server by itself. See documentation forsend_mail
option. - Custom themes
Online demo
I managed to compile meli to WebAssembly, and made an online demo so that you can get a feel for it without having to download/build it first. It’s not perfect, but it works.
Themes
what
meli comes with two themes, dark (the default) and light. Here’s how a theme is defined:
[terminal.themes.watermelon]
"theme_default" = { fg = "#F50431", bg = "#FFD5FD", attrs = "Default" }
"widgets.list.header" = { fg = "#FFD5FD", bg = "#F50431", attrs = "Bold" }
"mail.listing.attachment_flag" = { fg = "LightSlateGrey", bg = "theme_default", attrs = "theme_default" }
"mail.listing.compact.even" = { fg = "White", bg = "#6CA94A", attrs = "Bold" }
"mail.listing.compact.highlighted" = { fg = "#157241", bg = "#f74b41", attrs = "theme_default" }
...
etc.
You can also define color aliases:
[terminal.themes."hunter2"]
color_aliases= { "Jebediah" = "#b4da55" }
"mail.listing.tag_default" = { fg = "$Jebediah" }
...
where
Custom themes can be defined as lists of key-values in the configuration files:
$XDG_CONFIG_HOME/meli/config.toml
$XDG_CONFIG_HOME/meli/themes/*.toml
The application theme is then defined in the configuration as follows:
how
You can create a theme template with a command line flag:
Sample themes can be found in the samples/
directory in the source repository. Detailed documentation can be found in meli-themes(5)
which is also available online sidenote: I couldn’t get mandoc to generate large (i.e. longer than a page) tables. There is a GNU mdoc extension for this but it’s not supported. Bummer
Other subcommands
SUBCOMMANDS:
create-config create a sample configuration file with available configuration options. If PATH is not
specified, meli will try to create it in $XDG_CONFIG_HOME/meli/config.toml
test-config test a configuration file for syntax issues or missing options
man print documentation page and exit (Piping to a pager is recommended.) [aliases: docs]
help Prints this message or the help of the given subcommand(s)
print-default-theme print default theme in full to stdout and exit
print-loaded-themes print loaded themes in full to stdout and exit
view View mail from input file
Usability improvements
- Set default filter globally or per-mailbox e.g. show only unseen e-mail (virtual mailboxes coming soon). This is done on the UI and not in the backend, so specifying a filter won’t for example make less IMAP requests. This will be supported in the future.
[listing]
filter = "not flags:seen" # show only unseen messages globally
# or
[accounts."personal account".mailboxes]
"INBOX" = { listing.filter = "not flags:seen" } # override global settings for this mailbox
- Oh, and override any setting that makes sense per mailbox or per account. You can for example use different sending mail options for each account, or different shortcuts for some mailboxes.
- Search in pagers, and the shortcut panel with a simple KMP implementation
- Autoload mailbox option - don’t load big mailboxes on startup till you request them
- Create/delete mailbox, {un,}subscribe mailbox
- Set default headers
- Manual check for new mail (default key F5). IMAP checks server, maildir can be configured to run a command (setting
refresh_command
) - Primitive fs autocomplete for commands, till a proper parser with states is written
- Custom date format strings
$NO_COLOR
disable colors application-wide conforming to https://no-color.orglibnotmuch
is now loaded dynamically. It’s included in the default build configuration.- Display
text/html
attachments if thetext/plain
alternative is empty. (setting:auto_choose_multipart_alternative
)
Distribution and building
- Makefile has been improved:
/path/to/meli % make help
For a quick start, build and install locally:
PREFIX=~/.local make install
Available subcommands:
- meli (builds meli with optimizations in $CARGO_TARGET_DIR)
- install (installs binary in $BINDIR and documentation to $MANDIR)
- uninstall
Secondary subcommands:
- clean (cleans build artifacts)
- check-deps (checks dependencies)
- install-bin (installs binary to $BINDIR)
- install-doc (installs manpages to $MANDIR)
- help (prints this information)
- dist (creates release tarball named meli-0.5.1.tar.gz in this directory)
- deb-dist (builds debian package in the parent directory)
- distclean (cleans distribution build artifacts)
ENVIRONMENT variables of interest:
* PREFIX = /usr/local
* MELI_FEATURES = unset
* BINDIR = /usr/local/bin
* MANDIR = /usr/local/share/man
* MANPATH = unset
* output of manpath(1) = /home/epilys/.local/share/man:/usr/share/man:/usr/local/man:/usr/local/share/man
* NO_MAN unset
* NO_COLOR unset
binaries and debian package
available in crates.io
What’s next
- async JMAP
- NNTP, RSS backends
- mail storage sync/conversion. The pieces are there, and must be assembled into a functionality.
- Efficient IMAP offline caching. Right now all mail is fetched everytime you launch the client, which obviously is not desirable. There’s work being done on
QRESYNC
,CONDSTORE
, and lazy fetch of messages when viewing a mailbox. - More GPG support. Signatures can be verified but that’s all that exists now. Encryption will be implemented along with WKD support.
- Custom action macros, for example pipe attachments to a script which is already possible with commands.
Notes
- there is managesieve REPL binary in the repository. I haven’t had the time to put managesieve functionality in the TUI yet.
- I haven’t explored yet how to expose the API to users properly. I am thinking of using something like rhai along with general MessagePack IPC.
- There is no API for UI widgets/graphics yet. I’m not sure how to design this right now.
- There’s an old implementation demo for a mail backend in python using NNTP. It’s probably not working anymore.
- There’s an old implementation demo for viewing images in ANSI in python using https://github.com/stefanhaustein/TerminalImageViewer. It might not work anymore.
Follow me on mastodon for updates. Join #meli on Freenode or with matrix’s IRC bridge. I am interested in how you’re using meli and fixing any problems you will probably encounter.