Commit Graph

78 Commits

Author SHA1 Message Date
Koni Marti 7811620eb8 threading: implement on-the-fly message threading
implement message threading on the message store level using the
jwz algorithm. Build threads on-the-fly when new message headers arrive.

Use the references header to create the threads and the in-reply-to
header as a fall-back option in case no references header is present.

Does not run when the worker provides its own threading (e.g. imap
server threads).

Include only those message headers that have been fetched and are
stored in the message store.

References: https://www.jwz.org/doc/threading.html
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Tested-by: akspecs <akspecs@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-02-24 13:00:12 +01:00
Robin Jarry 726969833b main: use terminfo to set window title
Parse the terminal capabilities from the TERM environment variable
instead of using a hard coded list of terminals.

tcell does not expose the status line capabilities. Use another library
for this: github.com/xo/terminfo

Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-20 21:29:20 +01:00
Koni Marti 8813fadfe9 pgp: update openpgp packages (go-crypto and go-pgpmail)
Replaces golang.org/x/crypto with github.com/ProtonMail/go-crypto
consistently and updates go-pgpmail to v0.2.0

Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-07 13:45:34 +01:00
Robin Jarry b1daf08991 go.mod: cleanup
Run go mod tidy.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05 10:29:07 +01:00
Robin Jarry 0d645bcebd go.mod: change base git url
I'm not sure what are the implications but it seems required.

Link: https://github.com/golang/go/issues/20883
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05 10:21:45 +01:00
Robin Jarry 4cf0ea2a05 imap: use builtin idle support
go-imap supports IDLE since 1.2.0. Remove dependency to go-imap-idle.

Link: https://github.com/emersion/go-imap/commit/ac3f8e195ef1b6d
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-02 11:24:33 +01:00
Robin Jarry 8d4c6e1adf go: update all dependencies
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-01 13:24:26 +01:00
y0ast 03650474e2 update tcell to v2 and enable TrueColor support
Also update to the tcell v2 PaletteColor api, which should keep the chosen
theme of the user intact.

Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop
clipping the value to one of the theme colors.
Generally this is desired behaviour though.
2020-12-18 07:23:22 +01:00
Reto Brunner a9330f4c63 notmuch: remove gc close hooks
We frequently had issues with notmuch segfaulting and my guess is that this
was due to the garbage collection magic used in the module.

This changes to a fork that ripped the functionality out.
2020-12-02 09:06:34 +01:00
Reto Brunner 20ec2c8eeb compose: use a proper header instead of a string map
Prior to this commit, the composer was based on a map[string]string.
While this approach was very versatile, it lead to a constant encoding / decoding
of addresses and other headers.

This commit switches to a different model, where the composer is based on a header.
Commands which want to interact with it can simply set some defaults they would
like to have. Users can overwrite them however they like.

In order to get access to the functions generating / getting the msgid go-message
was upgraded.
2020-11-14 15:40:13 +01:00
y0ast 743683a0c1 update go-imap-sortthread
Fixes a problem with "Missing Sort Criteria" because go-imap-sortthread
wasn't sending the sort request in an RFC compliant way. This has been
fixed in the latest commit.
2020-10-18 10:43:48 +02:00
y0ast 0f584eb3e2 update go-imap
This fixes the problem that when the header contains "undisclosed-recipients:;",
which got parsed by go-imap as "<undisclosed-recipients@>, <@>".
If we do reply all, aerc adds these malformed emails to the To: field.
2020-10-15 09:12:25 +02:00
Reto Brunner b6bcf89784 imap: add sort support 2020-10-11 09:18:45 +02:00
Reto Brunner 84549e917d Update go-imap to latest commit
* return empty reader instead of nil when BODY is found but server returns nil
* utf7: fix package doc comment
* imap: lower some fields + content disposition keys
* remove "should not be called directly" comments and replaced them with links to the GitHub wiki pages
* backendutil: Improve Match function
* Write NIL for empty ENVELOPE fields
* readme: add NAMESPACE extension
* server: error when selecting should unselect
* Support NIL hierarchy delimiter
* backendutil: Implement message size and lines counting
* readme: update CI badge to only show status for commits
* Fix empty envelope address fields
* server: Return proper BAD response for cancelled SASL negotiation
* Replace empty string result in ErrStatusResp.Error
* Move ErrStatusResp to the root package
* Add MailboxInfoUpdate
* Fix BodyStructure fields documented as encoded
2020-09-15 07:07:16 +02:00
Reto Brunner 43c4f2f3ab update go-message 2020-08-31 21:48:07 +02:00
Drew DeVault 32fd5856b3 Revert "Upgrade tcell version to 1.4.0 to support truecolor"
This reverts commit 2ada00de1e.
2020-08-28 10:36:40 -04:00
y0ast 2ada00de1e Upgrade tcell version to 1.4.0 to support truecolor 2020-08-28 07:10:58 +02:00
Reto Brunner 32df768d03 Update go-message, fixes various bugs
Changelog:
d262af7 (tag: v0.12.0) textproto: check header characters
5b97b1b Remove hz-gb-2312 encoding as it can crash
0e60ea0 writer: add Mime-Version header when missing
c512562 textproto: add Header.Raw and HeaderFields.Raw
4af4c77 textproto: Add HeaderFields.Len
f828d02 Add test converting an Entity to quoted-printable
8c6ac6b Add CreateInlineWriter to get a writer that allows alternatives, but no attachments.
fee642d (tag: v0.11.2) Fix incorrect line folding of RFC2047-encoded strings
9c4415e textproto: add limits for header field length and total amount of fields
46fe03d mail: add Message-Id test with IPv6 address
6c32091 textproto: add MultipartReader tests
9ce1b6f textproto: remove unused skipSpace function
a41879c mail: add tests for Header.{MessageID,MsgIDList}
82eb31c mail: add Header.MessageID and Header.MsgIDList
7e482a2 mail: add headerParser
40e7be6 textproto: minor doc improvements
f119d5f readme: remove stability badge
e48b6c5 mail: minor comments and docs improvements
8ade7dd textproto: add error on invalid header key
2020-07-09 08:28:58 +02:00
Reto Brunner 5790023568 creak/pty got force pushed: fix version 2020-05-08 22:32:28 +02:00
Guillaume J. Charmes dc281e46d2 Use stdout as controlling terminal
Soves an issue with go1.15 not letting ctty be a parent. See
https://github.com/creack/pty/pull/97 for more details.

Signed-off-by: Guillaume J. Charmes <git+guillaume@charmes.net>
2020-05-06 10:26:15 -04:00
Drew DeVault 38a6d187b9 Revert "Dont detach process under vterm"
This reverts commit d07cf6c667.
2020-05-06 10:03:20 -04:00
Guillaume J. Charmes d07cf6c667 Dont detach process under vterm
Signed-off-by: Guillaume J. Charmes <git+guillaume@charmes.net>
2020-05-06 10:01:10 -04:00
Anirudh Oppiliappan 280d8e7e1c Bump ProtonMail/crypto to fix build on OpenBSD
Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
2020-04-20 18:55:04 +02:00
Simon Ser 294fead7ab Requires Go 1.13
We use errors.Is, which has been introduced in Go 1.13.
2020-03-20 10:44:50 -04:00
Drew DeVault f3158b36f1 Initial support for PGP decryption & signatures 2020-03-03 16:49:52 -05:00
Simon Ser 89f1684ea4 Update dependencies
This brings in some bug fixes.
2020-03-03 16:48:35 -05:00
Galen Abell 6ff3c7a1ba Mark sent messages as "seen" in maildir
- Add maildir flags to complement a messages imap flags
- Set the "seen" flag on sent messages when using the maildir backend
- Cleanup AppendMessage interface to use models.Flag for both IMAP and
  maildir
2020-03-03 20:08:37 +01:00
Srivathsan Murali b2fa5a16f5 Contextual UI Configuration
+ Adds parsing of contextual ui sections to aerc config.
+ Add GetUiConfig method for AercConfig that is used to get the
  specialized UI config.
+ Add UiConfig method to AccountView to get specialized UI Config.
+ Modifies Aerc codebase to use specialized UIConfig instead.
+ Adds documentation for Contextual UI Configuration
2020-01-24 10:50:21 -05:00
Ben Fiedler 686ca24405 Switch back to upstream pty library
The relevant change was merged upstream, and thus allows us to clean up
unneeded forks.
2020-01-16 13:45:27 -05:00
Ben Burwell 4ab82bf306 Update go-maildir to latest
This fixes an upstream issue where improperly named maildir files could
cause a panic. Now, we simply show an error and don't display the
message if the backing file is not named according to the maildir spec.
2019-12-19 08:41:11 +01:00
Luke Drummond 331b915139 Add support for AUTH LOGIN submission
`go-sasl` upstream added support [1] for the obsolete [2] AUTH LOGIN
method which enables aerc to send email via servers which remain common
in the wild.

Fixes ~sircmpwn/aerc2#263

[1] https://github.com/emersion/go-sasl/commit/61afe53d
[2] https://datatracker.ietf.org/doc/draft-murchison-sasl-login/
2019-11-01 11:02:01 -04:00
Reto Brunner 3f452ca283 notmuch: sync maildir flags
Syncs back special notmuch tag like unread to the underlying maildir store
2019-09-16 12:19:14 -04:00
Reto Brunner 17aede55dd upgrade go-message
Fixes date parsing bug in the maildir / notmuch workers.
2019-08-20 09:53:21 +09:00
Reto Brunner b47143ccc7 bump go-message, fixes address list parsing failure 2019-08-16 09:20:12 +09:00
Reto Brunner 2485d50983 add github.com/zenhack/go.notmuch 2019-08-08 10:10:33 +09:00
Drew DeVault 1f6c108c04 Update tcell 2019-08-07 14:49:22 +09:00
Drew DeVault 84f49e96ce Update tcell 2019-07-27 12:33:59 -04:00
Simon Ser 974b22c8f1 Update dependencies
A bug corrupting long In-Reply-To headers has been fixed upstream in
go-message:
https://github.com/emersion/go-message/issues/44
2019-07-27 12:11:42 -04:00
Ben Burwell 66d916aa7b Use latest go-maildir 2019-07-19 17:33:30 -04:00
Ben Burwell 6473848d87 maildir: Watch for new messages
When a directory is opened, start watching its "new" subdirectory for
incoming messages using the fsnotify library. When creation events are
detected, run the Unseen routine to move the message from new to cur and
add new UIDs to the store, updating the UI's list of directory contents
as we go.
2019-07-17 17:29:11 -04:00
Ben Burwell 840b5bd633 Handle the invalid "utf8" encoding
See commit 0bfc369eb68a1d34ea0ee983f218e97a14099959 in the go-message
package.
2019-07-12 11:26:39 -04:00
Ben Burwell 1b8b6e218c Add maildir backend worker
Add the initial implementation of a backend for Maildir accounts. Much
of the functionality required is implemented in the go-message and
go-maildir libraries, so we use them as much as possible.

The maildir worker hooks into a new maildir:// URL scheme in the
accounts.conf file which points to a container of several maildir
directories. From there, the OpenDirectory, FetchDirectoryContents, etc
messages work on subdirectories. This is implemented as a Container
struct which handles mapping between the symbolic email folder names and
UIDs to the concrete directories and file names.
2019-07-12 11:09:50 -04:00
Frode Aannevik b0eaf5191c Support imaps with oauthbearer authentication (Gmail)
imaps+oauthbearer://user:token@host?token_endpoint=...

 - the config Source password is used as access token if
   no token_endpoint parameter is set
 - the config Source password is used as refresh token if
   token_endpoint parameter is set, and used to exchange
   with an access token

The implementation has only been tested with Gmail.

    source = imaps+oauthbearer://{username}:{refersh_token}@imap.gmail.com:993? \
    client_id=XX&\
    client_secret=XX&\
    token_endpoint=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Ftoken

client credentials created with

    https://console.developers.google.com/apis/credentials

refresh token created with

    https://github.com/google/gmail-oauth2-tools/blob/master/python/oauth2.py

rel: https://todo.sr.ht/~sircmpwn/aerc2/42
2019-07-11 19:36:14 -04:00
Daniel Lublin 963d251289 Set the required go version for this module, aerc
This is the way to declare which compiler version a module requires to build.

I read up on https://golang.org/doc/go1.12#modules
2019-06-27 09:24:20 -04:00
Drew DeVault ab79bc3447 Update tcell 2019-06-15 23:30:12 -04:00
Clayton Craft f5a4d935ef Update reply to use getopt posix optind format
This changes the handling of optind for the 'reply' command to match
recent changes to getopt.
2019-06-09 15:50:50 -04:00
Simon Ser 0c2ede593f Update dependencies
This should get rid of this error message:

    tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config
2019-06-04 14:29:09 -04:00
Drew DeVault 2be985fecb Update tcell fork 2019-06-02 10:08:06 -04:00
Drew DeVault 56b84d3da5 Use forked version of tcell 2019-06-01 11:28:29 -04:00
Drew DeVault 62cd0b08aa Update terminal color handling per vterm changes 2019-05-26 15:48:29 -04:00