Compare commits

...

223 Commits

Author SHA1 Message Date
Manos Pitsidianakis d7e6b40b7e accounts: auto re-index sqlite3 database if it's missing
Instead of telling user to do it themselves
2 days ago
Manos Pitsidianakis e0257c9d8d
Run cargo-sort 3 days ago
Manos Pitsidianakis 27a4dcb916
Fix some rustdoc lints 3 days ago
Manos Pitsidianakis bf615e7d93
melib/thread: check for case when envelope has its own message id in References and In-Reply-To
Emails sent from meli's gitea do this, and it makes them invisible in
thread listings.
3 days ago
Manos Pitsidianakis b92a80a23a
melib/imap: resync even if UIDVALIDITY is missing from cache
I think this is related to #98 meli gets stuck on `set seen' for mail (threads) at random

#98
3 days ago
Manos Pitsidianakis f8623d4b2c
melib/imap: implement more ResponseCode cases 3 days ago
Manos Pitsidianakis 299c8e0f99
meli: restructure pub use melib::* imports 3 days ago
Manos Pitsidianakis c5ecaceae1
melib/search: fix some search criteria in Query type 3 days ago
Manos Pitsidianakis 6bf1756de8 melib/search: implement more search criteria in Query type 3 days ago
Manos Pitsidianakis 23d95973d4 melib/backends/imap: add search.rs module
Add trait to convert melib::search::Query type to an IMAP appropriate
query string (search criteria).
4 days ago
Manos Pitsidianakis 6388bea9a0 melib/email/headers: fix &[u8] index in HeaderMap 4 days ago
Manos Pitsidianakis f537c24909 utilities/widgets.rs: move text field to its own module 4 days ago
Guillaume Ranquet daf42fd456 config_macros.rs: fix build error with quote 1.0.28
With quote 1.0.28 the TokenTree enum is declared as a private enum
thus causing this error at build time:

error[E0603]: enum `TokenTree` is private
   --> config_macros.rs:114:54
    |
114 | ...                   if let quote::__private::TokenTree::Group(g) =
    |                                                ^^^^^^^^^ private enum

Use enum definition from proc_macro2 instead.

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
7 days ago
Manos Pitsidianakis 58889bcadd
pager: Add show_extra_headers option
Show custom set headers on pager, if existent.

Quoting meli.conf(5):

> show_extra_headers [String]           (optional) Extra headers to
>                                      display, if present, in the
>                                      default header preamble of
>                                      the pager.  This setting is
>                                      useful especially when used
>                                      per-folder or per-account.
>                                      For example, if you use
>                                      ‘rss2email’ (See r2e(1)) the
>                                      e-mail you will receive will
>                                      have the ‘X-RSS-Feed’ header
>                                      by default.  You can show
>                                      them only in the folder
>                                      where you keep your feed
>                                      items:
>
>                                      [accounts."personal".mailboxes]
>                                      INBOX = {}
>                                      "INBOX/Sent" = { sort_order=0 }
>                                      "INBOX/Feeds" = { pager.show_extra_headers = ["X-RSS-Feed"] }
>                                      (empty)
1 week ago
Manos Pitsidianakis d332e4578d
melib/headers: add proper Display impl for HeaderName 1 week ago
Manos Pitsidianakis 954329d848 Set file extensions to temp files, use `open` in macos
If html_filter fails, meli unwraps it. Also, if it can't find an xdg default app it also fails.

So use xdg-open and open as failsaifes.

But that requires `open` to know it's an html file, so implemented setting temp file extensions as well.
1 week ago
Manos Pitsidianakis aebff3d3d9 melib: implement mailto RFC properly
This allows mailto links with `In-Reply-To` parameters to work properly.

PS Mailto links can be used with the `mailto MAILTO_URI` command
1 week ago
Manos Pitsidianakis 235fceaf21 melib: Add standard heeder constants in email::headers
Like `http` crate does
1 week ago
Damian Poddebniak 1eea8bab77 tests: Fix `test_imap_fetch_response`. 2 weeks ago
Damian Poddebniak 30866f752b chore: Bypass rustfmt bug. 2 weeks ago
Manos Pitsidianakis 1f8ac2287b
docs/external-tools.md: fix ftplugin location and add example mail.vim file 2 weeks ago
Manos Pitsidianakis c9d26bb415
mail/compose: add configurable custom hooks with shell commands
Quoting the docs at meli.conf(5):

```text
 custom_compose_hooks [{ name = String, command = String }]

 (optional) Custom compose-hooks that run shell scripts.
 compose-hooks run before submitting an e-mail.
 They perform draft validation and/or transformations.
 If a custom hook exits with an error status or prints output to
 stdout and stderr, it will show up in the UI as a notification.

 Example:

 [composing]
 editor_cmd = '~/.local/bin/vim +/^$'
 embed = true
 custom_compose_hooks = [ { name ="spellcheck", command="aspell --mode email --dont-suggest --ignore-case list" }]
 ```
3 weeks ago
Manos Pitsidianakis cc27639fca
melib/email/compose: use Envelope attachments when editing and don't add already existing headers 3 weeks ago
Damian Poddebniak f63f6445ad chore: Improve error message when `m4` executable is missing. 3 weeks ago
Damian Poddebniak 682ea5547e chore: Add `.idea` (CLion) to `.gitignore`. 3 weeks ago
Manos Pitsidianakis 24103f3310
docs: add external-tools.md document 3 weeks ago
Manos Pitsidianakis 91557c2c43
mail/listing.rs: prevent list blank when refreshing account
Mail list would go blank if the currently focused account received a
Status update event.
3 weeks ago
Manos Pitsidianakis 428f752b20
Remove obsolete crate::components::mail::get_display_name() 3 weeks ago
Manos Pitsidianakis 77020e0c19
Update CHANGELOG.md 3 weeks ago
Manos Pitsidianakis 8c671935f9
Add compose (pre-submission) hooks for validation/linting
compose-hooks run before submitting an e-mail.
They perform draft validation and/or transformations.
If a hook encounters an error or warning, it will show up as a notification.
The currently available hooks are:
- past-date-warn
  Warn if Date header value is far in the past or future.
- important-header-warn
  Warn if important headers (From, Date, To, Cc, Bcc) are missing or invalid.
- missing-attachment-warn
  Warn if Subject, draft body mention attachments but they are missing.
- empty-draft-warn
  Warn if draft has no subject and no body.

They can be disabled with [composing.disabled_compose_hooks] setting.
3 weeks ago
Manos Pitsidianakis 1f1ea30769
components/mail/view: on draw() set dirty on return 1 month ago
Manos Pitsidianakis 85d4316a6a
Replace old logging module with the `log` create 1 month ago
Manos Pitsidianakis 30cc5d3d02
docs: add edit-config in manpages 1 month ago
Manos Pitsidianakis b1a7188771
Clippy fixes 1 month ago
Manos Pitsidianakis 3a02b6fb80
README.md: mention how to override w3m with html_filter 1 month ago
3nt3 34bb532e8d
Mention w3m dependency
Fixes #181

Signed-off-by: 3nt3 <gott@3nt3.de>
1 month ago
Manos Pitsidianakis 47e6d5d935
meli: add edit-config CLI subcommand that opens config files on EDITOR 1 month ago
Manos Pitsidianakis 39d9c2af3b
melib/smtp: fix test smtp server logic 1 month ago
Manos Pitsidianakis d679a74450
melib/jmap: Implement Bearer token authentication
Fastmail now uses an API token in a http header for authentication.

This can be used either as a server_password or provided by a
server_password_command like oauth2.
2 months ago
Manos Pitsidianakis d9c07def0f
Add command to select charset encoding for email
Open dialog to select charset with `d`.
2 months ago
Manos Pitsidianakis 939dc15e28
Fix melib tests 2 months ago
Manos Pitsidianakis 3adf72aed0
Add support for utf-7 encoding
Closes #175
2 months ago
Johannes Schilling 2447a2cbfe melib/jmap: avoid relying on hardcoded hash values
The hash values seem to have changed in the meantime, or aren't the same
on all environments.
3 months ago
Manos Pitsidianakis d7ec97f03b Small rustfmt change 3 months ago
Johannes Schilling fbc1007ff4 jmap: deserialize `null` to empty vec for messageId
The spec says MessageId can be `null`, handle that case and deserialize
it to an empty Vec.
3 months ago
cos 256a3e252e Update minimum supported rust version
Code requires label_break_value feature, which was [stabilized][0] in
release 1.65.0 of the toolchain.

[0]: https://github.com/rust-lang/rust/pull/99332
3 months ago
Manos Pitsidianakis 3a10953f05 debian/: update fix-prefix-for-debian.patch 3 months ago
Manos Pitsidianakis 11140b4a76 Fix test output
test_compose_reply_subject_prefix requires access to / path, and fails
when building with deb-dist
3 months ago
cos 671ce9f694 debian/: add missing build dependencies
quilt has unconditionally been used in debian/rules since the initial
addition of debian packaging support in commit bb80de.

sqlite3 has been a default feature since at least commit 6ceed3,
possibly longer through rusqlite.
3 months ago
Johannes Schilling 12cb717bda melib: add server_password_command to jmap
Move the handling of either `server_password` or
`server_password_command` from the imap backend to the common
`AccountSettings` struct and add it for jmap as well.
3 months ago
Manos Pitsidianakis f9ac9b607a Temporarily disable libgpgme functions because of a bug
`Possible incorrect libgpgme API usage causes a SIGABRT when verifying
signatures #176`

<#176>
4 months ago
Manos Pitsidianakis 660bacb926 Add `mailto` command to open composer with initial values from mailto template 5 months ago
Manos Pitsidianakis de2f46fe61 rustfmt changes 5 months ago
Manos Pitsidianakis 5443b7e8f3 melib/sieve: remove literal_map() parse combinator 5 months ago
Manos Pitsidianakis 3c847ad26a melib/sieve.rs: add beginning of sieve parser
Concerns #153

Support filtering rules to move mails to folders #153 <#153>
5 months ago
Manos Pitsidianakis 2878bbb8c8 melib/addressbook: add parser for mutt alias file 6 months ago
Manos Pitsidianakis 40c6647db8 Fix multipart/related with main text/html part not displayed correctly 6 months ago
Manos Pitsidianakis f63ce388f7 commands: move ManageMailboxes to Tab Actions 6 months ago
Manos Pitsidianakis c06c3f5893 mail/listing/conversations: draw gap between list and mail view 6 months ago
Manos Pitsidianakis abc56eae43 mail/listing: fix SEEN flag update hiding mail view momentarily 6 months ago
Manos Pitsidianakis 7606317f24 melib/notmuch: add support for virtual mailbox hierarchy
Add optional "parent" property to notmuch mailbox configuration.

Closes #167

#167
6 months ago
Manos Pitsidianakis 4f45b10974 mail/listing: fix tag updates not showing up right away
Closes #132
Closes #133
6 months ago
Manos Pitsidianakis 5634f95553 Rename MeliError struct to Error 6 months ago
Manos Pitsidianakis 259aeb0087 Convert {Account,Mailbox}Hash from typedef to wrapper struct 6 months ago
Manos Pitsidianakis 7382e30160 Convert EnvelopeHash from typedef to wrapper struct 6 months ago
Manos Pitsidianakis 2427b097c5 themes: make tag_default background lighter on light theme
Closes #164
6 months ago
Manos Pitsidianakis 252d2bdf2f Replace hardcoded /bin/false with 'false'
Credits to http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/mail/meli/patches/patch-src_conf_rs?rev=1.1.1.1&content-type=text/x-cvsweb-markup
6 months ago
Manos Pitsidianakis eaecc5ea12 melib/notmuch: remove hardcoded major .so version for non linux/macos target_os
Credits to http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/mail/meli/patches/patch-melib_src_backends_notmuch_rs?rev=1.1&content-type=text/x-cvsweb-markup for discovering this.
6 months ago
Manos Pitsidianakis 4b96bd591f mail/listing: add ColorCache constructor to deduplicate code 6 months ago
Manos Pitsidianakis b9030a684c listings: fix selection not appearing immediately and invalid motions 6 months ago
Manos Pitsidianakis 2224a7100f melib/imap: reset imap cache on init error 6 months ago
Manos Pitsidianakis 7924aa8bfe melib/jmap: fix compilation 6 months ago
Manos Pitsidianakis 7af893597f conf/shortcuts.rs: replace use of Self::DESCRIPTION with Shortcuts struct consts 6 months ago
Manos Pitsidianakis 7d9cabb023 Add mailbox manager tab 6 months ago
Manos Pitsidianakis ee9d458b05 accounts.rs: implement mailbox {un,}sub actions 6 months ago
Manos Pitsidianakis 5ba7b2cd7b meli: fix clippy lints for meli binary 7 months ago
Manos Pitsidianakis 104352e595 Add table UI widget 7 months ago
Manos Pitsidianakis bd22f986f0 melib: fix clippy lints 7 months ago
_ ded9adde61 More descriptive "Unimplemented" messages 7 months ago
Manos Pitsidianakis 6317984136 Makefile: add --bin flag to meli cargo build target 7 months ago
Manos Pitsidianakis db227dea34 build.rs: add error messages if `mandoc`,`man` binaries are missing 7 months ago
Manos Pitsidianakis 282af86e83 docs: fix NAME sections manual pages for correct whatis(1) parsing
Reference used was WHATIS PARSING section in lexgrog(1).

This change enables the manual page to be returned with a whatis(1)
query:

 $ whatis meli
 meli (1)             - terminal e-mail client
7 months ago
Manos Pitsidianakis cc439b239a mail/listing.rs: add RowsState struct
Keep state of rows in lists in this struct to reduce code duplication in
list implementations
7 months ago
Manos Pitsidianakis b776409d6c melib/thread.rs: add thread, env hash index fields 7 months ago
Manos Pitsidianakis 56fc43bcf8 melib: add As{Ref,Mut} impls for RwRef{,Mut} 7 months ago
spike 59b95f83d2 fix docs 7 months ago
Manos Pitsidianakis 88a1f0d4bc melib/imap/parser: fix FETCH response parsing bug
Closes #160
Closes #128
8 months ago
Manos Pitsidianakis 64346dd3fe melib/parsec: add map_res, quoted_slice, is_a, alt, take, take_literal 8 months ago
Manos Pitsidianakis 17b42b1a6c melib/parsec: add json deserialization tests 8 months ago
Manos Pitsidianakis 6d20abdde7 melib/gpgme: add #[allow(deref_nullptr)] in bindgen tests 8 months ago
Manos Pitsidianakis 803d3414fd melib/imap/managesieve: implement some rfc5804 commands
Try with managesieve REPL in src/managesieve.rs:

cargo run --bin managesieve-client ~/.config/meli/config.toml
"accountname"

rfc5804 <https://www.rfc-editor.org/rfc/rfc5804.html>
8 months ago
Manos Pitsidianakis 3697b7d960 melib/datetime: don't use LC_ category in place of LC_ masks in libc calls
LC_ masks are bit masks, whereas category values are not.

Concerns #159

[imap] all mail timestamps are zero/epoch #159
#159
8 months ago
Manos Pitsidianakis dd0baa82e9 Spawn user-given command strings with sh -c ".."
If given string contains arguments, Command::new(string) will fail.

Reported in #159 #159
8 months ago
Manos Pitsidianakis 0ef4dde939 melib/jmap: wrap serde_json deserialize errors in human readable errors 8 months ago
Manos Pitsidianakis 55ed962425 melib/jmap: use server_url instead of server_hostname + server_port in config 8 months ago
Manos Pitsidianakis 46a038dc68 conf.rs: remove interactive messages when #[cfg(test)] 8 months ago
Manos Pitsidianakis 16646976d7 compose: fix reply subject prefixes stripping original prefix
Unintelligent heuristic but should cover most cases?

Configurable subject response prefix #142
#142

Closes #142
8 months ago
Manos Pitsidianakis ffb12c6d1a conf.rs: make all public struct fields public 8 months ago
Manos Pitsidianakis 7e09b1807f melib/collection: replace _Ref deref unwraps with expect() 8 months ago
Manos Pitsidianakis 129573e0fd melib/maildir: rename root_path to root_mailbox 8 months ago
Manos Pitsidianakis 0c08cb737c melib/jmap: mark mailboxes as subscribed on personal accounts
The spec https://jmap.io/spec-mail.html#mailboxes says a mailbox property `isSubscribed` should be considered true if the account is marked as `isPersonal`.

Closes #157

JMAP incompatible with Stalwart server #157 #157
8 months ago
Manos Pitsidianakis 117d7fbe04 melib/jmap/rfc8620.rs: make private fields public 8 months ago
Manos Pitsidianakis 347be54305 melib/error: add NetworkErrorKind enum 8 months ago
Manos Pitsidianakis 7935e49a00 conf/accounts.rs: check properly if mailbox request is an error 8 months ago
Manos Pitsidianakis c54a31f7cc listing/offline.rs: break line for error messages 8 months ago
Manos Pitsidianakis c3fdafde3b Documentation touchups 8 months ago
Manos Pitsidianakis c6bdda03cf melib/backends.rs: fix notmuch error shown on any missing backend 9 months ago
Manos Pitsidianakis e450ad0f9c types.rs: remove unused struct 9 months ago
Manos Pitsidianakis 0ed10711ef notifications: add new_mail_script option
Preferred over `script` option for new email notifications
9 months ago
Manos Pitsidianakis d8d43a16fe HtmlView: add html_open config setting
Add config setting in case xdg query default app for text/html mime type
doesn't yield results.
9 months ago
Manos Pitsidianakis b87d54ea3f melib/backends.rs: impl Into<BTreeSet<EnvelopeHash>> for EnvelopeHashBatch 9 months ago
Manos Pitsidianakis a7a50d3078 src/: Box<_> some large fields in biggest types
As reported by `cargo +nightly typesize`
9 months ago
Manos Pitsidianakis b138d9bc61 melib: fix some clippy lints 9 months ago
Manos Pitsidianakis 787c64c2da conf.rs: remove expect()s from create_config_file()
No reason to expect(), just return the error.
9 months ago
Manos Pitsidianakis 0df46a63ec Show error if sqlite3 search backend is set but doesn't exist
Closes #114
9 months ago
Manos Pitsidianakis 94bd84b45d Fix clippy lints for `meli` crate 9 months ago
Manos Pitsidianakis 388d4e35d6 listing/offline.rs: add in-progress messages while connecting in IMAP 9 months ago
Manos Pitsidianakis 9cbbf71e0f melib/email/attachments: Add DecodeOptions struct for decoding 9 months ago
Manos Pitsidianakis 3688369278 melib/smtp: add smtp test 9 months ago
Manos Pitsidianakis 3c0f5d8274 melib/smtp: add BINARYMIME support to smtp client
Concerns #49

IMAP: Lemonade profile tracking issue
9 months ago
Manos Pitsidianakis a72c96a26a melib/smtp: add 8BITMIME support to smtp client
Concerns #49

IMAP: Lemonade profile tracking issue
9 months ago
Manos Pitsidianakis 8c7b001aa5 listing/conversations.rs: add `thread_subject_pack` command to pack different inner thread subjects in entry title 9 months ago
Manos Pitsidianakis 9dc4d4055c listing: add focus_{left,right} shortcuts to switch focus
This allows you to make the mail entry column occupy the whole screen if
you press focus_right (Right key) twice.
9 months ago
Manos Pitsidianakis 3d92b41075 Add cli-docs feature to the default set 9 months ago
Manos Pitsidianakis 7c7115427d docs/meli.7: complete guide document 9 months ago
Manos Pitsidianakis 5fa4b6260c docs/meli.7: add more screenshots 9 months ago
Manos Pitsidianakis 4a20fc42e1 Update CHANGELOG.md 9 months ago
Manos Pitsidianakis f76f4ea3f7 docs: add meli.7, a general tutorial document
This commit also changes some shortcut names.
9 months ago
Manos Pitsidianakis 2de69d17f1 melib/compose: fix erroneous placement of newlnes for wrap_header_preamble suffix 9 months ago
Manos Pitsidianakis cbe593cf31 mail/compose: add configurable header preample suffix and prefix for editing
This commit adds a new configuration value for the composing section of
settings. Quoting the documentation:

 wrap_header_preamble: Option<(String, String)>
 optional

 Wrap header preample when editing a draft in an editor. This allows you
 to write non-plain text email without the preamble creating syntax
 errors. They are stripped when you return from the editor. The values
 should be a two element array of strings, a prefix and suffix. This can
 be useful when for example you're writing Markdown; you can set the
 value to ["<!--",\ "-->"] which wraps the headers in an HTML comment.
9 months ago
Manos Pitsidianakis a484b397c6 melib/notmuch: show informative error messages if libloading fails
Add instructions on how to solve this, and also a config setting
`library_file_path` to set the path manually if necessary.
9 months ago
Manos Pitsidianakis eb5949dc9b melib/error.rs: switch summary<->details identifiers
They are more intuitive like this.
9 months ago
Manos Pitsidianakis aa99b0d787 compose: implement configurable subject prefix stripping when replying
Introduce functionality to strip email subject from a set list of
prefixes or from a user set list.

Also, added a setting for the reply prefix (default is "Re:").

Closes #142
9 months ago
Manos Pitsidianakis da9c80ccfd melib: Enhance SubjectPrefix with strip_prefixes_from_list() method
And make it public.
9 months ago
Manos Pitsidianakis a73885acb1 Improve embed terminal
- Add character attribute support
- Add cursor key mode support
- Fix buggy set fg / bg sequences

And added a bin under tools to test arbitrary apps using the embedded
terminal:

 cargo run -p tools --bin embed -- "htop" 2> .htop.debug.log
9 months ago
Manos Pitsidianakis 480000ebbb melib/notmuch: show error if account directory does not contain ".notmuch" subdirectory
Bug reported by user on mailing list.
9 months ago
Manos Pitsidianakis 29042aba59 melib/datetime: add mbox date format parse 9 months ago
Manos Pitsidianakis a42a6ca868 notifications.rs: show notifications in terminal if no alternative
If no alternative (dbus or notification command) show notifications
inside the terminal.
9 months ago
Manos Pitsidianakis bde87af387 Refactor filter() method in Listing trait 9 months ago
Manos Pitsidianakis 10497952f7 Wrap stdout in BufWriter
Hopefully this makes redrawing the terminal faster
9 months ago
Manos Pitsidianakis 0c0bee4482 Makefile: add missing .PHONY targets, fix missing tab indentation 9 months ago
Manos Pitsidianakis ca48896865 Cargo.toml: add strip option to profile.release 9 months ago
Manos Pitsidianakis 7650805c60 Bring stripped binary size down to 7MiB 9 months ago
Manos Pitsidianakis e29041f733 Rename src/bin.rs to src/main.rs 9 months ago
Manos Pitsidianakis f4e0970d46 mail/compose.rs: add ability to kill embed process
If embed editor process is unresponsive, there was no way to kill it.
Add force kill option by pressing Ctrl+C.
9 months ago
Manos Pitsidianakis 9cb66ef818 Fix all clippy warnings in `meli` crate 10 months ago
Guillaume Ranquet d921b3c320 compact.rs: use mail sorting parameters from config
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
10 months ago
Guillaume Ranquet 9205f3b8af conf.rs: handle a per account mail order parameter
The new order parameter adds the possibility to specify a
sort order on a per account basis.

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
10 months ago
Guillaume Ranquet 97ff3e787f conf.rs: only add toml files to the themes
By default, all files under MELI_CONFIG/themes are added to the
configuration files.
If one of these files is a binary file, this will provoke an error.

Summary: InvalidData
stream did not contain valid UTF-8
Caused by: stream did not contain valid UTF-8
Kind: OS Errorthread 'main' panicked at 'failed', melib/src/error.rs:201:9

Fixes the potential issue by filtering by file extension.

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
10 months ago
Manos Pitsidianakis 824f614a69 mail/view: Fix HtmlView not being redrawn when parent is dirty 10 months ago
Manos Pitsidianakis ed3dbc8586 listing/conversations: fix crashes when listing is empty 10 months ago
Manos Pitsidianakis 7fca5f01ef melib/jmap: fix jmap build with isahc 1.7.2 10 months ago
Manos Pitsidianakis b716e4383e Add collapse option for mailboxes in sidebar menu
Closes #130

Feature request: collapsible folders with total counter #130 #130
10 months ago
Manos Pitsidianakis 4a79b2021d Update dependency versions 10 months ago
Manos Pitsidianakis daa900ec9a Fix embed terminal in macos
Pseudoterminal wasn't created correctly on macos
10 months ago
Manos Pitsidianakis ca84906d7d notifications: escape all quotes in applescript on macos 11 months ago
Manos Pitsidianakis ce269c64e1 conf: don't fail on `server_password_command`
Don't fail when parsing an IMAP config when it has
`server_password_command` set.

Closes #139

Meli stopped recognizing server_password_command configuration #139
1 year ago
Manos Pitsidianakis 0f6f3e30c6 conf: add IMAP config in config parse test 1 year ago
Manos Pitsidianakis e6d6e1f588 compose: don't unwrap if pseudoterminal creation fails
Show error notification instead.
1 year ago
Manos Pitsidianakis dc5afa13db notifications: use osascript/applescript for notifications on macos 1 year ago
Manos Pitsidianakis d6355a3043 melib/email/parser: impl Debug for ParsingError 1 year ago
Manos Pitsidianakis 6a843d4983 melib/maildir: export list_mail_in_maildir_fs() function 1 year ago
Manos Pitsidianakis 9558b2ae92 melib/email: parse Cp1253 as windows1253 encoding 1 year ago
Manos Pitsidianakis 4fdc90b31e Use `open` instead of `xdg-open` in macos
TODO: make this configurable instead.
1 year ago
Manos Pitsidianakis 8563bccd1b listing/conversations: don't cache CellBuffer, only row info
Caching a CellBuffer (a terminal grid view) takes too much RAM on big
mailboxes. Store just the information needed to write each row entry
when needed to draw a page instead.
1 year ago
Manos Pitsidianakis 721891c295 Update nom dependency 1 year ago
Manos Pitsidianakis 2c23ca34cd Update most Cargo dependencies 1 year ago
Manos Pitsidianakis 2eb22a290a
Stop hardcoding certain component colors
`Color::Byte` references were before themes were introduced in the code
base. Their presence is a bug and they should all be replaced by theme
values.

Closes #124

Stop hardcoding certain component colors #124
#124
1 year ago
Manos Pitsidianakis 5823178cc2
themes.rs: add test that looks in source code for invalid theme key references 1 year ago
Manos Pitsidianakis 81184b182c
Add extra_identities configuration flag
Closes #119

Multi identies per account #119 #119
1 year ago
Manos Pitsidianakis aa3524dd30
melib/backends/notmuch: fix tag not being removed in set_flags()
May be related to #132

Cannot remove tags in the notmuch backend #132

> Running tag remove TAG on the notmuch backend does nothing. At a
> glance, this seems to be because NotmuchMailbox::set_flags never bothers
> to remove tags that are already present but not in the list of new tags.
> I could try fixing it, but I have no idea how the contribution process
> works here (my guess is the mailing list, but, well, #131).

#132
1 year ago
Manos Pitsidianakis 23c2355662
utilities.rs: fill and align shortcut table columns 1 year ago
Manos Pitsidianakis d3e62e3d74
utilities/dialogs.rs: use conf shortcuts for scroll {up, down} 1 year ago
Manos Pitsidianakis a866b29499
docs/meli.conf.5: update valid shortcut entries from src/conf/shortcuts.rs
Closes #136

docs/meli.conf.5 does not contain all shortcuts #136 #136
1 year ago
Manos Pitsidianakis f5dc25ae0d
conf.rs: check that all conf flags are recognized in validation
This commit adds logic in configuration file validation that checks that
each account "extra" field is empty after getting it back from the
backend validation. This is to ensure the user doesn't set options that
are invalidly stated in the documentation or by accident.

Closes #135

Configuration error (xxx): the following flags are set but are not recognized: ["index_style"] #135
1 year ago
Manos Pitsidianakis d0de04854e
listing.rs: add {in,de}crease_sidebar shortcuts
`increase_sidebar`: Increase sidebar width.
Default value Ctrl-p

`decrease_sidebar`: Decrease sidebar width.
Default value Ctrl-o
1 year ago
Manos Pitsidianakis 340d6451a3
listing.rs: add config setting for sidebar ratio 1 year ago
Manos Pitsidianakis e9aaa7b067
melib/datetime: use *const c_char instead of *const i8 for portability
Using *const i8 broke compatibility with arm64.

Fixes #127
1 year ago
Manos Pitsidianakis d4b690d5d3
melib/imap: send password as byte literal on LOGIN
Concerns #125

Escape IMAP passwords properly #125
1 year ago
Manos Pitsidianakis ce2068d36b
melib/jmap: fix background watch using JSON paths incorrectly 1 year ago
Manos Pitsidianakis 0d8bedd2d5
melib/jmap: make is_online() await for connection
Closes	#126 #126
1 year ago
Manos Pitsidianakis 81d1265601
melib/imap: escape IMAP passwords properly
Closes #125
2 years ago
Manos Pitsidianakis d8e9a00563
melib/imap: add quoted REFERENCES field in parsing of responses 2 years ago
Geoff Beier 330a2b20ed
conf.rs: flush stdout in Ask() after printing 2 years ago
Manos Pitsidianakis 36e29cb6fd
Add configurable mailbox sort order
Closes #25

```
     sort_order unsigned integer           (optional) Override sort order on the sidebar for this mailbox.  Example:

                                           [accounts."imap.example.com".mailboxes]
                                             "INBOX" = { index_style = "plain" }
                                             "INBOX/Sent" = { sort_order = 0 }
                                             "INBOX/Drafts" = { sort_order = 1 }
                                             "INBOX/Lists" = { sort_order = 2 }
```
2 years ago
Manos Pitsidianakis 5f003a31be
melib/addressbook/vcard: Parse vCards with just LF instead of CRLF line endings
According to the vcard RFC
https://datatracker.ietf.org/doc/html/rfc6350#section-3.2 all lines must
end with CRLF (\r\n or 0x0d 0x0a)

Some VCard sources use only newline, which, while spec violating is easy
to recover from. So parse them as if they are correct.

Closes #121
2 years ago
Manos Pitsidianakis 2580522931
melib/addressbook: log vcard parsing failures 2 years ago
Manos Pitsidianakis 15ca25af73
Bump version to 0.7.2 2 years ago
Manos Pitsidianakis 37d0846195
melib/email/address: quote display_name if it contains "," 2 years ago
Manos Pitsidianakis ffc498a5d0
melib/smtp: fix Cc and Bcc ignored when sending mail 2 years ago
Manos Pitsidianakis d25eb00a11
command: improve(?) command completion and add test 2 years ago
Manos Pitsidianakis 240374950a
melib/email/address: quote display_name if it contains "." 2 years ago
Manos Pitsidianakis 505adca54d
Add forward mail option
Forward email with shortcut 'forward' (default ctrl+f)

This opens a composing tab letting you to select receiver etc.

"composing" config setting "forward_as_attachment" selects the
forwarding behavior:

- "ask" asks you ever time
- true always forwards by attaching the entire email as a single
attachment
- false always forwards by inlining the email, like most email clients
do.

Closes #120
2 years ago
Manos Pitsidianakis e090c31f96
state: Move grid to Screen struct under terminal mod 2 years ago
Manos Pitsidianakis 20feb50475
view/thread: open the latest email in the thread by default 2 years ago
Manos Pitsidianakis f975e1004c
Add url_launcher config setting 2 years ago
Manos Pitsidianakis b88c3c573d
Add add_addresses_to_contacts command 2 years ago
Manos Pitsidianakis 32901f57d2
Add show_date_in_my_timezone pager config flag
Closes #28
2 years ago
Manos Pitsidianakis d1712557cb
docs: add pager filter documentation 2 years ago
Manos Pitsidianakis a977351f0a
mail/view: respect per-folder/account pager filter override 2 years ago
Manos Pitsidianakis e7b9d2963c
pager: add filter command, esc to clear filter 2 years ago
Manos Pitsidianakis 25579d8807
terminal/cells: remove ansi module 2 years ago
Manos Pitsidianakis 22fb2ed46c
Implement pager filter through EmbedGrid
Parse pager filter output as an EmbedGrid instead of the old ansi parser
module.
2 years ago
Manos Pitsidianakis 733de5a5fb
Fix some clippy suggestions 2 years ago
Manos Pitsidianakis 592339bdca
embed: split EmbedGrid to EmbedTerminal and EmbedGrid
An embedded pseudoterminal was enclosed in the EmbedGrid struct. This
commit splits it into EmbedTerminal and EmbedGrid, with EmbedGrid
containing only the CellBuffer grid logic. With this change we can reuse
EmbedGrid to parse ANSI output from external programs into meli's
CellBuffer's.
2 years ago
Manos Pitsidianakis ae8c2addab
Show compile time features in with command argument
Show compile time feature flags with compiled-with subcommand

Closes #115
2 years ago
Manos Pitsidianakis bc08bf1d13
Bump version to 0.7.1 2 years ago
Manos Pitsidianakis 7533df86e0
Fix compilation for netbsd-9.2
$ rustc -V
rustc 1.52.1
$ cargo -V
cargo 1.52.0

Pre-requisite steps needed for build:
- Needed to install mozilla certs
- Needed to set OPENSSL_DIR=/usr
2 years ago
Manos Pitsidianakis 526a246430
melib/nntp: update total/new counters on new articles 2 years ago
Alex.F 69916f267b
add 'GB18030' charset 2 years ago
Manos Pitsidianakis 13c5798c7b
conf/shortcuts.rs: add info_message_{next,previous} 2 years ago
Manos Pitsidianakis 07e166e1fb
melib/error: Add kinds: NotImplemented, NotSupported, OSError 2 years ago
Manos Pitsidianakis 72a2ba20dc
conf/accounts.rs: print info when displaying watch error 2 years ago
Manos Pitsidianakis c8da6d2049
melib/nntp: implement refresh 2 years ago
Manos Pitsidianakis 90042379a6
melib/{imap,nntp}: throw error on extra unusued conf flags 2 years ago
Manos Pitsidianakis f40ae9e11b
Change all Down/Up shortcuts to j/k 2 years ago
Manos Pitsidianakis 09f3edba76
config: show explanation if `composing` field missing 2 years ago
Manos Pitsidianakis 09dc0a2409
melib/conf: deserialize ToggleFlag from bool & string 2 years ago
Manos Pitsidianakis 3bc187c570
melib/collections: add RwRef{,Mut} structs 2 years ago
Manos Pitsidianakis 05393d8caa
listing/conversations: highlight two rows instead of three 2 years ago
Manos Pitsidianakis b49d965695
Fix unused var etc warnings 2 years ago
Manos Pitsidianakis 6235164df2
melib/nntp: increase chunk size 2 years ago
Manos Pitsidianakis 521f634e7b
melib/nntp: implement NNTP posting 2 years ago

3
.gitignore vendored

@ -15,3 +15,6 @@ debian/debhelper-build-stamp
debian/files
debian/meli.substvars
debian/meli/
# CLion IDE
.idea

@ -7,6 +7,93 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added listing configuration setting `thread_subject_pack` (see meli.conf.5)
- Added shortcuts for focusing to sidebar menu and back to the e-mail view (`focus_left` and `focus_right`)
- `f76f4ea3` A new manual page, `meli.7` which contains a general tutorial for using meli.
- `cbe593cf` add configurable header preample suffix and prefix for editing
- `a484b397` Added instructions and information to error shown when libnotmuch could not be found.
- `a484b397` Added configuration setting `library_file_path` to notmuch backend if user wants to specify the library's location manually.
- `aa99b0d7` Implement configurable subject prefix stripping when replying
- `a73885ac` added RGB support to embedded terminal emulator.
- `f4e0970d` added ability to kill embed process with Ctrl-C, or Ctrl-Z and pressing 'q'.
- `9205f3b8` added a per account mail sort order parameter.
- `d921b3c3` implemented sorting with user sort order parameter if defined.
- `dc5afa13` use osascript/applescript for notifications on macos
- `d0de0485` add {in,de}crease_sidebar shortcuts
- `340d6451` add config setting for sidebar ratio
- `36e29cb6` Add configurable mailbox sort order
- `7606317f` melib/notmuch: add support for virtual mailbox hierarchy
Add optional `parent` property to notmuch mailbox configuration.
- `d9c07def` Add command to select charset encoding for email
Open dialog to select charset with `d`.
- `d679a744` melib/jmap: Implement Bearer token authentication
Fastmail now uses an API token in a http header for authentication.
This can be used either as a server_password or provided by a
`server_password_command` like oauth2.
- `47e6d5d9` add edit-config CLI subcommand that opens config files on `EDITOR`
- `8c671935` Add compose (pre-submission) hooks for validation/linting
compose-hooks run before submitting an e-mail.
They perform draft validation and/or transformations.
If a hook encounters an error or warning, it will show up as a notification.
The currently available hooks are:
- `past-date-warn`
Warn if Date header value is far in the past or future.
- `important-header-warn`
Warn if important headers (From, Date, To, Cc, Bcc) are missing or invalid.
- `missing-attachment-warn`
Warn if Subject, draft body mention attachments but they are missing.
- `empty-draft-warn`
Warn if draft has no subject and no body.
They can be disabled with `[composing.disabled_compose_hooks]` setting.
### Changed
- `f76f4ea3` Shortcut `open_thread` and `exit_thread` renamed to `open_entry` and `exit_entry`.
- `7650805c` Binary size reduced significantly.
### Fixed
- `a42a6ca8` show notifications in terminal if there is no other alternative.
## [alpha-0.7.2] - 2021-10-15
### Added
- Add forward mail option
- Add url_launcher config setting
- Add add_addresses_to_contacts command
- Add show_date_in_my_timezone pager config flag
- docs: add pager filter documentation
- mail/view: respect per-folder/account pager filter override
- pager: add filter command, esc to clear filter
- Show compile time features in with command argument
### Fixed
- melib/email/address: quote display_name if it contains ","
- melib/smtp: fix Cc and Bcc ignored when sending mail
- melib/email/address: quote display_name if it contains "."
## [alpha-0.7.1] - 2021-09-08
### Added
- Change all Down/Up shortcuts to j/k
- add 'GB18030' charset
- melib/nntp: implement refresh
- melib/nntp: update total/new counters on new articles
- melib/nntp: implement NNTP posting
- configs: throw error on extra unusued conf flags in some imap/nntp
- configs: throw error on missing `composing` section with explanation
### Fixed
- Fix compilation for netbsd-9.2
- conf: fixed some boolean flag values requiring to be string e.g. "true"
## [alpha-0.7.0] - 2021-09-03
### Added
@ -132,3 +219,5 @@ Notable changes:
[alpha-0.6.1]: https://github.com/meli/meli/releases/tag/alpha-0.6.1
[alpha-0.6.2]: https://github.com/meli/meli/releases/tag/alpha-0.6.2
[alpha-0.7.0]: https://github.com/meli/meli/releases/tag/alpha-0.7.0
[alpha-0.7.1]: https://github.com/meli/meli/releases/tag/alpha-0.7.1
[alpha-0.7.2]: https://github.com/meli/meli/releases/tag/alpha-0.7.2

1479
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -1,8 +1,9 @@
[package]
name = "meli"
version = "0.7.0"
version = "0.7.2"
authors = ["Manos Pitsidianakis <el13635@mail.ntua.gr>"]
edition = "2018"
rust-version = "1.65.0"
license = "GPL-3.0-or-later"
readme = "README.md"
@ -15,66 +16,70 @@ default-run = "meli"
[[bin]]
name = "meli"
path = "src/bin.rs"
path = "src/main.rs"
#[[bin]]
#name = "managesieve-meli"
#path = "src/managesieve.rs"
[lib]
name = "meli"
path = "src/lib.rs"
#[[bin]]
#name = "async"
#path = "src/async.rs"
[[bin]]
name = "managesieve-client"
path = "src/managesieve.rs"
[dependencies]
xdg = "2.1.0"
crossbeam = "0.7.2"
signal-hook = "0.1.12"
signal-hook-registry = "1.2.0"
nix = "0.17.0"
melib = { path = "melib", version = "0.7.0" }
async-task = "^4.2.0"
bincode = { version = "^1.3.0", default-features = false }
bitflags = "1.0"
crossbeam = { version = "^0.8" }
flate2 = { version = "1.0.16", optional = true }
futures = "0.3.5"
indexmap = { version = "^1.6", features = ["serde-1", ] }
libc = { version = "0.2.125", default-features = false, features = ["extra_traits",] }
linkify = { version = "^0.8", default-features = false }
melib = { path = "melib", version = "0.7.2" }
nix = { version = "^0.24", default-features = false }
notify = { version = "4.0.1", default-features = false } # >:c
num_cpus = "1.12.0"
pcre2 = { version = "0.2.3", optional = true }
serde = "1.0.71"
serde_derive = "1.0.71"
serde_json = "1.0"
toml = { version = "0.5.6", features = ["preserve_order", ] }
indexmap = { version = "^1.6", features = ["serde-1", ] }
linkify = "0.4.0"
notify = "4.0.1" # >:c
termion = "1.5.1"
bincode = "^1.3.0"
uuid = { version = "0.8.1", features = ["serde", "v4"] }
unicode-segmentation = "1.2.1" # >:c
libc = {version = "0.2.59", features = ["extra_traits",]}
signal-hook = { version = "^0.3", default-features = false }
signal-hook-registry = { version = "1.2.0", default-features = false }
smallvec = { version = "^1.5.0", features = ["serde", ] }
bitflags = "1.0"
pcre2 = { version = "0.2.3", optional = true }
structopt = { version = "0.3.14", default-features = false }
svg_crate = { version = "0.8.0", optional = true, package = "svg" }
futures = "0.3.5"
async-task = "3.0.0"
num_cpus = "1.12.0"
flate2 = { version = "1.0.16", optional = true }
svg_crate = { version = "^0.10", optional = true, package = "svg" }
termion = { version = "1.5.1", default-features = false }
toml = { version = "0.5.6", default-features = false, features = ["preserve_order", ] }
unicode-segmentation = "1.2.1" # >:c
xdg = "2.1.0"
[target.'cfg(target_os="linux")'.dependencies]
notify-rust = { version = "^4", optional = true }
notify-rust = { version = "^4", default-features = false, features = ["dbus", ], optional = true }
[build-dependencies]
syn = { version = "1.0.31", features = [] }
quote = "^1.0"
proc-macro2 = "1.0.18"
flate2 = { version = "1.0.16", optional = true }
proc-macro2 = "1.0.37"
quote = "^1.0"
syn = { version = "1.0.92", features = [] }
[dev-dependencies]
regex = "1"
tempfile = "3.3"
[profile.release]
lto = "fat"
codegen-units = 1
opt-level = "s"
debug = false
strip = true
[workspace]
members = ["melib", "tools", ]
[features]
default = ["sqlite3", "notmuch", "regexp", "smtp", "dbus-notifications", "gpgme"]
default = ["sqlite3", "notmuch", "regexp", "smtp", "dbus-notifications", "gpgme", "cli-docs"]
notmuch = ["melib/notmuch_backend", ]
jmap = ["melib/jmap_backend",]
sqlite3 = ["melib/sqlite3"]

@ -16,6 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with meli. If not, see <http://www.gnu.org/licenses/>.
.POSIX:
.SUFFIXES:
# Options
PREFIX ?= /usr/local
@ -46,11 +48,11 @@ CARGO_COLOR ?= `[ -z $${NO_COLOR+x} ] && echo "" || echo "--color=never "`
RED ?= `[ -z $${NO_COLOR+x} ] && ([ -z $${TERM} ] && echo "" || tput setaf 1) || echo ""`
GREEN ?= `[ -z $${NO_COLOR+x} ] && ([ -z $${TERM} ] && echo "" || tput setaf 2) || echo ""`
.POSIX:
.SUFFIXES:
.PHONY: meli
meli: check-deps
@${CARGO_BIN} build ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" ${FEATURES} --release
@${CARGO_BIN} build ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" ${FEATURES} --release --bin meli
.PHONY: help
help:
@echo "For a quick start, build and install locally:\n ${BOLD}${GREEN}PREFIX=~/.local make install${ANSI_RESET}\n"
@echo "Available subcommands:"
@ -92,7 +94,11 @@ help:
.PHONY: check
check:
@${CARGO_BIN} test ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" --workspace
@${CARGO_BIN} check ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" ${FEATURES} --all --tests --examples --benches --bins
.PHONY: test
test:
@${CARGO_BIN} test ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" --all --tests --examples --benches --bins
.PHONY: check-deps
check-deps:
@ -126,9 +132,9 @@ install-doc:
MANPAGEPATH=${DESTDIR}${MANDIR}/man$${SECTION}/$${MANPAGE}.gz; \
echo " * installing $${MANPAGE} → ${GREEN}$${MANPAGEPATH}${ANSI_RESET}"; \
gzip -n < ${DOCS_SUBDIR}$${MANPAGE} > $${MANPAGEPATH} \
; done ; \
; done ; \
(case ":${MANPATHS}:" in \
*:${DESTDIR}${MANDIR}:*) echo -n "";; \
*:${DESTDIR}${MANDIR}:*) echo -n "";; \
*) echo "\n${RED}${BOLD}WARNING${ANSI_RESET}: ${UNDERLINE}Path ${DESTDIR}${MANDIR} is not contained in your MANPATH variable or the output of \`manpath\` command.${ANSI_RESET} \`man\` might fail finding the installed manpages. Consider adding it if necessary.\nMANPATH variable / output of \`manpath\`: ${MANPATHS}" ;; \
esac) ; \
else echo "NO_MAN is defined, so no documentation is going to be installed." ; fi)
@ -138,7 +144,7 @@ install-bin: meli
@mkdir -p $(DESTDIR)${BINDIR}
@echo " - ${BOLD}Installing binary to ${ANSI_RESET}${GREEN}${DESTDIR}${BINDIR}/meli${ANSI_RESET}"
@case ":${PATH}:" in \
*:${DESTDIR}${BINDIR}:*) echo -n "";; \
*:${DESTDIR}${BINDIR}:*) echo -n "";; \
*) echo "\n${RED}${BOLD}WARNING${ANSI_RESET}: ${UNDERLINE}Path ${DESTDIR}${BINDIR} is not contained in your PATH variable.${ANSI_RESET} Consider adding it if necessary.\nPATH variable: ${PATH}";; \
esac
@mkdir -p $(DESTDIR)${BINDIR}

@ -24,11 +24,13 @@ Official mirrors:
## Documentation
See also [Quickstart tutorial](https://meli.delivery/documentation.html#quick-start).
See a comprehensive tour of `meli` in the manual page [`meli(7)`](./docs/meli.7).
After installing meli, see `meli(1)`, `meli.conf(5)` and `meli-themes(5)` for documentation. Sample configuration and theme files can be found in the `docs/samples/` subdirectory. Manual pages are also [hosted online](https://meli.delivery/documentation.html "meli documentation").
See also the [Quickstart tutorial](https://meli.delivery/documentation.html#quick-start) online.
meli by default looks for a configuration file in this location: `$XDG_CONFIG_HOME/meli/config.toml`
After installing `meli`, see `meli(1)`, `meli.conf(5)`, `meli(7)` and `meli-themes(5)` for documentation. Sample configuration and theme files can be found in the `docs/samples/` subdirectory. Manual pages are also [hosted online](https://meli.delivery/documentation.html "meli documentation").
`meli` by default looks for a configuration file in this location: `$XDG_CONFIG_HOME/meli/config.toml`
You can run meli with arbitrary configuration files by setting the `$MELI_CONFIG`
environment variable to their locations, i.e.:
@ -46,12 +48,12 @@ For a quick start, build and install locally:
Available subcommands for `make` are listed with `make help`. The Makefile *should* be POSIX portable and not require a specific `make` version.
meli requires rust 1.39 and rust's package manager, Cargo. Information on how
`meli` requires rust 1.65 and rust's package manager, Cargo. Information on how
to get it on your system can be found here: <https://doc.rust-lang.org/cargo/getting-started/installation.html>
With Cargo available, the project can be built with `make` and the resulting binary will then be found under `target/release/meli`. Run `make install` to install the binary and man pages. This requires root, so I suggest you override the default paths and install it in your `$HOME`: `make PREFIX=$HOME/.local install`.
You can build and run meli with one command: `cargo run --release`.
You can build and run `meli` with one command: `cargo run --release`.
### Build features
@ -63,8 +65,8 @@ Some functionality is held behind "feature gates", or compile-time flags. The fo
- `jmap` provides support for connecting to a jmap server and use it as a mail backend (off by default)
- `sqlite3` provides support for builting fast search indexes in local sqlite3 databases (on by default)
- `cli-docs` includes the manpage documentation compiled by either `mandoc` or `man` binary to plain text in `meli`'s command line. Embedded documentation can be viewed with the subcommand `meli man [PAGE]`
- `svgscreenshot` provides support for taking screenshots of the current view of meli and saving it as SVG files. Its only purpose is taking screenshots for the official meli webpage. (off by default)
- `debug-tracing` enables various trace debug logs from various places around the meli code base. The trace log is printed in `stderr`. (off by default)
- `svgscreenshot` provides support for taking screenshots of the current view of `meli` and saving it as SVG files. Its only purpose is taking screenshots for the official `meli` webpage. (off by default)
- `debug-tracing` enables various trace debug logs from various places around the `meli` code base. The trace log is printed in `stderr`. (off by default)
### Build Debian package (*deb*)
@ -75,11 +77,11 @@ A `*.deb` package can be built with `make deb-dist`
### Using notmuch
To use the optional notmuch backend feature, you must have `libnotmuch5` installed in your system. In Debian-like systems, install the `libnotmuch5` packages. meli detects the library's presence on runtime.
To use the optional notmuch backend feature, you must have `libnotmuch5` installed in your system. In Debian-like systems, install the `libnotmuch5` packages. `meli` detects the library's presence on runtime.
### Using GPG
To use the optional gpg feature, you must have `libgpgme` installed in your system. In Debian-like systems, install the `libgpgme11` package. meli detects the library's presence on runtime.
To use the optional gpg feature, you must have `libgpgme` installed in your system. In Debian-like systems, install the `libgpgme11` package. `meli` detects the library's presence on runtime.
### Building with JMAP
@ -91,6 +93,11 @@ MELI_FEATURES="jmap" make
or if building directly with cargo, use the flag `--features="jmap"'.
### HTML Rendering
HTML rendering is achieved using [w3m](https://github.com/tats/w3m) by default.
You can use the `pager.html_filter` setting to override this (for more details you can consult [`meli.conf(5)`](./docs/meli.conf.5)).
# Development
Development builds can be built and/or run with
@ -102,7 +109,7 @@ cargo run
There is a debug/tracing log feature that can be enabled by using the flag
`--feature debug-tracing` after uncommenting the features in `Cargo.toml`. The logs
are printed in stderr, thus you can run meli with a redirection (i.e `2> log`)
are printed in stderr, thus you can run `meli` with a redirection (i.e `2> log`)
Code style follows the default rustfmt profile.

@ -37,70 +37,39 @@ fn main() {
]);
#[cfg(feature = "cli-docs")]
{
use flate2::Compression;
use flate2::GzBuilder;
const MANDOC_OPTS: &[&'static str] = &["-T", "utf8", "-I", "os=Generated by mandoc(1)"];
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use std::process::Command;
use flate2::{Compression, GzBuilder};
const MANDOC_OPTS: &[&str] = &["-T", "utf8", "-I", "os=Generated by mandoc(1)"];
use std::{env, fs::File, io::prelude::*, path::Path, process::Command};
let out_dir = env::var("OUT_DIR").unwrap();
let mut out_dir_path = Path::new(&out_dir).to_path_buf();
out_dir_path.push("meli.txt.gz");
let output = Command::new("mandoc")
.args(MANDOC_OPTS)
.arg("docs/meli.1")
.output()
.or_else(|_| Command::new("man").arg("-l").arg("docs/meli.1").output())
.unwrap();
let file = File::create(&out_dir_path).unwrap();
let mut gz = GzBuilder::new()
.comment(output.stdout.len().to_string().into_bytes())
.write(file, Compression::default());
gz.write_all(&output.stdout).unwrap();
gz.finish().unwrap();
out_dir_path.pop();
let mut cl = |filepath: &str, output: &str| {
out_dir_path.push(output);
let output = Command::new("mandoc")
.args(MANDOC_OPTS)
.arg(filepath)
.output()
.or_else(|_| Command::new("man").arg("-l").arg(filepath).output())
.expect(
"could not execute `mandoc` or `man`. If the binaries are not available in \
the PATH, disable `cli-docs` feature to be able to continue compilation.",
);
out_dir_path.push("meli.conf.txt.gz");
let output = Command::new("mandoc")
.args(MANDOC_OPTS)
.arg("docs/meli.conf.5")
.output()
.or_else(|_| {
Command::new("man")
.arg("-l")
.arg("docs/meli.conf.5")
.output()
})
.unwrap();
let file = File::create(&out_dir_path).unwrap();
let mut gz = GzBuilder::new()
.comment(output.stdout.len().to_string().into_bytes())
.write(file, Compression::default());
gz.write_all(&output.stdout).unwrap();
gz.finish().unwrap();
out_dir_path.pop();
let file = File::create(&out_dir_path).unwrap_or_else(|err| {
panic!("Could not create file {}: {}", out_dir_path.display(), err)
});
let mut gz = GzBuilder::new()
.comment(output.stdout.len().to_string().into_bytes())
.write(file, Compression::default());
gz.write_all(&output.stdout).unwrap();
gz.finish().unwrap();
out_dir_path.pop();
};
out_dir_path.push("meli-themes.txt.gz");
let output = Command::new("mandoc")
.args(MANDOC_OPTS)
.arg("docs/meli-themes.5")
.output()
.or_else(|_| {
Command::new("man")
.arg("-l")
.arg("docs/meli-themes.5")
.output()
})
.unwrap();
let file = File::create(&out_dir_path).unwrap();
let mut gz = GzBuilder::new()
.comment(output.stdout.len().to_string().into_bytes())
.write(file, Compression::default());
gz.write_all(&output.stdout).unwrap();
gz.finish().unwrap();
cl("docs/meli.1", "meli.txt.gz");
cl("docs/meli.conf.5", "meli.conf.txt.gz");
cl("docs/meli-themes.5", "meli-themes.txt.gz");
cl("docs/meli.7", "meli.7.txt.gz");
}
}

@ -19,17 +19,21 @@
* along with meli. If not, see <http://www.gnu.org/licenses/>.
*/
use std::fs::File;
use std::io::prelude::*;
use std::process::{Command, Stdio};
use std::{
fs::File,
io::prelude::*,
process::{Command, Stdio},
};
use quote::{format_ident, quote};
extern crate proc_macro;
// Write ConfigStructOverride to overrides.rs
pub fn override_derive(filenames: &[(&str, &str)]) {
let mut output_file =
File::create("src/conf/overrides.rs").expect("Unable to open output file");
let mut output_string = r##"/*
let mut output_string = r##"// @generated
/*
* meli - conf/overrides.rs
*
* Copyright 2020 Manos Pitsidianakis
@ -50,15 +54,19 @@ pub fn override_derive(filenames: &[(&str, &str)]) {
* along with meli. If not, see <http://www.gnu.org/licenses/>.
*/
//! This module is automatically generated by build.rs.
#![allow(clippy::derivable_impls)]
//! This module is automatically generated by config_macros.rs.
use super::*;
use melib::HeaderName;
"##
.to_string();
'file_loop: for (filename, ident) in filenames {
println!("cargo:rerun-if-changed={}", filename);
let mut file = File::open(&filename)
let mut file = File::open(filename)
.unwrap_or_else(|err| panic!("Unable to open file `{}` {}", filename, err));
let mut src = String::new();
@ -104,7 +112,7 @@ use super::*;
.iter()
.filter_map(|f| {
let mut new_attr = f.clone();
if let quote::__private::TokenTree::Group(g) =
if let proc_macro2::TokenTree::Group(g) =
f.tokens.clone().into_iter().next().unwrap()
{
let attr_inner_value = f.tokens.to_string();

34
debian/changelog vendored

@ -1,3 +1,37 @@
meli (0.7.2-1) bullseye; urgency=low
Added
- Add forward mail option
- Add url_launcher config setting
- Add add_addresses_to_contacts command
- Add show_date_in_my_timezone pager config flag
- docs: add pager filter documentation
- mail/view: respect per-folder/account pager filter override
- pager: add filter command, esc to clear filter
- Show compile time features in with command argument
Fixed
- melib/email/address: quote display_name if it contains ","
- melib/smtp: fix Cc and Bcc ignored when sending mail
- melib/email/address: quote display_name if it contains "."
-- Manos Pitsidianakis <epilys@nessuent.xyz> Fri, 15 Oct 2021 12:34:00 +0200
meli (0.7.1-1) bullseye; urgency=low
Added
- Change all Down/Up shortcuts to j/k
- add 'GB18030' charset
- melib/nntp: implement refresh
- melib/nntp: update total/new counters on new articles
- melib/nntp: implement NNTP posting
- configs: throw error on extra unusued conf flags in some imap/nntp
- configs: throw error on missing `composing` section with explanation
Fixed
- Fix compilation for netbsd-9.2
- conf: fixed some boolean flag values requiring to be string e.g. "true"
-- Manos Pitsidianakis <epilys@nessuent.xyz> Wed, 08 Sep 2021 18:14:00 +0200
meli (0.7.0-1) buster; urgency=low
-- Manos Pitsidianakis <epilys@nessuent.xyz> Fri, 03 Sep 2021 18:14:00 +0200

2
debian/control vendored

@ -2,7 +2,7 @@ Source: meli
Section: mail
Priority: optional
Maintainer: Manos Pitsidianakis <epilys@nessuent.xyz>
Build-Depends: debhelper (>=11~), mandoc (>=1.14.4-1)
Build-Depends: debhelper (>=11~), mandoc (>=1.14.4-1), quilt, libsqlite3-dev
Standards-Version: 4.1.4
Homepage: https://meli.delivery

@ -1,10 +1,12 @@
Description: Fix PREFIX env var in Makefile for use in Debian
Author: Manos Pitsidianakis <epilys@nessuent.xyz>
Last-Update: 2020-01-30
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@
# along with meli. If not, see <http://www.gnu.org/licenses/>.
Last-Update: 2023-03-06
Index: meli/Makefile
===================================================================
--- meli.orig/Makefile
+++ meli/Makefile
@@ -20,7 +20,7 @@
.SUFFIXES:
# Options
-PREFIX ?= /usr/local

@ -0,0 +1,122 @@
# Using other apps with `meli`
## Sending mail with a command line tool
`composing.send_mail` can use either settings for an SMTP server or a shell
command to which it pipes new mail to.
### `msmtp` and `send_mail`
[`msmtp`][msmtp] is a command line SMTP client that can be configured to work
with many SMTP servers. It supports queuing and other small useful features.
See [the documentation](https://marlam.de/msmtp/msmtp.html).
```toml
[composing]
send_mail = 'msmtp --logfile=/home/user/.mail/msmtp.log --read-recipients
--read-envelope-from'
```
[msmtp]: https://marlam.de/msmtp/
## Editor
Any editor you specify in `composing.editor_cmd` will be invoked with the
e-mail draft file path appended as an argument to it. For example, if your
setting is `editor_cmd = 'nano'`, `meli` will execute `nano /tmp/meli/...`.
### Configuration
#### `vim` / `neovim` command
The following command setting in your `meli` configuration file makes editing
start at the first empty line, that is, after the e-mail headers. This allows
you to start writing the e-mail body right away after opening the editor from
`meli`.
```toml
[composing]
editor_cmd = '~/.local/bin/vim +/^$'
```
In `vim`, the `+` argument positions the cursor at the first file argument. `/`
specifies a pattern position instead of a line number. `^` specifies the start
of a line, and `$` the end of the line. The pattern altogether matches an empty
line, which will be after the e-mail headers.
### Composing with `format=flowed`
`format=flowed` is a proposed IETF standard[^formatflowed] that lets you
preserve the structure of paragraphs by disambiguating a *hard* and a *soft*
line break. A line break that is preceded by a space character is *soft* and
does not terminate the paragraph, while a line break without a space is a
*hard* one and creates a new paragraph. This allows text to be re-flowed in
e-mail clients at different display widths and font sizes without messing up
the author's formatting.
#### `vim` / `neovim` and `format=flowed`
Create a `mail.vim` file type plugin in:
- `$HOME/.vim/after/ftplugin/mail.vim` for vim
- `$HOME/.config/nvim/after/ftplugin/mail.vim` for neovim
```vim
setlocal nomodeline
setlocal textwidth=72
setlocal formatoptions=aqtw2r
setlocal nojoinspaces
setlocal nosmartindent
setlocal comments+=nb:>
match ErrorMsg '\s\+$'
```
Also, don't forget that you can easily quote stuff with `MailQuote`.
From `:help ft-mail-plugin`:
> Local mappings:
> `<LocalLeader>q` or `\\MailQuote`
> Quotes the text selected in Visual mode, or from the cursor position
> to the end of the file in Normal mode.
> This means "> " is inserted in each line.
See the accompanying [`mail.vim`](./mail.vim) for comments for each setting.
## `xbiff`
[`xbiff(1)`][xbiff] manual page says:[^xbiffmanpage]