Commit graph

225 commits

Author SHA1 Message Date
Clément DOUIN
8fbbb324da
merge back account with config 2021-09-17 21:55:11 +02:00
Clément DOUIN
94f7dd5b05
remove config from domain module 2021-09-17 18:30:17 +02:00
Clément DOUIN
54493540b4
improve msg arg/handlers + tpl + flag 2021-09-17 18:17:11 +02:00
Clément DOUIN
bc5f9045ce
improve imap and mbox arg/handler 2021-09-16 16:43:41 +02:00
Clément DOUIN
248240f52d
improve entities and services from and try_from 2021-09-16 15:29:20 +02:00
Clément DOUIN
0ed1147f3d
move domain stuff to domain/, improve completion 2021-09-16 01:35:31 +02:00
Clément DOUIN
223537c4ca
remove ctx, turn output into a service 2021-09-15 22:47:00 +02:00
Clément DOUIN
07833c2fc7
make smtp service lazy with instance() 2021-09-14 22:49:52 +02:00
Clément DOUIN
979c6ef1c9
refactor config and account system 2021-09-14 00:34:34 +02:00
Clément DOUIN
5a9481910f
turn smtp into an interfaced service 2021-09-13 15:32:01 +02:00
Clément DOUIN
c619f06206
replace error-chain by anyhow (#152) 2021-09-13 11:52:20 +02:00
Clément DOUIN
fa622ba1db
improve table structure + doc 2021-09-13 10:32:05 +02:00
Clément DOUIN
decb4192aa
restore cpo vim plugin 2021-09-11 00:51:25 +02:00
Clément DOUIN
0f7e95ccc0
put back wiki as git submodule 2021-09-11 00:50:58 +02:00
TornaxO7
0e68801a35
refactor msg model (#173)
* Adding Mail structure

Adding a main structure which can be used for *everything* which has to do with
a mail:
    - Writing a new mail
    - Fetching the information of a mail

* Write mails

User can write mails now

* Writing mail

When mail is converted to a sendable message, it'll print out a nice little
error message what to do and which field is missing a value.

* Mail

List subcommand works with new struct now.

* Forwarding

Started implementation for forwarding message

* Breaking Commit

This is just a "backup" commit

* First finished

Himalaya can compile successfully now.

* Removed uneccessary files

- Moved everything from msg/mail to msg/model
- Removed uneccessary files

* Renaming

Renamed all "Mail" and "Mails" struct to "Msg" and "Msgs".

* Cleaning

Removed an CLI-Subcommand which can't be used anymore

* Flags

Fixed flags to vector and added the template subcommand back

* Changes to Flags

Changed the datatype from Vec<Flag<'static>> to HashSet<Flag<'static>>, because
each Message/Mail can include only one flag-type, so why not a HashSet for this
job?

* Cargo.toml changes

Fixed the lettre-dependencie which points to the pull request with the given
serde implementation for ContentType (needed for Attachments).

* Fix Template bug and removed unnecessary files.

- Removed the msg/flag/flag.rs file since we can use the imap::types::Flag
  implementation now
- `himalaya template new` printed the template two times. This should be fixed
  now

* Template command

Fixed formatting when printing out template

* Sending Mail

Fixed bug that user can't send a mail

* Msg

Moved the body from the attachment-vector out to an external attribute of the
struct.

* Msg listing and changed Msg::from to Msg::try_from

- Fixed bug that listing didn't showed up addresses in the `From:` field for
  example
- Made each `from` trait function to `try_from` for better error-handling

* Tests

- Fixed tests in `tests/imap_conn.rs`

* Cargo.toml changes, Bug fixes, Documentation

- Updated mailparse to 0.13.4
- Added new "new" function to Account
- Cleaned up some functions (removed some)
- Added Eq and PartialEq derives for msg
- Bugfix:
    It couldn't get the body of some mails, because they were inside a
    multipart/alternative part. Now the mail is iterating through all subparts
    and picks up the firs text/plain "attachment" and uses it as the body.

* Changed Msg attributes viewability

- Made the "main attributes" of the Msg struct public
- Removed to getter functions

* Big envelope changes

- Added documentation
- Removed the getter functions, beacuse the attributes are public

* Documentation and Cleanup

- Removed the `new` constructor of the envelope, since it's actually the same as
  Envelope::default()
- Addded tests and Documentation to Attachments.rs

* Documentation and Tests

- Added docuemntation for msg/body.rs
- Fixed some syntax errors in the doc strings

* General msg

- Added `get_raw` function and `raw` field for the `Msg` struct.
- Fixed raw output of msg
- Started documentation + tests for the Msg struct

* Changes to Msg

- Added Clone derive
- Added documentation for change_to_reply method
- Added tests to change_to_reply method

* Msg tests and Account changes

- Changed `Account::new()` function
- Added more documentation to Msg struct
- Added more tests to Msg struct

* Removed an unknown file

Removed src/.rust_info.json (don't know where it came)

* Msgs finished(?)

Added final documentation to the Msg struct.

* ImapConnector Fix

Fixed the bug, when trying to move a msg, the envelope wasn't applied to the
fetch. Fixed that in the `get_msg` method.

* Msg

- Bug fixes:
    - Adding Message ID and Subject in the to_sendable_msg function

- Removed an println statement for debugging
- Added more error messages

* Cargo.toml

Changed order and added some comments to the dependencies.

* Msg

Removed an unnecessary documentation part.

* Fixed documentation

* Removing non-debugflags for dev profile

Removing debug=false for the dev profile since it was just for me.

* Cleanup

Removed the comment blocks and reduced some comments

* Cleanup

Reformatted some stuff

* Cleanup

Replaced the word "mail" with "msg".

* Formatting

Fixed formatting in src/flag/model.rs file

* Little fix

* Changes and tests

- New "feature":
    If you reply to a reply, the subject won't look like this for example:

        Re: Re: Re: Re: Re: Re: The subject

- Fixed tests. All tests pass now (run `cargo test`)

* Idea(?)

Renamed all <module>_matches/_subcmds to general "matches" and "subcmds()".
All modules have the same: "matches()" and "subcmds()"

* Little fix

Changed the name from "imap_conn" to "conn" by mistake. Fixed that

* Bug fix

When sending a message, himalaya will generate a UUID on its own if there's no
message-id for the message yet.

* Bug fix

Removed angle brackets, since they are added through the lettre library.

* Bugfix

Removed an unnecessary (old) line.

* Cleanup

Removed the last comment blocks.

* Fixed lettre dependencie

* Bugfixes and Error handling

- When calling the msg_interaction function, the user can edit the msg first,
  before the prompt comes up
- Also added a error output, if the msg couldn't be converted into a sendable
  message.

* Error handling

Improved output of error

* Bug fixes, Error Handling

- Improved error handling for the string parsing
- Added attempt to fix the bug that a whitespace is added in the end of an
  address

* Trimming

Added trims to avoid invalid white spaces in the addresses.

* Fixing whitespace bug

All addresses are gonna trimmed before adding to a header now

* Adding encoding, Changed dependencie

- Added encoding for the body part
- Changed the lettre dependencie of lettre to TornaxO7's fork of lettre, because
  the "ContentTypeEncoding" struct needs the "Eq", "Serialize" and "Deserialize"
  derives.

* Improved Error handling

Added a warning, if a message included an unknown attachment.

* Fixed tests

Fixed the documentation for passing the tests.

* Doc change

* Bugfis: When replying, signature is added now as well

* Bugfix: Forwarding Message

When forwarding a message, himalaya, put the signature in the end of the
mail/msg. Now it's added above the '-------Forwarded Message---------' line.

* Readjusted tests and new method

- Changed the way to create a new account:
    - Account::new => Sets signautre to "None"
    - Account::new_with_signature => Sets signature to the given argument

    This makes it more flexible to create specifique accounts for tests for
    example.

- Fixed the tests so all are passing now

* improve sig and sig delim concat process

* add signature delim struct comment

* fix signatures + tests

* fix body and signature new lines

* Adding [serde(rename_all = "camelCase")] to structs

* fix reply indentation and signature new lines

* add default rustfmt.toml

* apply fmt on all the project

* fix msg tests

* Makeing Ctx struct independent

- The Ctx struct doesn't include references anymore. This makes it easier to
    create new Ctx instances by doing the following:

        Ctx {
            <attribute>: <value>,
            .. Ctx::default()
        }

    This helps especially for writing tests.

Also the attributes of the Ctx struct in the main-entry function aren't used
anymore after creating the Ctx struct. So there's no need to have only
references in the Ctx struct.

* Fixing JSON output

- JSON of message includes `hasAttachment` key now
- JSON output shows both body types: Text and Html
- Changed `Body` struct so it can store html and text now.

* Tests

Updated tests with the latest Body implementation

* Fixes

- Removed suspicious println macro in serializer of msg... *cough cough*
- Fixed output in the "read" command
- othe small fixes

* Formatting

Formatted all files

* Msg

- Adding 'get_full_message' method which prints out all information of the
  message in a string

* New Msg-Struct

Adding MsgSerialized, a struct, which represents the "correct" serialized
version of a message because it includes another attribute: `has_attachment`.

* Cleanup

Removed the manual serialize implementation of `Msg` and added a little more
info about the MsgSerialized.

* Test fixes

Adjusted all tests so all are passing now.

* Little changes

- Used a better condition for checking if the message includes attachments or
  not
- format fixes

* Fixing tests and Docs

- Provided more docs
- Refactored tests and added more tests

* Expanding specials

Added more "special characters" which will add some quotes around the name if it
includes at least one of them.

* Fixing test

Improved the detection if the mail-name includes a special character or not.

* Variable renaming

Renamed a variable for better readability.

* Envelope renaming

* Small change

Renamed the variable of the `TryFrom` implementation for the
imap_proto::Envelope.

* Last stuff

- Making the attributes of mboxes independent. We can store them now as well!
- Added more docs
- Added type-safety for flags
- Expanded flags a bit
- Added more tests
- Added a short summary of the file-structure in the beginning of the doc.

* Help command fix

Fixing help command description.

* Small doc change

* Doc fix

Fixing the link to the mbox delimiter.

* Fixing typo

* Doc fix

* Added docs for Output struct

* Fixing tests

Fixing a little test issue

* Formatting changes + doc change

- Removed bold + capital words for logout-doc
- Run format on each *.rs file

* Fixing tests

- Testing the return value of the flags struct as a string doesn't really work
  since it's a HashSet => Converted it into a Vec (in the test) to set the order
  as well.
- Fixed imap test by reverting the changes in the test.

* Error handling

Changed error output when creating an Imap-Connection. Should help debugging :)

* Formatting fixes and refactoring

- Using `trim_end_matches` instead of "pop"s now.
- Executed `cargo fmt`

* Trying to fix test workflow

* Fixes

Updated dependencies with `cargo update` and let cargo point to master branch of
TornaxO7's lettre-fork because this should probably fix the issue with the
nix-build.

* Test fix

Fixing the workflow.

* Workflow fix

Removing semicolon

* Starting workflow

Added a new line to be able to push.

* Workflow

Reverting the workflow command.

* Workflows

Reverting workflow to master workflow.

* let actions/checkout@v2 run first

* Forwarded message's signature misplaced

Changes the order of the signature for forwarded messages.

* Output change

Changed the output if an error occurs.

* Fixing output for template-building

* Template shows raw data with JSON format #23

When printing the message in json, the raw message is printed out as a string
now.

* the_sender_is_not_displayed_properly_in_table_and_json #21

- When displaying the table, we'll look first, if a name exists, if yes => use
  it otherwise use the email address.

- Added the rfc2047_decoder for parsing addresses

* Formatting

Run 'cargo fmt'

Co-authored-by: Clément DOUIN <soywod@users.noreply.github.com>
Co-authored-by: Erik <erik1000@protonmail.com>
2021-09-11 00:35:22 +02:00
Matthew Toohey
2ac2f53f31
disable cursorline for read/write in vim plugin (#195)
Co-authored-by: mtoohey31 <mtoohey31@users.noreply.github.com>
2021-08-29 22:39:22 +02:00
Clément DOUIN
608057b23b
fix integration tests 2021-08-18 22:13:07 +02:00
Clément DOUIN
4f05ff6e03
update install_url from nix gh action 2021-08-18 19:48:31 +02:00
Clément DOUIN
f92bd62e89
add wiki warning about echo cmd in config passwd-cmd 2021-08-18 12:06:07 +02:00
Clément DOUIN
52e76d19e5
make pagination starting at 1 instead of 0 (#186) 2021-08-06 13:33:59 +02:00
Clément DOUIN
97054d3133
expand tilde in config file (#102) 2021-08-05 23:18:28 +02:00
Clément DOUIN
a6b30b746c
add config opt signature-delimiter 2021-08-04 22:25:45 +02:00
Clément DOUIN
32d8cf0163
add missing From header when using xdg-email (#162) 2021-08-04 21:58:35 +02:00
Clément DOUIN
2acd5d71d3
add basic support of xdg-email (#162) 2021-08-04 21:42:59 +02:00
Clément DOUIN
a70631de1c
add missing subject prefix for replies 2021-08-04 16:50:16 +02:00
Clément DOUIN
7b046f87ee
fix new/reply/forward issue in vim plugin (#176) 2021-08-03 22:46:36 +02:00
toastal
63090a2f01
remove extra version (#183)
* Nix dependencies updated

* fix vim plugin build
2021-08-03 15:15:38 +02:00
toastal
f77f33b2d8
fix vim plugin + update flake references (#182)
* Nix dependencies updated

* fix vim plugin build
2021-08-03 15:11:52 +02:00
Fancy Cade
fadebf0997
generate Message-Id header with uuid and from address domain (#171) 2021-07-08 14:49:24 +02:00
rui
8e40cc3ddb
add homebrew release badge (#165)
* doc: add homebrew install

Signed-off-by: Rui Chen <rui@chenrui.dev>

* doc: add homebrew release badge

Signed-off-by: Rui Chen <rui@chenrui.dev>

* remove brew installation from README
2021-07-01 10:27:22 +02:00
toastal
0d7b490f98
include vim plugin inside nix package (#157) 2021-06-03 16:51:48 +02:00
Clément DOUIN
7c88896fcc
release v0.4.0 2021-06-03 16:15:46 +02:00
Clément DOUIN
e3d022720d
add ability to change account vim plugin (#91) 2021-06-03 16:08:03 +02:00
toastal
edb2e181e7
add .desktop file (#161) 2021-06-03 15:33:25 +02:00
Clément DOUIN
27638be387
update changelog with template refactor 2021-06-02 23:47:10 +02:00
Clément DOUIN
a8353b70e7
use default instead of new for Config, Account and Output 2021-06-02 23:41:06 +02:00
Clément DOUIN
6bca1a289b
rename App to Ctx 2021-06-02 22:59:34 +02:00
Clément DOUIN
fa223417a0
add new() method for Account and Config 2021-06-02 22:50:22 +02:00
Clément DOUIN
4df39b6d01
refactor tpl cli override 2021-05-31 20:52:10 +02:00
Clément DOUIN
28448310c7
refactor stdin for send and tpl cmds 2021-05-31 14:19:55 +02:00
Clément DOUIN
f71720e6b9
refactor tpl system (#80) 2021-05-31 00:02:16 +02:00
Matthias Beyer
62ac9aef2c
refactor msg matches (#151)
* Refactor msg_matches() impl into several functions

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

* Simplify impl of msg_matches()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

* Refactor to use msg_matches_list() impl for default case as well

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

* Remove unidomatic return keyword

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-23 12:04:37 +02:00
Paolo Barbolini
c9e1609ea9
update lettre to v0.10.0-rc.1 (#150)
$ cargo update -p lettre --aggressive
    Updating crates.io index
    Updating aho-corasick v0.7.15 -> v0.7.18
    Removing bytes v1.0.1
    Updating cc v1.0.66 -> v1.0.67
      Adding fastrand v1.4.1
    Removing getrandom v0.1.15
    Removing http v0.2.3
    Removing httparse v1.3.5
    Updating httpdate v0.3.2 -> v1.0.0
    Removing hyperx v1.3.0
    Updating idna v0.2.0 -> v0.2.3
    Removing language-tags v0.2.2
    Updating lettre v0.10.0-beta.3 -> v0.10.0-rc.1
    Updating libc v0.2.88 -> v0.2.94
    Updating lock_api v0.4.3 -> v0.4.4
    Updating memchr v2.3.4 -> v2.4.0
    Updating native-tls v0.2.6 -> v0.2.7
    Updating once_cell v1.5.2 -> v1.7.2
    Updating openssl v0.10.32 -> v0.10.34
    Updating openssl-probe v0.1.2 -> v0.1.4
    Updating openssl-sys v0.9.60 -> v0.9.63
    Updating parking_lot_core v0.8.2 -> v0.8.3
    Removing percent-encoding v2.1.0
    Updating quoted_printable v0.4.2 -> v0.4.3
    Removing rand v0.7.3
    Removing rand_chacha v0.2.2
    Removing rand_core v0.5.1
    Removing rand_hc v0.2.0
      Adding redox_syscall v0.2.8
    Updating regex v1.4.2 -> v1.5.4
    Updating regex-syntax v0.6.21 -> v0.6.25
    Updating security-framework v2.0.0 -> v2.2.0
    Updating security-framework-sys v2.0.0 -> v2.2.0
    Updating smallvec v1.6.0 -> v1.6.1
    Updating tempfile v3.1.0 -> v3.2.0
    Removing thread_local v1.0.1
    Updating tinyvec v1.1.0 -> v1.2.0
    Removing unicase v2.6.0
    Updating unicode-bidi v0.3.4 -> v0.3.5
    Updating unicode-normalization v0.1.16 -> v0.1.17
    Updating vcpkg v0.2.11 -> v0.2.12
    Updating version_check v0.9.2 -> v0.9.3
    Removing wasi v0.9.0+wasi-snapshot-preview1
2021-05-14 18:49:31 +02:00
Clément DOUIN
36d3cd6347
bump imap-rust v3.0.0-alpha.3 2021-05-09 21:40:37 +02:00
Clément DOUIN
d41df7d1a4
fix vim help doc (#117) 2021-05-09 17:15:29 +02:00
Clément DOUIN
027b8726c6
fix missing attachment arg for reply and forward cmds (#109) 2021-05-09 13:14:37 +02:00
Clément DOUIN
15376eedc3
remove content-type from templates (#146) 2021-05-09 13:04:03 +02:00
Clément DOUIN
44fbaaa1d6
fix seen flag when moving a msg 2021-05-08 23:14:28 +02:00
Clément DOUIN
5d352ae094
fix install.sh bin name 2021-05-08 22:52:43 +02:00
Clément DOUIN
f6b2fa76b7
release v0.3.2 2021-05-08 22:34:00 +02:00