aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/worker.go
Commit message (Collapse)AuthorAgeFilesLines
* treewide: replace uint32 uids with opaque stringsRobin Jarry2024-08-281-2/+2
| | | | | | | | | | | | | | | | | Add a new models.UID type (an alias to string). Replace all occurrences of uint32 being used as message UID or thread UID with models.UID. Update all workers to only expose models.UID values and deal with the conversion internally. Only IMAP needs to convert these to uint32. All other backends already use plain strings as message identifiers, in which case no conversion is even needed. The directory tree implementation needed to be heavily refactored in order to accommodate thread UID not being usable as a list index. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* imap: expose extension in capabilitiesKoni Marti2024-08-041-0/+2
| | | | | | | | Expose the supported extensions in the capabilities. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* idler: improve the imap idlerKoni Marti2024-01-251-18/+80
| | | | | | | | | | Rewrite the imap idler to make it more fault tolerant and prevent hangs (and possibly short writes). Fixes: https://todo.sr.ht/~rjarry/aerc/208 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: support the Gmail extension (X-GM-EXT-1)Koni Marti2023-08-031-0/+10
| | | | | | | | | | | | | Support the IMAP Gmail extension (X-GM-EXT-1) to fetch all messages for a given thread. This allows client-side threading to display a full message thread. Obviously, it requires a Gmail account to work. The extension is only used when requested in accounts.conf with: "use-gmail-ext = true" (default: false) Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Tristan Partin <tristan@partin.io>
* imap: add folder-mapKoni Marti2023-06-221-1/+1
| | | | | | | | | Add the folder-map functionality to the imap backend. If the folder-map config option is specified, the folder-map worker middleware is used. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* worker: add WorkerInteractor interfaceKoni Marti2023-06-221-1/+2
| | | | | | | | | | | | Add a WorkerInteractor interface. Avoid exposing any public fields in the types.Worker. This will set the stage to implement a middleware pattern for the workers, i.e. to map folder names between the ui and the backend. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: use named loggerRobin Jarry2023-06-121-7/+6
| | | | | | | | Use the worker's logging functions to have all imap related messages prefixed by the account name. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
* headers: enable partial header fetchingTim Culverhouse2023-05-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enable partial header fetching by creating config values for headers to specifically include, or specifically exclude. The References field will always be fetched, regardless of the include list. Envelope data is always fetched, but is not shown with :toggle-headers, since it isn't in the RFC822 struct unless explicitly included in the list. Partial headers can break the cache on changes. Update the cache tag key to include the state of the partially-fetched headers. Partial header fetching can have a significant performance increase for IMAP, and for all backends a resource improvement. Some data to support this is below. Gathered by opening aerc, selecting a mailbox with approximately 800 messages and scrolling to the end. Received measured with nethogs, RAM from btop Received | RAM ------------------------------------- All Headers | 9,656 kb | 103 MB Minimum Headers | 896 kb | 36 MB Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: use delimiter from serverMoritz Poldrack2023-05-161-5/+13
| | | | | | | | | To accommodate servers that use a delimiter other than "/" ("." being a common alternative), the delimiter is fetched from the server when connecting. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* capabilities: report capabilities from backendTim Culverhouse2023-04-221-0/+4
| | | | | | | | | | | | | Use the Backend interface to report Backend capabilities. Previously, these were reported via a DirectoryInfo message, however they have nothing to do with a directory and should be reported directly by the backend. Add Capabilities method to Backend interface, satisfy this in each backend, and use it on the UI side. Remove Caps field from DirectoryInfo Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry<robin@jarry.cc>
* imap: properly handle mailbox status updatesTim Culverhouse2023-04-221-15/+2
| | | | | | | | | | | | | | | | | | | | Mailbox status updates received from the IMAP server do not come with the information being sent to the UI. Use the update signal to instead trigger a check-mail of the directory the status was sent for. The status update comes with the following data: - Messages in the mailbox - Recent messages in the mailbox - Sequence number of the first Unseen message - Flags in the mailbox The data we actually we want to send to the UI: - Messages in the mailbox - Recent messages in the mailbox - Unseen messages in the mailbox Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: check for list-status capabilityTim Culverhouse2022-12-021-3/+16
| | | | | | | | | | | | | Check for LIST-STATUS capability on IMAP servers. This will be used in subsequent commits for improved check-mail performance. The LIST-STATUS command allows the LIST command to also return STATUS responses, which include message counts. Upgrade go-imap to latest release. Add go-imap-liststatus extension. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: rename package to logRobin Jarry2022-12-021-6/+6
| | | | | | | | | | Use the same name than the builtin "log" package. That way, we do not risk logging in the wrong place. Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* logging: homogenize levelsRobin Jarry2022-12-021-3/+3
| | | | | | | | | | | | | | | | | | The main goal is to ensure that by default, the log file (if configured) does not grow out of proportions. Most of the logging messages in aerc are actually for debugging and/or trace purposes. Define clear rules for logging levels. Enforce these rules everywhere. After this patch, here is what the log file looks like after starting up with a single account: INFO 2022/11/24 20:26:16.147164 aerc.go:176: Starting up version 0.13.0-100-g683981479c60 (go1.18.7 amd64 linux) INFO 2022/11/24 20:26:17.546448 account.go:254: [work] connected. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* imap: add support for ORDEREDSUBJECT threading algorithmjp392022-11-091-4/+10
| | | | | | | | | | | | The imap worker incorrectly tries to use the REFERENCES threading algorithm by default although some servers only support the ORDEREDSUBJECT threading algorithm. Use whichever threading algorithm is advertised as supported by the server, buf prefer REFERENCES if available. Signed-off-by: jp39 <jp39@gmx.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* imap,smtp: add XOAUTH2 supportJulian Pidancet2022-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | Add XOAUTH2 authentication support for IMAP and SMTP. Although XOAUTH2 is now deprecated in favor of OAuthBearer, it is the only way to connect to Office365 since Basic Auth is now completely removed. Since XOAUTH2 is very similar to OAuthBearer and uses the same configuration parameters, this is basically a copy-paste of the existing OAuthBearer code. However, XOAUTH2 support was removed from go-sasl library, so this change reimports the code that was removed from go-sasl and offers it a new home in lib/xoauth2.go. Hopefully it shouldn't be too hard to maintain, being less than 50 SLOC. Link: https://github.com/emersion/go-sasl/commit/7bfe0ed36a21 Implements: https://todo.sr.ht/~rjarry/aerc/78 Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* imap: implement MoveMessages handlingTim Culverhouse2022-08-221-0/+2
| | | | | | | | | | | | Implement MoveMessages in the imap backend. go-imap includes the MOVE Imap extension by default, and if a server does not support it the command fallsback to a copy-and-delete operation. Servers with the MOVE extension will see a slight performance increase when moving messages due to fewer round trips. The IMAP implementation uses a MessagesMoved worker message to avoid polling the destination mailbox. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: work nicely with wrapped errors (errorlint)Moritz Poldrack2022-08-041-1/+1
| | | | | | | | Error wrapping as introduced in Go 1.13 adds some additional logic to use for comparing errors and adding information to it. Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* seqmap: refactor seqmap to use slice instead of mapTim Culverhouse2022-08-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The imap worker's seqmap is represented as a map of sequence number to UID. This presents a problem when expunging group of messages from the mailbox: each individual expunge decrements the sequence numbers by 1 (for every sequence number greater than the expunged). This requires a looping around the map to update the keys. The use of a map also requires that both the sequence number and the UID of a message be known in order to insert it into the map. This is only discovered by fetching individual message body parts (flags, headers, etc), leaving the seqmap to be empty until we have fetched information about each message. In certain instances (if a mailbox has recently been loaded), all information is loaded in memory and no new information is fetched - leaving the seqmap empty and the UI out of sync with the worker. Refactor the seqmap as a slice, so that any expunge automatically decrements the rest of the sequences. Use the results of FetchDirectoryContents or FetchDirectoryThreaded to initialize the seqmap with all discovered UIDs. Sort the UIDs in ascending order: IMAP specification requires that sequence numbers start at 1 increase in order of ascending UID. Add individual messages to the map if they come via a MessageUpdate and have a sequence number larger than our slice. Update seqmap tests with new logic. Reference: https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.1.2 Fixes: https://todo.sr.ht/~rjarry/aerc/69 Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: use level-based logger functionsRobin Jarry2022-07-231-5/+6
| | | | | | | | | | | | Do not pass logger objects around anymore. Shuffle some messages to make them consistent with the new logging API. Avoid using %v when a more specific verb exists for the argument types. The loggers are completely disabled (i.e. Sprintf is not even called) by default. They are only enabled when redirecting stdout to a file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* threading: add backend capabilities to workersTim Culverhouse2022-07-101-0/+14
| | | | | | | | | | | This patch provides a method to report backend capabilities to the UI. The intial capabilities included in the report are Sort and Thread. Having these available to the UI enables the client to better handle server side threading. Signed-off-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: fix data race on seqMap arrayRobin Jarry2022-06-241-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are concurrent threads that are accessing and modifying IMAPWorker.seqMap (the mapping of sequence numbers to message UIDs). This can lead to crashes when trying to add and remove a message ID. panic: runtime error: index out of range [391] with length 390 goroutine 1834 [running]: git.sr.ht/~rjarry/aerc/logging.PanicHandler() logging/panic-logger.go:47 +0x6de panic({0xa41760, 0xc0019b3290}) /usr/lib/golang/src/runtime/panic.go:838 +0x207 git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).handleFetchMessages.func1() worker/imap/fetch.go:214 +0x185 created by git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).handleFetchMessages worker/imap/fetch.go:209 +0x12b Use a map which makes more sense than a simple array for random access operations. Also, it allows better typing for the key values. Protect the map with a mutex. Add internal API to access the map. Add basic unit tests to ensure that concurrent access works. Fixes: https://todo.sr.ht/~rjarry/aerc/49 Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* imap: add option to cache headersTim Culverhouse2022-06-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add option to cache headers for imap accounts. Cache db is located at $XDG_CACHE_DIR/aerc/{account name}. The cache is cleaned of stale entries when aerc is first opened. Two new account level configuration options are introduced: * cache-headers (Default: false) * cache-max-age (Default: 30 days (720 hours)) The change in worker/imap/open.go is to set the selected directory. This is required to access the UIDVALIDITY field, which is used in combination with the message ID to form the key for use in the cache db. The key structure is: "header.{UIDVALIDITY}.{UID}" Where reasonable, cache does not stop aerc from running. In general, if there is an error in the cache, aerc should continue working as usual. Errors are either displayed to the user or logged. All messages are stored without flags, and when retrieved have the flags set to SEEN. This is to prevent UI flashes. A new method to FetchMessageFlags is introduced to update flags of cached headers. This is done asynchronously, and the user will see their messages appear and then any flags updated. The message will initially show as SEEN, but will update to unread. I considered updating the cache with the last-known flag state, however it seems prudent to spare the R/W cycle and assume that - eventually - all messages will end up read, and if it isn't the update will occur rather quickly. Note that leveldb puts a lock on the database, preventing multiple instances of aerc from accessing the cache at the same time. Much of this work is based on previous efforts by Vladimír Magyar. Implements: https://todo.sr.ht/~rjarry/aerc/2 Thanks: Vladimír Magyar <vladimir@mgyar.me> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: inwit <inwit@sindominio.net> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* feat: add background mail polling option for all workersTim Culverhouse2022-05-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Check for new mail (recent, unseen, exists counts) with an external command, or for imap with the STATUS command, at start or on reconnection and every X time duration IMAP: The selected folder is skipped, per specification. Additional config options are included for including/excluding folders explicitly. Maildir/Notmuch: An external command will be run in the background to check for new mail. An optional timeout can be used with maildir/notmuch. Default is 10s New account options: check-mail check-mail-cmd (maildir/notmuch only) check-mail-timeout (maildir/notmuch only), default 10s check-mail-include (IMAP only) check-mail-exclude (IMAP only) If unset, or set less than or equal to 0, check-mail will be ignored Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: add timeout to tcp connect functionsKoni Marti2022-05-041-120/+10
| | | | | | | | | Extract the tcp connection details and timeout the tcp connect functions (net.ResolveTCPAddr and net.DialTCP). If timed out, ensure that the connection is properly closed. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: add debouncer to the idlerKoni Marti2022-05-041-0/+1
| | | | | | | | | | | | | Add a debouncer to the idle mode. Avoid unnecessary idling when another job arrives within a certain time frame. For example, the ui sends three messages to the worker at the same time when we open a message (FlagMessage, FetchMessageBodyPart, and the FetchMessageHeaders). The debouncer prevents the unnecessary entering and leaving of the idle mode between those messages. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: monitor the logout channel with an observerKoni Marti2022-05-041-86/+22
| | | | | | | | | Untangle the observer functionality from the message handling routine. Observe the imap client's logout channel and trigger a connection error when necessary to start the reconnect cycle. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: manage idle mode with an idlerKoni Marti2022-05-041-24/+30
| | | | | | | | | Untangle the idle functionality from the message handling routine. Wait for the idle mode to properly exit every time to ensure a consistent imap state. Timeout when hanging in idle mode and inform the ui. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: extract imap config and configure handlingKoni Marti2022-05-041-97/+24
| | | | | | | | Extract the imap config and move the configure part out of the message handler. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: fix out-of-range panic for imap updatesKoni Marti2022-04-291-0/+14
| | | | | | | | | | Check slice bounds before using it for the message and expunge updates. Log the error but ignore the affected updates. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCJEHBFFUI11T.1AYGOMVGZ87ZS%40rek2system%3E Reported-by: ReK2 <rek2@hispagatos.org> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: added a log on panicMoritz Poldrack2022-03-231-0/+3
| | | | | | | | | | | | | Since panics still regularly "destroy" the terminal, it is hard to get a stack trace for panics you do not anticipate. This commit adds a panic handler that automatically creates a logfile inside the current working directory. It has to be added to every goroutine that is started and will repair the terminal on a panic. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* go vet: composite literal uses unkeyed fieldsMoritz Poldrack2022-03-181-4/+4
| | | | | | | | This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: start reconnect when initial connect failsKoni Marti2022-02-201-3/+11
| | | | | | | Start the reconnect cycle when the initial connect fails. Make the connection observer send a connection error when the imap client is nil. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* imap: reconnect with exponential backoffKoni Marti2022-02-191-4/+28
| | | | | | | | | | | | | waits an increasing amount of time before attempting a reconnect. Wait is capped at 16s. Prevents many reconnect attemps in a short time period. Fixes commit 05ad96a30cb8 ("imap: improve reconnect stability") that improved the reliability of the reconnect mechanism but did not implement controls to prevent the triggering of too many reconnects within a short period of time. Fixes: 05ad96a30cb8 ("imap: improve reconnect stability") Signed-off-by: Koni Marti <koni.marti@gmail.com>
* imap: improve reconnect stabilityKoni Marti2022-02-061-7/+19
| | | | | | | | | | | | | | | | improves the robustness of the imap reconnect feature which was introduced in commit beae17a6da37 ("imap: auto-reconnects on connection error"). If a connection error is emitted, the message list is cleared and a corresponding error message is shown in the ui. Status bar is updated as well. Upon reconnect, the directories and the message list will be re-fetched (same behavior as the connect command). Reconnect can be enabled and disabled with the connect and the disconnect commands. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* imap: auto-reconnects on connection errorKoni Marti2022-01-191-2/+24
| | | | | | | | | if the worker emits a connection error, the ui will automatically send back a reconnect command. The worker then establishes a new connection. Auto-reconnect is disabled when the user sends the disconnect command. Fixes: https://todo.sr.ht/~rjarry/aerc/1 Signed-off-by: Koni Marti <koni.marti@gmail.com>
* imap: emits connection error on logoutKoni Marti2022-01-191-0/+29
| | | | | | | | implements a new connection error message. This allows the worker to emit a connection-related error message to the ui when the imap client closes the loggedOut channel. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* imap: fix panic when sending multiple connect cmdsKoni Marti2022-01-191-15/+26
| | | | | | | | | | | fixes the panic when the user sends multiple connect commands and is already connected. The panic is caused by closing an already closed channel. This happens when the idle re-init code is not executed, e.g. when there's a return statement in the switch block. A defer func() before the switch block will prevent this. The existing behavior of only creating a new idleStop channel when properly connected is preseverd. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* Revert "imap: attempt automatic reconnection on error"Robin Jarry2022-01-151-41/+3
| | | | | | | | | This reverts commit c605ada3ddc7569ebfc153b07db12a21b30d0569. This breaks reading message bodies. I am not sure why, I'll take some time to fix it later. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: attempt automatic reconnection on errorRobin Jarry2022-01-141-3/+41
| | | | | | | | | | | | | Attempt to reconnect to the server when there is an unexpected disconnection or network error. Use the Client.LoggedOut() channel which is closed when the connection is closed. This patch is rather flaky and is certainly bugged. However, it is a start. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: fix build on macosRobin Jarry2021-12-111-7/+2
| | | | | | | | | | | | Fix the following build error on mac os: worker/imap/worker.go:368:29: undefined: syscall.TCP_KEEPCNT worker/imap/worker.go:376:29: undefined: syscall.TCP_KEEPINTVL These symbols are not defined on darwin. Fixes: 5dfeff75f368 ("imap: add tcp connection options") Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: add tcp connection optionsRobin Jarry2021-12-071-0/+102
| | | | | | Allow fine tuning tcp connection options. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: use low level tcp connectionRobin Jarry2021-12-071-6/+22
| | | | | | | | | | In preparation for tcp keepalive options, we need access to the net.TCPConn object associated with an IMAP connection. The only way to do this is to create the connection ourselves. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: move connect procedure into a dedicated functionRobin Jarry2021-12-071-45/+55
| | | | | | | This will prepare for extra tcp connection options support and for automatic reconnect. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: fix segfault when disconnectingRobin Jarry2021-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | Do not set client = nil, it breaks almost all message handlers: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8c7e51] goroutine 25 [running]: git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).handleListDirectories worker/imap/list.go:32 git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).handleMessage worker/imap/worker.go:174 git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).Run worker/imap/worker.go:264 created by git.sr.ht/~rjarry/aerc/widgets.NewAccountView widgets/account.go:85 +0x518 Simply leave the disconnected client object, it already returns explicit error messages. Fixes: e41ed82cf3db ("imap: add manual {dis,}connect support") Signed-off-by: Robin Jarry <robin@jarry.cc>
* messages: allow displaying email threadsy0ast2021-11-131-2/+5
| | | | | | | | | | | | | Display threads in the message list. For now, only supported by the notmuch backend and on IMAP when the server supports the THREAD extension. Setting threading-enable=true is global and will cause the message list to be empty with maildir:// accounts. Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu> Co-authored-by: Reto Brunner <reto@labrat.space> Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: add manual {dis,}connect supportRobin Jarry2021-11-051-2/+14
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* go.mod: change base git urlRobin Jarry2021-11-051-4/+4
| | | | | | | 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>
* imap: use builtin idle supportRobin Jarry2021-11-021-4/+2
| | | | | | | 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>
* imap: add sort supportReto Brunner2020-10-111-1/+3
|