Commit Graph

206 Commits (8c7b001aa5d4cb6bbaf438f3f47cd91cc2fd6833)

Author SHA1 Message Date
Manos Pitsidianakis c2550f60b6
Rename EXECUTE mode to COMMAND
vim uses COMMAND, and we want to be consistent with vim when possible.
4 years ago
Manos Pitsidianakis 989cfcc877
conf/accounts.rs: use mailbox alias if available in MailboxEntry::name() 4 years ago
Manos Pitsidianakis 7744ef1462
conf/accounts.rs: make JobRequest::Generic name Cow<'_, str> 4 years ago
Manos Pitsidianakis d6ef3567f4
conf/accounts.rs: add hash() method 4 years ago
Manos Pitsidianakis 688060ceb6
conf/accounts.rs: always load Inbox 4 years ago
Manos Pitsidianakis 00acba7717
melib/MailBackend: add copy_messages,set_flags,delete_messages methods 4 years ago
Manos Pitsidianakis a049a83fe3
conf/accounts: add insert_job() method 4 years ago
Manos Pitsidianakis f9efaea0ec
ConversationsListing: fix invalid update_line colors 4 years ago
Manos Pitsidianakis 99fbac3806
Remove unused variables/functions 4 years ago
Manos Pitsidianakis 1bd89b3c96
themes: add mail.sidebar_account_name key 4 years ago
Manos Pitsidianakis 0882dbbad0
melib/Collection: put all fields behind a mutex 4 years ago
Manos Pitsidianakis fadb3634e0
melib: take MailboxHash instead of &Mailbox in fetch*() 4 years ago
Manos Pitsidianakis 9103d05617
melib: s/get/fetch in MailBackend methods 4 years ago
Manos Pitsidianakis 996abd323f
Add print setting action
Add experimental print setting action. The command is of the form:

  print account_name listing.index_style

account_name is currently ignored.

The path, e.g. listing.index_style is split by "." and fed to
DotAddressable lookup trait method. The method checks the first segment
in the path if it matches any of the struct's fields, and then calls the
field's lookup method.
4 years ago
Manos Pitsidianakis 0d3fe288c5
sqlite3: make reindex operation async 4 years ago
Manos Pitsidianakis 5ef62a39b8
conf: Rename cache_type to search_backend 4 years ago
Manos Pitsidianakis 017a45d5cd
conf/accounts: add JobRequest::Generic 4 years ago
Manos Pitsidianakis 1f9cdb8be5
conf/accounts: update mailbox status on payload delivery 4 years ago
Manos Pitsidianakis 77dc1d74bf
Add smtp client support for sending mail in UI
`mailer_command` was removed, and a new setting `send_mail` was added.

Its possible values are a string, consisting of a shell command to
execute, or settings to configure an smtp server connection. The
configuration I used for testing this is:

  [composing]
  send_mail = { hostname = "smtp.mail.tld", port = 587, auth = { type = "auto", username = "yoshi", password = { type = "command_eval", value = "gpg2 --no-tty -q -d ~/.passwords/msmtp/yoshi.gpg" } }, security = { type = "STARTTLS" } }

For local smtp server:
  [composing]
  send_mail = { hostname = "localhost", port = 25, auth = { type = "none" }, security = { type = "none" } }
4 years ago
Manos Pitsidianakis ddafde7b37
jobs: save handle for each Job
If we save the JoinHandle for each task, we can cancel it in future
commits if we have to timeout network requests.
4 years ago
Manos Pitsidianakis 9db6b07b71
Remove some needless clones and stuff (thanks to Clippy) 4 years ago
Manos Pitsidianakis 899d497c9c
Rename _cmd options to _command for consistency 4 years ago
Manos Pitsidianakis 3a16dc6522
Show account online error status when offline 4 years ago
Manos Pitsidianakis 89dedbedb7
imap: launch async watch when connection comes online
Closes #38 Make async watch/refresh work in imap
4 years ago
Manos Pitsidianakis b5748c247a
MailBackend: remove connect() method 4 years ago
Manos Pitsidianakis f48343ca89
conf/accounts: add is_{async,remote} fields 4 years ago
Manos Pitsidianakis 94e0aa4fe7
MailBackend: change get() ret type to Result<_> 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis bbedeed3e3
More imap async fixes 4 years ago
Manos Pitsidianakis b3876113aa
BackendOp: return future in as_bytes() 4 years ago
Manos Pitsidianakis 4721073bc3
Rename jobs1 to jobs 4 years ago
Manos Pitsidianakis e06308fed2
MailBackend: change more methods to Futures 4 years ago
Manos Pitsidianakis 03522c0298
melib: Fixup warnings in imap_async, maildir 4 years ago
Manos Pitsidianakis 21051fa862
JobRequest: add more variants 4 years ago
Manos Pitsidianakis ee10cdbcd5
Make get_async() return a Stream 4 years ago
Manos Pitsidianakis a38764f490
Add somewhat-working async IMAP backend 4 years ago
Manos Pitsidianakis 4f3a98f90a
Add job executor 4 years ago
Manos Pitsidianakis 4ae7a57d45
Add save-draft command 4 years ago
Manos Pitsidianakis bfbaf3d617
Utilize EnvelopeRemove events
EnvelopeRemove events were not ever used in the UI
4 years ago
Manos Pitsidianakis efb06be09b
melib: return Result<_> from operation()
Envelope might have been deleted before main thread requests an
operation, which is a race condition.
4 years ago
Manos Pitsidianakis eca1921a8a
collection: add update_flags() method
On NewFlags events, the threads in Collection were not being updated, so
if an envelope's seen status was toggled the thread's unseen count was
  not updated, and thus not reflected in the UI even though the
  envelope's new flags event was registered properly.
4 years ago
Manos Pitsidianakis a6a30f3adb
conf/accounts.rs return Result on init() 4 years ago
Manos Pitsidianakis 0169025d50
build.rs: add proc-macro to generate Override structs for configuration 4 years ago
Manos Pitsidianakis 1241b6073f
Clear tags before applying new ones in NewFlags 4 years ago
Manos Pitsidianakis ca9d4fde58
Discard EnvelopeRename event if envelope is missing from Collection 4 years ago
Manos Pitsidianakis f3d5edfe14
Add copy/move to other account operations 4 years ago
Manos Pitsidianakis c07185a3aa
regexp: add priority field to regular expressions 4 years ago
Manos Pitsidianakis 3e31c46a74
Add "regexp" feature, format text with regexps
`regexp` feature uses the pcre2 library to enable the user to define
regular expressions for matching text and applying text formatting to
the matches. An example from the theme configuration I used to test
this:

  [terminal.themes.win95.text_format_regexps]
  "listing.subject" = { "\\[[^\\]]*\\]" = { attrs = "Bold" } }
  "listing.from" = { "\\<[^\\>]*\\>(?:(?:\\s*$)|(?=,))" = { attrs = "Italics" } }

  [terminal.themes.win95.text_format_regexps."pager.envelope.body"]
  "^>.*$" = { attrs = "Italics" }
  "\\d+\\s?(?:(?:[KkMmTtGg]?[Bb])|(?:[KkMmTtGg][Bb]?)(?=\\s))" = { attrs = "Bold | Underline" }
4 years ago
Manos Pitsidianakis de03b106f3
themes: Add support for Color/Attribute aliases
Add aliases to avoid repetition of raw values when defining new themes.
Aliases are strings starting with "$" and must be defined in the
`color_aliases` and `attr_aliases` fields of a theme.
4 years ago
Manos Pitsidianakis eca8a30c3f
themes: Add Theme struct
Wrap HashMap<Cow<'static, str>, ThemeAttributeInner> into a struct, in
order to add more fields in the future.
4 years ago
Manos Pitsidianakis fa96a4e905
themes: add support for optional field theme value links
Theme attribute values can refer to another theme key instead of
defining a value. Add support for optionally defining the theme key's
field by appending a ".fg" or ".bg" suffix to the link's key.
4 years ago
Manos Pitsidianakis 9c0ee76ff4
themes: Rename Theme struct to Themes 4 years ago
Manos Pitsidianakis bee1baedb2
themes: add indentation level color keys
Add theme keys for the indentation level colors in ThreadView
4 years ago
Manos Pitsidianakis bd404e6937
Execute user shell commands with /bin/sh
Execute user provided command invocations $CMD such as `editor_cmd` with
`/bin/sh` as `/bin/sh -c "$CMD"

Previously, user commands were split by whitespace which must trigger
erroneous behavior if quotes are involved.
4 years ago
Manos Pitsidianakis 608ef9a946
conf: warn on invalid mailbox name conf 4 years ago
Manos Pitsidianakis eb701695f7
Remove fnv crate 4 years ago
Manos Pitsidianakis 3ea1ce5454
errors: add `source` field to MeliError 4 years ago
Manos Pitsidianakis d580b25415
themes: overwrite only explicit key attributes
If user config file overwrites a single attribute and not the others,
for example only bg:

  "mail.listing.tag_default" = { bg = "Blue" }

The other attributes, in this case fg and attrs revert to the default
values of ThemeAttributeInner and not the default value for the key
"mail.listing.tag_default". As a result the above expands to:

  "mail.listing.tag_default" = { fg = Color::Default, bg = "Blue", attrs
  = Attr::Default }

This commit keeps the key value defaults, so the above should expand to:

  "mail.listing.tag_default" = { fg = default_theme["mail.listing.tag_default"].fg, bg = "Blue", attrs
  = default_theme["mail.listing.tag_default"].attrs }
4 years ago
Manos Pitsidianakis 18dcf15e1e
Add open_mailbox shortcut for sidebar 4 years ago
Manos Pitsidianakis d8135674df
themes: add {even,odd}_unseen, {even,odd}_selected, {even,odd}_highlighted
Suggested in #21
4 years ago
Manos Pitsidianakis e633434b93
themes: Fix invalid attribute links panic in is_cyclic
Attribute links are not checked for validity in theme validation, and an
invalid link would cause a panic in is_cyclic.

This commit improves the theme validation errors by printing if the
error lies in a theme key or a link.
4 years ago
Manos Pitsidianakis 4930d1b46c
Add Italics, Blink, Dim and Hidden text attributes
Text attributes have been rewritten as bit flags, so for example instead of
"BoldUnderline" you'd have to define "Bold | Underline" in your theme
settings.

Requested in #21
4 years ago
Manos Pitsidianakis e9a935dbf7
melib: add search method in mail backends 4 years ago
Manos Pitsidianakis 3d7b9ff7cb
Move Query to melib 4 years ago
Manos Pitsidianakis 840005022c
themes: add default tag theme attribute
The theme attribute key is "mail.listing.tag_default"
4 years ago
Manos Pitsidianakis 4c32bf450d
Add {un,}subscribe mailbox operations
Concerns #17
4 years ago
Manos Pitsidianakis 9ff54f236b
Add conf_override! macro
conf_override! wraps struct definitions and defines a secondary Override
struct that wraps each field in an Option. The macro mailbox_settings!
is used to select settings from an account & mailbox index. If a user defines an overriding setting, the macro returns the override instead of the immediately next in the hierarchy setting.

The selection is done for a specific field as follows:

  if per-folder override is defined, return per-folder override
    else if per-account override is defined, return per-account override
      else return global setting field value.
4 years ago
Manos Pitsidianakis a8c1016f37
Add various logic checks 4 years ago
Manos Pitsidianakis b7175c2400
Fix compiler error in --no-default-features build 4 years ago
Manos Pitsidianakis 651dda67cf
Respect autoload mailbox setting 4 years ago
Manos Pitsidianakis a3600c0cd2
Add `filter` option in mail list
Filter mail in mail list.

Example:
[listing]
filter = "not flags:seen" # show only unseen messages
4 years ago
Manos Pitsidianakis 9d20fd5576
Save forked processes for reaping 4 years ago
Manos Pitsidianakis 6c76db2063
Add delete, copy actions for envelopes 4 years ago
Manos Pitsidianakis 2a9059f9b4
Add add-attachment from pipe, default_header_values 4 years ago
Manos Pitsidianakis f10cc954e7
Don't dump mail on Account drop 4 years ago
Manos Pitsidianakis a94bb1e27a
Show float notification on refresh cmd 4 years ago
Manos Pitsidianakis ca51077f53
imap: Add support for untagged FETCH (FLAG.. messages
IDLE connection can get untagged "* FETCH (FLAGS ({flag_list))" messages
if any client has changed flags. Support this refresh event.
4 years ago
Manos Pitsidianakis 4ac52d9d5b
Replace every use of Folder with Mailbox
Use Mailbox for consistency.
4 years ago
Manos Pitsidianakis 1245eae0be
Add Knuth–Morris–Pratt to pager 4 years ago
Manos Pitsidianakis 68007a0842
View decoded email source by default
Toggle between decoded/raw source with view_raw_source shortcut, default
M-r
4 years ago
Manos Pitsidianakis f38d03e43a
melib: {create,delete}_folder returns updated folders
Potential parent folders will have their children fields updated, so
just return all folders.
4 years ago
Manos Pitsidianakis d779a94279
Fix sent_folder not getting recorded if no explicit folder conf is set 4 years ago
Manos Pitsidianakis b6efb14824
melib: remove Mailbox
Refactor Collection from melib to hold what folders have what envelopes.

Frontend accounts will now have a FolderEntry for each logical folder
and will unify many Account fields into one and eliminate a lot of
duplicate/dead code.
4 years ago
Manos Pitsidianakis b50e770b5a
ui/accounts: remove Index<usize> impls 4 years ago
Manos Pitsidianakis 14b0ef8f37
Respect use_color conf value as well as NO_COLOR 4 years ago
Manos Pitsidianakis c22a141b14
ui/themes: expand theme coverage to status panel and contacts 4 years ago
Manos Pitsidianakis 647cb10b33
ui: Use FolderHash instead of usize for folder cursor
Use FolderHash directly as a cursor type for folders within an account
isntead of having a usize (being the order of the folder within the
account) and figuring out the folder_hash everytime it's needed.

Add OfflineListing for offline accounts and AccountStatusChange event.
4 years ago
Manos Pitsidianakis 42747ef590
ui/themes: make theme_default the default for other keys 4 years ago
Manos Pitsidianakis 0b4109dfdb
ui: fix wrong subscription status in folders
Subscription status was checked/modified in various places, whereas now
the universal truth is the `BackendFolder::is_subscribed()` method set
by the backend when a folder is created. The `Account` struct passes a
closure to the backend constructor that determines whether the folder is subscribed or not according to the user configuration.

- If subscribed_folders field is empty, then all folders are subscribed.
- OR check explicit folder configuration
- OR check if folder path matches to a glob in subscribed_folders.
4 years ago
Manos Pitsidianakis f208948651
melib: add mailbox delete/create to IMAP 4 years ago
Manos Pitsidianakis d6f04c9ed3
Fix IntoIterator warning 4 years ago
Manos Pitsidianakis 05b91f1c02
Remove text_processing
Unwrap text_processing into melib

In preparation for uploading meli as a separate crate on crates.io.
4 years ago
Manos Pitsidianakis 8b6ea8de9a
Remove ui crate
Merge ui crate with root crate.

In preparation for uploading `meli` as a separate crate on crates.io.

Workspace crates will need to be published as well and having a separate
`ui` crate and binary perhaps doesn't make sense anymore.
4 years ago
Manos Pitsidianakis 8c98d3a5a0
Move ui and melib to different crates
closes #9
5 years ago
Manos Pitsidianakis e95cc4c1e9
Add threaded view, notifications, pager filter 5 years ago
Manos Pitsidianakis df5c617b2d
Move mailbox management to MailListing to avoid copying 5 years ago
Manos Pitsidianakis 11aac5ec34
Fix pager content drawing 5 years ago
Manos Pitsidianakis d089eb49dc
Add scrolling, only redraw dirty areas 5 years ago
Manos Pitsidianakis 8c7a0ae540
Index scrolling, dummy backends, and some pager settings 5 years ago
Manos Pitsidianakis b11eb1e494
Add sidebar menu 5 years ago
Manos Pitsidianakis c141496038
Add some doc 5 years ago
Manos Pitsidianakis c5dbf4e9ae
Move all backends to Backends structure 5 years ago
Manos Pitsidianakis fb745be27f
rustfmt
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
5 years ago
Manos Pitsidianakis 4119a4285d
add accounts and BackendOps
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
5 years ago
Manos Pitsidianakis 04ff21a55f
various fixes
- Clippy fixes
- Rewrite header value parser
- Rewrite string allocations in header encodings
- Thread mail parsing for maildir.rs
- Split crate to lib and bin
5 years ago
Manos Pitsidianakis 9946fbcbe0
threads 5 years ago