Commit graph

392 commits

Author SHA1 Message Date
Clément DOUIN fb324878fa
improve global options, add account config sync-folders-strategy 2023-02-22 13:20:58 +01:00
Clément DOUIN 22fb1b8dee
add completions and man pages to release archives #43 2023-02-21 16:07:16 +01:00
Clément DOUIN 21d8d57f72
add create and delete folder commands #54 2023-02-20 18:26:10 +01:00
Clément DOUIN 5734b30fd1
fix config unit tests 2023-02-20 17:47:40 +01:00
Clément DOUIN 3631ca714b
fix flags case sensitivity 2023-02-20 17:41:26 +01:00
Clément DOUIN bfb572acbd
fix config deserialization issues 2023-02-19 08:51:19 +01:00
Clément DOUIN 509b09d533
prepare v0.7.1
Those commits have been stashed then applied due to merge issue:

add ability to sync specific folders f7585eb
add expunge command 1c0b7fb
update readme links to documentation e1c8cf5
fix other doc typos 9c27165
reword title of the project 1eaac7d
reword title of the project bis a7419d6
fix broken links in changelog 26b0311
prepare v0.7.1 2b5e58e
2023-02-14 16:47:02 +01:00
Clément DOUIN 694173b534
release v0.7.0 (#433)
* update codebase with email lib changes (#431)

update himalaya-lib, rename remaining mbox vars

add missing methods from lib

update changelog

* fixed missing folder aliases #430

* improve README links

* fix README repology link

* fix README repology table

* fix README repology table 2

* center README repology table

* fix README cosmetic issues

* fix README cosmetic issues 2

* fix README title

* fix README wiki links

* fix lock file

* prepare v0.6.2

* fix ci

* try some musl builds #356

* add musl build to artifact #356

* add musl build to deployment pipeline #356

* migrate clap v4, add man command #419

* add option to choose color manually #407

* update links and badges

* update matrix badge

* add github release version badge

* update badges links

* fix code bloc type

* fix tests

* fix cargo lock

* generate all man pages for all subcommands #419

* fix query and headers arg parsers

* fix invalid flags and options due to clap v4 migration

* fix tests

* remove -l|--log-level option

* refactor contributing guide

* update lib

* fix flags string printer

* make commands read, attachments, copy, move and delete accept multiple ids

* fix ids arg parser

* fix flags subcommands conflicts between ids and flags

* flip back copy and move arguments

* add issue template (#439)

* update lib, prepare for sync feature

* update himalaya lib, fix senders and config

* update lock file himalaya lib

* fix sync enabling issues

* fix wrong imap backend init in main file

* fix notmuch backend post sync feature

* configuration wizard (#432)

* make DeserializedConfig::path more robust

With this change, himalaya uses the crate `dirs` in order to follow XDG
specifications on Unix, Known Folder on Windows and Standard Directories
on MacOS. This gives us much smoother cross-platform support. It still
has the same fallbacks (`$HOME/.config/himalaya/config.toml` and
`$HOME/.himalayarc`.)

Additionally, this commit removes a bit of in-house code-bloat.

* add wizard entrypoint and basic structure

* wip

* feat: impl Serialize for all DeserializedConfigs

* feat: select default account and write to file

* feat: add SMTP part of wizard

* build: update lockfile

* refactor: separate out multiple files for wizard

* style: friendlier and prettier messages

* feat: add maildir part of wizard

* feat: add notmuch part of wizard

* chore: clippy lints and reorder prompts

* fix: contrived solution to serializing None values

* fix: allow empty Option field when deserializing

* style: address PR review comments

* fix: utilize notmuch lib in finding database path

* fix notmuch wizard

---------

Co-authored-by: Clément DOUIN <clement.douin@posteo.net>

* add account sync progress bar

* improve sync spinner

* make the sync dry run flag show patches without applying them

* update himalaya lib, increase imap session pool size

* add disable cache flag

* add nlnet logo in readme

* update himalaya lib deps, make use of sync reports

* prepare v0.7.0

* bump rustc v1.67.0 and clap v4.1.4

* bump himalaya lib v0.5.1, fix flake lock file

---------

Co-authored-by: janabhumi <dmitriy@ideascup.me>
Co-authored-by: Knut Magnus Aasrud <km@aasrud.com>
2023-02-08 16:03:45 +01:00
Clément DOUIN 6a15b742b0
add sanitize flag for the read command, fix #352 2022-10-12 15:36:36 +02:00
Clément DOUIN bb8f63e4b0
update code for sendmail sender lib feature 2022-10-12 13:59:20 +02:00
Clément DOUIN 98929d687b
update himalaya-lib for smtp and imap ssl option 2022-10-12 00:23:53 +02:00
Clément DOUIN 82133b30d9
update lib v0.3.1, use MIT license 2022-10-10 18:14:56 +02:00
Clément DOUIN 4fe5d246f1
fix notmuch backend feature 2022-09-29 00:44:31 +02:00
Clément DOUIN dda90809cb
fix folder source not taken into consideration 2022-09-28 11:36:14 +02:00
Clément DOUIN abb9f4172b
fix args typos 2022-09-27 21:42:13 +02:00
Clément DOUIN 329af51534
improve args management 2022-09-27 17:37:08 +02:00
Clément DOUIN a3686c1c44
clean config refactor 2022-09-22 16:38:38 +02:00
Clément DOUIN b2cffd22f1
use cargo workspace feature (#340)
For now, everything has been moved as it is in the "cli"
workspace. The next step is to separate the "lib" from the "cli".
2022-03-16 09:57:24 +01:00
Clément DOUIN ac8628c08c
fix flag commands (#334) 2022-03-15 13:55:40 +01:00
Clément DOUIN e5413fb902
improve msg date readable format 2022-03-12 17:45:56 +01:00
Clément DOUIN 1d969a0d3a
simplify msg header decoding 2022-03-12 17:01:05 +01:00
Clément DOUIN f9bed5f3c2
introduce read_headers in account config (#338) 2022-03-12 15:27:53 +01:00
Clément DOUIN d3968461e2
add tests for --header arg of read command (#338) 2022-03-12 13:57:27 +01:00
Clément DOUIN 86b41e4914
introduce --header arg for read command (#338) 2022-03-12 13:05:57 +01:00
Clément DOUIN eb6f51456b
improve draft file ext 2022-03-12 00:49:51 +01:00
Clément DOUIN 6b042f5e6a
fix listings json api (#331) and maildir e2e tests (#335) 2022-03-12 00:33:50 +01:00
Clément DOUIN 811ea45610
improve mailbox alias management 2022-03-09 12:30:10 +01:00
Clément DOUIN 1f01202262
check for absolute and relative maildir paths 2022-03-09 09:48:23 +01:00
Clément DOUIN d79c6c40a7
make mdir inbox condition case insensitive 2022-03-08 14:29:53 +01:00
Clément DOUIN 984eb8c9f7
fix notmuch backend infinite loop (#329) 2022-03-08 14:22:02 +01:00
Clément DOUIN 3899ec9c03
build smtp envelope after executing pre_send hook 2022-03-06 13:15:58 +01:00
Daniel M. Capella 4dc1be25cd
fix typo sig delim in comment (#328) 2022-03-06 09:34:25 +01:00
Clément DOUIN f79e0ae4fb
add pre-send hook (#178) 2022-03-05 00:42:11 +01:00
Clément DOUIN 212f5e6eb1
improve attachments command (#281)
Also fixed a printer typo.
2022-03-04 23:05:01 +01:00
Clément DOUIN 130ed24a5a
fix missing or invalid cc when replying to a message (#324)
I also added tests for the `Msg::into_reply` method and made the
`Msg::merge_with` stricter.
2022-03-04 21:50:09 +01:00
Oskar 19f4483a3e
fix replies (#323) 2022-03-04 18:15:26 +01:00
Clément DOUIN 4bbc348dc6
fix nix run command 2022-03-04 16:04:22 +01:00
Clément DOUIN f06beb61ae
make one cargo feature per backend (#318) 2022-03-04 14:19:54 +01:00
Clément DOUIN 23a8118da9
fix account typo in comment 2022-03-03 17:33:26 +01:00
Clément DOUIN 736641bf77
add list accounts command (#244) 2022-03-03 17:29:39 +01:00
Clément DOUIN e5164a2ce3
fix bad sender and date in reply and forward tpl (#321) 2022-03-03 15:16:34 +01:00
Clément DOUIN 613e592f72
implement flowed format POC (#206) 2022-03-03 12:16:59 +01:00
Clément DOUIN 6b920cbe76
remove variation selectors from table cells (#300) 2022-03-02 11:13:38 +01:00
Clément DOUIN 21e5658e43
fix errors and warns notmuch cargo feature 2022-03-01 22:50:24 +01:00
Clément DOUIN 5f13489e83
improve maildir and notmuch tests 2022-03-01 22:44:40 +01:00
Clément DOUIN 886b66a017
init notmuch backend e2e tests 2022-03-01 18:17:44 +01:00
Clément DOUIN e544536e01
implement notmuch backend flags methods 2022-03-01 14:15:15 +01:00
Clément DOUIN 4093d13765
add maildir backend flag tests 2022-03-01 13:34:24 +01:00
Clément DOUIN f631f63799
improve notmuch backend logs and error msg 2022-03-01 12:28:20 +01:00
Clément DOUIN 328da34f8d
fix comment typos in maildir backend 2022-02-28 23:20:09 +01:00
Clément DOUIN 526f344c7c
improve maildir backend logs and comments 2022-02-28 21:20:36 +01:00
Clément DOUIN 6606bd9f16
add id mapper to notmuch backend 2022-02-28 12:59:46 +01:00
Clément DOUIN ad1f97faed
move id mapper to its dedicated module 2022-02-27 23:51:23 +01:00
Clément DOUIN 5b002b1f30
improve maildir id <-> hash mapping 2022-02-27 22:36:09 +01:00
Clément DOUIN c87512dbd4
make maildir envelopes selectable by short md5 hash 2022-02-27 10:23:58 +01:00
Clément DOUIN a2616fc1bd
make notmuch optional via cargo features (#303) 2022-02-26 09:56:26 +01:00
Clément DOUIN 00e2524640
implement notmuch get_mboxes 2022-02-26 00:13:14 +01:00
Clément DOUIN da0e7889a3
implement notmuch del_msg 2022-02-25 23:59:05 +01:00
Clément DOUIN 7093cfc715
implement notmuch get_msg 2022-02-25 23:53:38 +01:00
Clément DOUIN 8766d8862a
impl notmuch get_envelopes 2022-02-25 23:31:03 +01:00
Clément DOUIN b855c44508
replace xxx-folder config props by mailboxes 2022-02-25 23:30:58 +01:00
Clément DOUIN 34ab0f4fa5
fix sort command not found (#308) 2022-02-25 21:21:48 +01:00
Clément DOUIN e4aa569458
init notmuch backend 2022-02-25 20:26:50 +01:00
TornaxO7 d5a494a01d
fix maildir expansion (#307)
* Applied shellexpand to maildir_dir

* change to account_config: applied shellexpand to maildir_dir

* rustfmt: removing required version, formatted project

* changing type of `maildir_dir` to `String` and adding shellexpand to
`maildir_dir`
2022-02-23 23:24:17 +01:00
Clément DOUIN b146d9b7e1
rollback rust edition (#303) 2022-02-23 11:36:38 +01:00
Clément DOUIN 158bc86cfa
release v0.5.6 (#301)
* make use of mailparse::MailAddr

* move addr logic to a dedicated file

* update changelog

* add suffix to downoalded attachments with same name (#204)

* implement sort command (#34)

* introduce backends structure (#296)

* implement backend structure poc

* improve config namings

* improve account namings and structure

* rename imap vars to backend

* maildir backend (#299)

* refactor config system, preparing maildir backend

* rename deserializable by deserialized

* wrap backend in a Box

* reword backend trait methods

* merge list envelopes functions

* remove find_raw_msg from backend trait

* remove expunge fn from backend trait

* rename add_msg from backend trait

* init maildir integration tests, start impl maildir backend fns

* implement remaining methods maildir backend, refactor trait

* improve backend trait, add copy and move fns

* remove usage of Mbox in handlers

* reorganize backends folder structure

* move mbox out of domain folder

* rename mbox entities

* improve mbox structure

* remove unused files, move smtp module

* improve envelope, impl get_envelopes for maildir

* link maildir mail entry id to envelope id

* use erased-serde to make backend get_mboxes return a trait object

* remove unused mbox files

* rename Output trait

* make get_envelopes return a trait object

* remove unused impl for imap envelope

* update backend return signature with Box

* replace impl from imap::Fetch to mailparse::ParsedMail

* split flags by backends

* remove unused flags from msg

* remove remaining flags from domain

* impl maildir copy and move, improve maildir e2e tests

* set up imap backend e2e tests

* move domain/msg to msg

* repair broken tests

* fix maildir envelopes encoding issues

* add date column to maildir envelopes

* implement maildir list pagination

* improve maildir subdir path management

* add pgp and maildir features to readme

* update changelog

* bump version v0.5.6
2022-02-22 16:54:39 +01:00
Clément DOUIN 585fa77af5
release v0.5.5 (#290)
* update main screenshot readme

* add contributing file

* update changelog

* doc: remove roadmap from reame

* improve main comments

* improve arg and handler logs

* fix multiple recipients issue (#288)

* add notify-query config option (#289)

* set up end-to-end encryption (#287)

* init basic pgp encrypt/decrypt

* add small rpgp poc for (#286)

* improve decrypt parts logs

* add pgp-decrypt-cmd to config

* add pgp-encrypt-cmd to config

* init pgp signature

* improve decrypt part readability

* improve encrypt multipart, remove sign

* remove unused md5 lib

* add encrypt arg to reply and forward commands

* fix typos

* prepare v0.5.5
2022-02-08 14:50:09 +01:00
Clément DOUIN e33a9a72e9
release v0.5.4 (#285)
* replace bsd3 license by bsd4

* add attachments with save and send commands (#284)

* set up tpl save and send commands

* improve msg save and send handlers

* add vim msg#add_attachment fn

* improve vim logs

* update changelog

* add attachment keybind vim doc

* reverse range order fetch envelopes (#276)

* bump version v0.5.4
2022-02-05 00:29:57 +01:00
Clément DOUIN 3a42c937be
link imap debug mode with env logger (#269) 2022-02-03 15:54:56 +01:00
Clément DOUIN 8cdeba62a1
release v0.5.2 (#282)
* doc: fix blur in list msg screenshots (#181)

* fix a typo in mbox arg (#245)

`targetted` to `targeted` 👌🏻

* make inbox, sent and drafts folder customizable (#246)

* mbox: make inbox, sent and drafts folder customizable

* msg: update send handler parameters order

* vim: fix extracting message ids from list (#247)

The current method doesn't work because the list uses a fancy line
character (`│`) as the separator, not a regular pipe character (`|`).
Matching for the first number in the line instead solves the problem and
will continue to work regardless of what separator is used.

* add new line after printing strings (#251)

* init cargo workspace (#252)

* init cargo workspaces

* nix: fix assets path

* doc: update rtp vim plugin

* vim: add error message if loading vim plugin from vim/

* init sub crates (#253)

* init sub crates

* doc: update readme

* doc: improve main readme

* doc: add links, add missing crate task

* doc: update emojis

* update cargo lock

* implement contact completion with completefunc (#250)

This allows users to define a command for contact completion with
`g:himalaya_complete_contact_cmd` and trigger it with `<C-x><C-u>` when
writing an email.

* fix clippy lints (#255)

* revert cargo workspace feature

* fix nix run (#274)

* replace cargo2nix by naersk

* add rust-analyzer and rustfmt to nix build inputs

* remove wiki from git submodules, update changelog

* fix missing range when fetch fails, add more logs (#276)

* add missing fix in changelog

* remove blank lines and spaces from plain parts (#280)

* fix watch command (#271)

* remove also tabs from text parts (#280)

* pin native-tls minor version (#278)

* improve msg sanitization (#280)

* fix mbox vim plugin telescope preview (#249)

* bump version v0.5.2

* update changelog

Co-authored-by: Austin Traver <austintraver@gmail.com>
Co-authored-by: Jason Cox <dev@jasoncarloscox.com>
Co-authored-by: Gökmen Görgen <gkmngrgn@gmail.com>
Co-authored-by: Ethiraric <ethiraric@gmail.com>
2022-02-02 02:21:35 +01:00
Clément DOUIN e154481c5b
add max table width arg, refactor printer (#237)
* printer: refactor output to pass down args from cli

* msg: add missing max width arg to search cmd

* output: rename printer service, merge print with output folder

* doc: update changelog and wiki

* table: rename print fn
2021-10-24 21:02:02 +02:00
Clément DOUIN 192445d7e4
make use of termcolor crate to disable colors (#236)
* table: replace custom color by termcolor

* table: deactivate colors if not tty

* table: rename printable to print, add more comments

* table: make use of writters, fix tests

* doc: update changelog

* doc: add page to wiki
2021-10-24 00:17:12 +02:00
Alan Morgan 09d3de5e6f
parse raw message as ut8 lossy (#234)
Reading a message raw uses uses utf_lossy to ensure the message can be read
even if there is invalid utf8.
2021-10-23 17:23:25 +02:00
Clément DOUIN eaa83b71ef
notify cannot get body (#233)
* imap: fix notify cmd

* doc: update changelog
2021-10-23 00:46:21 +02:00
Clément DOUIN f0b2fd788d
remove error when empty subject (#232)
* msg: remove error when empty subject

* doc: update changelog
2021-10-23 00:25:34 +02:00
Clément DOUIN d9272917f5
clean msg flags, merge tpl entity in msg (#231)
* merge tpl entity into msg

* change envelope subject type to cow

* msg: fix save command when raw msg comes from stdin

* msg: clean flags
2021-10-23 00:17:24 +02:00
Clément DOUIN 85f3ce8976
add mailbox handler tests (#225)
* make imap.fetch_mboxes return a Mboxes struct

* add mbox handler tests
2021-10-14 12:52:30 +02:00
Clément DOUIN 8af14734c3
improve mailbox structure (#223)
* split entities, remove manual serialization, add comments

* add mbox arg subbcmds test

* finalize mbox arg tests

* fix typos in comments

* add missing tests for entities

* rename fetch mbox imap fn
2021-10-13 20:48:42 +02:00
Clément DOUIN d21778c35e
improve text parts (#221) 2021-10-11 23:04:33 +02:00
Clément DOUIN b7d068c729
improve folder struct + msg management (#217)
* make imap list and search return msg instead of fetch

* move imap logouts to main fn

* improve list command

* improve search command

* improve flags command

* improve template reply

* improve tpl forward command

* refactor tpl and msg reply/forward

* refactor copy, move and write commands

* refactor attachment command

* fix attachment part of copy and move commands

* fix send, save, read and mbox

* put back notify and watch commands

* fix msg encoding

* refactor edit choices, clean dead code

* fix attachment for write, reply and forward commands

* refactor config mod struct

* refactor project folder struct

* fix vim plugin (#215)
2021-10-10 22:58:57 +02:00
Clément DOUIN 9931658ea3
review template, write and search commands 2021-09-19 17:21:42 +02:00
Clément DOUIN 079572666a
review reply command 2021-09-19 17:04:05 +02:00
Clément DOUIN 7a43bdd46e
review read command 2021-09-19 16:58:10 +02:00
Clément DOUIN d706a13e5e
review mailto command 2021-09-19 16:51:58 +02:00
Clément DOUIN ac75c1d37a
review move command 2021-09-19 16:48:09 +02:00
Clément DOUIN c7940f72ff
review mailboxes command 2021-09-19 16:42:45 +02:00
Clément DOUIN cebff51e5b
review list command 2021-09-19 16:41:02 +02:00
Clément DOUIN e609fc296c
review forward command 2021-09-19 16:35:52 +02:00
Clément DOUIN 65664d5405
review flag command, remove lib + dead code 2021-09-19 14:24:00 +02:00
Clément DOUIN 71818e04b4
review delete command 2021-09-19 11:36:11 +02:00
Clément DOUIN 2e27972716
review copy command 2021-09-19 11:18:17 +02:00
Clément DOUIN c155d30e54
review completion command 2021-09-19 11:04:01 +02:00
Clément DOUIN 2bcad3ff87
review attachment command 2021-09-19 10:55:15 +02:00
Clément DOUIN 474fae06ee
move attachment, body and header to dedicated folders 2021-09-19 10:14:25 +02:00
Clément DOUIN cdce6c0bf2
fix tpl forward/reply, fix flag subcmd (#190) 2021-09-19 00:08:57 +02:00
Clément DOUIN e065d8d905
fix new tpl sig 2021-09-18 21:45:26 +02:00
Clément DOUIN 8e2a703e2b
improve arg comments, rename arg Match to Command 2021-09-18 15:15:36 +02:00
Clément DOUIN e41a71648c
rename output cli to arg 2021-09-18 00:32:46 +02:00
Clément DOUIN 94e9711c58
split input into submodules 2021-09-18 00:29:49 +02:00
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
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
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
Fancy Cade fadebf0997
generate Message-Id header with uuid and from address domain (#171) 2021-07-08 14:49:24 +02:00
Clément DOUIN e3d022720d
add ability to change account vim plugin (#91) 2021-06-03 16:08:03 +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 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 66abac61fa
add wiki entry about new msgs counter (#121) 2021-05-08 13:19:25 +02:00
Clément DOUIN ef1a22d986
split idle cmd into notify+watch, remove err when empty result 2021-05-07 16:41:51 +02:00
Clément DOUIN dcbbe01c94
add mailbox attributes (#134) 2021-05-04 23:11:01 +02:00
Clément DOUIN 435932a501
get signature from file (#135) 2021-05-04 16:19:06 +02:00
Clément DOUIN 9ba0c75c58
remove \t from subjects (#141) 2021-05-04 12:18:36 +02:00
Clément DOUIN 4668d51476
use stdin to send message (#78) 2021-05-04 00:15:11 +02:00
Clément DOUIN d5ed69ebf9
fix overflow panic when shrink column (#138) 2021-05-03 22:10:03 +02:00
Clément DOUIN e07e72f497
fix table with subject containing \r\n(#141) 2021-05-03 14:25:28 +02:00
Clément DOUIN 05b0274725
add debug and trace logs in table module (#138) 2021-05-03 14:08:04 +02:00
Clément DOUIN 364654e1ce
init integration tests 2021-05-02 23:49:20 +02:00
Clément DOUIN fa2f93185f
improve logging, replace log-level by RUST_LOG 2021-04-28 00:47:24 +02:00
Clément DOUIN 950e57acdb
show email addr when name not available (#131) 2021-04-27 18:10:18 +02:00
Clément DOUIN 754d311a05
fix edition file format (#133) 2021-04-27 17:18:53 +02:00
Clément DOUIN cddb7bde37
refactor table system (#132)
* init table trait

* add shrink_col_index and max_width method to Table trait

* make unicodes work when shrinking

* improve readability of the table

* replace old table system with new one

* update changelog
2021-04-27 14:54:53 +02:00
Clément DOUIN cb296a5d98
fix stderr redirection (#130) 2021-04-26 11:32:19 +02:00
Clément DOUIN 06f628c33b
fix idle mode after network interruption (#123) 2021-04-25 16:20:24 +02:00
Clément DOUIN 17df485e19
vim table containing emoji (#122) 2021-04-24 23:31:26 +02:00
Clément DOUIN 15c635eb1d
use env_logger for plain output fmt (#126) 2021-04-24 22:54:01 +02:00
Antonio Yang 477b7748de
add content-transfer-encoding support (#128) 2021-04-24 19:32:12 +02:00
Clément DOUIN 366e0b72ed
add idle_hook_cmds setting 2021-04-23 00:20:02 +02:00
Antonio Yang b24ff24426
handle completions subcommand first (#116)
* handle completions subcommand first

* raise errors from comp_matches

Co-authored-by: Clément DOUIN <soywod@users.noreply.github.com>

Co-authored-by: Clément DOUIN <soywod@users.noreply.github.com>
2021-04-20 12:35:01 +02:00
Axel Dahlberg 6284b0c5a6
improve signature and template management (#114)
* Added signature seperator option plus some refactoring

* Have add_content make newline seperation to headers

* Remove signature separator as a separate argument
2021-04-20 11:23:03 +02:00
Chawye Hsu 28812eab06
improve config compatibility on windows (#111)
* fix: fix config loading compatibility on Windows

Signed-off-by: Chawye Hsu <chawyehsu@hotmail.com>

* more strictly on matching crlf chars

* use conditional assignment
2021-04-19 11:26:28 +02:00
Clément DOUIN 4af2b6a0ac
refactor readme + wiki (#110)
* make readme more concise

* update wiki

* update wiki links inside readme
2021-04-18 23:08:50 +02:00
Clément DOUIN 0907683e31
split modules into mod.rs files 2021-04-18 00:21:22 +02:00
Clément DOUIN 95b99c25da
add custom config path (#86) 2021-04-17 23:19:34 +02:00
Clément DOUIN 3e0d1f704d
add default page size config (#96) 2021-04-17 22:41:10 +02:00
Clément DOUIN f3a67cecd5
fix idle mode notifications (#48) 2021-04-17 00:00:52 +02:00
remche 9317e6b8a5
allow insecure tls option, second try (#105) 2021-04-16 12:33:12 +02:00
Clément DOUIN 2f018889e0
fix panic when downloads-dir does not exist (#100) 2021-04-16 00:00:00 +02:00
Clément DOUIN 33185dba86
save msg upon error (#59) 2021-04-15 23:29:58 +02:00
remche f4cc584716
add insecure tls option for testing purpose (#103) 2021-04-15 13:35:59 +02:00
Clément DOUIN aad74add52
make completion cmd a subcommand of shell args 2021-04-15 13:24:18 +02:00
Clément DOUIN 511878fbd1
remove unused smtp import 2021-04-14 10:40:33 +02:00
remche 9287846aed
add completion subcommands (#99)
* add completion subcommands

* improve error mgmt, add entry to readme

Co-authored-by: Clément DOUIN <soywod@users.noreply.github.com>
2021-04-14 10:28:23 +02:00
Sridhar Ratnakumar 647c0c25ce
fix smtp port (#94)
* Respect smtp port when sending email

(cherry picked from commit ef89cbd30296389b7d363ecbb03080081304d98e)

* smtp: remove explicit timeout

Also remove redundant variable
2021-04-13 16:44:24 +02:00
Clément DOUIN 926f476194
increase smtp timeout (#87) 2021-04-12 00:38:10 +02:00
Clément DOUIN e8ae4b025f
release v0.2.5 2021-04-12 00:21:08 +02:00
Clément DOUIN 557c5b79bc
expunge mbox after move and delete cmds (#83) 2021-04-09 14:42:25 +02:00
Clément DOUIN da15ffafd0
add wiki entry about read msg 2021-04-09 00:46:21 +02:00
Clément DOUIN 570c67a2bb
add --raw arg for read cmd (#79) 2021-04-09 00:30:18 +02:00
Clément DOUIN f26051685c
refactor output system (#74) 2021-04-09 00:15:16 +02:00
Clément DOUIN ebf1b854be
add silent flag (#74) 2021-04-08 18:44:31 +02:00
Clément DOUIN 8e6740db65
add info log for copy/move/delete cmds 2021-04-08 18:33:12 +02:00
Clément DOUIN daaa37f3a7
fix incomplete copy/move (#75) 2021-04-08 13:55:23 +02:00
Clément DOUIN 994141f852
fix unicode issue (#71) 2021-04-08 12:59:44 +02:00
Clément DOUIN 1dc051c7c0
add alias for write cmd 2021-04-04 17:43:23 +02:00
Clément DOUIN d99e17af75
fix logs attachment cmd 2021-04-04 17:41:31 +02:00
Clément DOUIN 9602fc0b5b
fix page size for search cmd 2021-04-04 17:38:40 +02:00
Clément DOUIN 409e25fc4d
fix pagination 2021-04-04 15:07:41 +02:00
Clément DOUIN 3d702677b5
refactor vim fn naming 2021-04-04 14:25:55 +02:00
Clément DOUIN 9f7173a572
prevent simultaneous imap conn 2021-04-04 00:17:27 +02:00
Clément DOUIN 2850ae01fd
implement add attachement to msg feature 2021-04-03 22:30:57 +02:00
Clément DOUIN 17115319ee
introduce signature feature 2021-04-03 11:50:07 +02:00
Clément DOUIN 1a26ac4b2c
rename messages subcmd to list 2021-04-03 11:26:12 +02:00
Clément DOUIN 8d1f1e5ed1
add copy/move/delete features 2021-03-31 23:00:54 +02:00
Clément DOUIN 8dbd7c1e7a
merge app with main 2021-03-23 22:37:52 +01:00
Clément DOUIN f2158e71d2
extract output cli+utils 2021-03-23 22:26:29 +01:00
Clément DOUIN e2ba18cda8
extract imap cli+model 2021-03-23 22:20:54 +01:00
Clément DOUIN 96c527dd1a
clean msg/mbox cli files 2021-03-23 22:06:42 +01:00
Clément DOUIN a0296a54d2
extract mbox and msg logics 2021-03-22 22:22:05 +01:00
Clément DOUIN e108729491
extract flags from msg model 2021-03-22 12:50:22 +01:00
Clément DOUIN 563f9a6538
split flags cli logic to a dedicated mod 2021-03-19 23:15:38 +01:00
Clément DOUIN 1d92b5bc00
add answered flag when replying to a message 2021-03-19 22:05:34 +01:00
Clément DOUIN ac6931624b
add flags managers 2021-03-19 22:02:33 +01:00
Clément DOUIN 64019fa5ec
improve choice after editing msg 2021-03-16 23:39:43 +01:00
Clément DOUIN 0dd73e693e
fixed overflow when empty page 2021-03-16 22:33:06 +01:00