aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* template: pass account and folder names to signature commandTristan Partin2024-08-201-0/+4
| | | | | | | | | This can help to dynamically determine what signature you want. Changelog-added: `AERC_ACCOUNT` and `AERC_FOLDER` are now available in the signature command environment. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: fix emailKey function nameTristan Partin2024-08-201-4/+4
| | | | | | | This was just a simple typo. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* send: redact password in outgoing URI for loggingKoni Marti2024-08-201-1/+1
| | | | | | | | | | Redact the password in the outgoing URI for logging. This will replace the password by "xxxxx" and prevent a plaintext password leak in the logs. Signed-off-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: reload all changed messages on DB changeJason Cox2024-08-202-23/+41
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit c56649fe5291b725f14b45550a68cc7d0dc16ff7. As discussed in the aerc-devel thread for the reverted patch, the performance improvement comes with an issue: changes to message tags are no longer immediately reflected in the UI. This issue occurs whether the tags are modified from within aerc or externally with the notmuch CLI. The message list also flickers any time tag changes are made. Further, commit c36ed72e4a59 ("notmuch: speed up lastmod query") dramatically reduces the number of messages which are re-indexed when the database changes, likely eliminating the need for the reverted performance improvement anyway. Fixes: c56649fe5291 ("notmuch: don't reload all message on change") Link: https://lists.sr.ht/~rjarry/aerc-devel/patches/53729 Link: https://lists.sr.ht/~rjarry/aerc-devel/patches/54028 Reported-by: Robin Dapp <rdapp@modk.org> Reported-by: Ryan Winograd <ryan@thewinograds.com> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* view-message: add option to view message in background tabAron Lebani2024-08-045-31/+52
| | | | | | | | | | | | | | | Add a -b flag to the :view command to open messages in a background tab instead of automatically switching to the new tab after opening. This is similar to opening browser tabs in the background. More generally, adds a new function app.NewBackgroundTab so that it is possible to enable other tabs to be opened in the background in the future. Implements: https://todo.sr.ht/~rjarry/aerc/266 Changelog-added: Add `-b` flag to the `:view` command to open messages in a background tab. Signed-off-by: Aron Lebani <aron@lebani.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* search,filter: add flag to use custom extensionsKoni Marti2024-08-043-7/+49
| | | | | | | | | | | | | | | | | | Add an extension flag to the search/filter command which will provide different completion strategies for the search terms and instruct the backend to use custom extensions (such as X-GM-EXT-1) if available. The following examples are based on the Gmail extension (note that this should be enabled in your accounts.conf with 'use-gmail-ext=true'): :filter -e filename:pdf from:bob :filter -e has:attachment newer_than:2d :search -e is:read is:starred :search -e list:~rjarry/aerc-devel@lists.sr.ht Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: expose extension in capabilitiesKoni Marti2024-08-042-2/+14
| | | | | | | | Expose the supported extensions in the capabilities. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: extend SEARCH with X-GM-RAW for full Gmail search syntaxKoni Marti2024-08-045-10/+193
| | | | | | | | | | | | | Extend the IMAP SEARCH command with the X-GM-RAW attribute for full Gmail search syntax. It is based on the Gmail extension (X-GM-EXT-1). The search/filter command will be interpreted in the same manner as in the Gmail web interface. Link: https://support.google.com/mail/answer/7190?hl=en Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* hooks: add logging for STDOUT and STDERRBence Ferdinandy2024-08-041-1/+10
| | | | | | | | | | Currently the only feedback we have from hooks is the error code. Log STDOUT on loglevel TRACE and log STDERR on loglevel ERROR if the command exists with an error. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* calendar: hide empty attendee listTimon Reinold2024-08-042-24/+30
| | | | | | | | | | | | | | Include the ATTENDEE and DETAILED LIST section in the calendar filter's output only if there are actually attendees to list. I was especially confused by the empty DETAILED LIST, as it wasn't clear which kind of detail it was supposed to list (and it also looked a bit like a heading for the description following immediately below), see e.g. the test output in filters/vectors/calendar-invite.expected. Fixes: 777bbb77e806 ("contrib: improve readability of meeting requests") Changelog-fixed: Builtin `calendar` filter shows empty attendee list. Signed-off-by: Timon Reinold <tirei+aerc@agon.one> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: test calendar filter also with POSIX-AwkTimon Reinold2024-08-041-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The builtin "calendar" filter is written in the Awk language, for which multiple interpreters exist. The most common is probably GNU Awk (aka "gawk"), which also implements some features that other interpreters do not support. That means that the calendar filter could run fine in gawk, but fail in another interpreter (compare e.g. commit a604acceac0f "calendar: fix error with non-gnu awk"). Using the "-W posix" option, gawk can be put into a POSIX-compatibility mode, which attempts to stay as close as possible to the POSIX-specified version of Awk, which should then hopefully also be supported by other Awk interpreters. Running the filter's tests using "gawk -W posix" should help identify potential incompatibilities with other interpreters. Other interpreters also support "-W posix" (e.g. mawk, or ignore it like busybox awk). Using "awk -W posix" allows these to be used as well. If "-W posix" causes the interpreter to fail, skip this test. This new test in POSIX-compatibility mode runs in addition the existing test, which directly executes the filter, using the Awk interpreter's default mode ("-W posix" cannot just be added to the filter's shebang line, as only a single argument may be supported, and "-f" is also needed). The later is the mode most users will actually be using, so I don't want to remove that test. I'm not doing this for the other Awk-filters (hldiff and plaintext), as they have ben obsoleted by the colorize filter. Besides, they don't have any test vectors. Signed-off-by: Timon Reinold <tirei+aerc@agon.one> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: add calendar test vectorTimon Reinold2024-08-044-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a test vector for the builtin "calendar" filter. Use the filter's current output as expected output. My aim is mostly just to run the calendar filter during "make tests", this vector doesn't necessarily cover the most interesting sections of its code. But at least running the filter once on what could be a common input (a meeting PUBLISH) and checking that its output matches what was expected should still be better than testing nothing. Previously, only compiled filters were tested. Testing the calendar filter (which is interpreted, not compiled) necessitated two changes: * Compilation output goes into the project root (filters/test.sh: "$here/../"), but the source code to interpret is in the filters/ subdirectory (filters/test.sh: "$here"/). The executable to invoke is thus in a different location. * .builds/alpine-edge.yml uses $FILTERS_TEST_PREFIX to wrap filters in valgrind, to check that filters written in e.g C don't leak memory. But for the calendar filter, that would check that the Awk interpreter doesn't leak memory, failing the test for at least gawk, mawk and busybox awk. Thus, a $FILTERS_TEST_BIN_PREFIX variable is introduced, which only applies to binary filters. Signed-off-by: Timon Reinold <tirei+aerc@agon.one> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: print "error" if filter failedTimon Reinold2024-08-041-5/+4
| | | | | | | | | Print "error" instead of "ok" also if the filter (or the $FILTERS_TEST_PREFIX, i.e. valgrind) failed, not just if its output is unexpected. Also include that exist status in the error message. Signed-off-by: Timon Reinold <tirei+aerc@agon.one> Acked-by: Robin Jarry <robin@jarry.cc>
* reply: allow copying to current folderRobin Jarry2024-08-0313-21/+71
| | | | | | | | | Add a new copy-to-replied setting in accounts.conf to copy sent replies to the same folder than their replied message. Requested-by: Tristan Partin <tristan@partin.io> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tristan Partin <tristan@partin.io>
* jmap: fetch entire threadsTristan Partin2024-08-034-36/+141
| | | | | | | | | | Fetch an email's entire thread in the JMAP backend. Changelog-added: Fetch entire threads in the JMAP backend. Signed-off-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: only send Done event if deletion succeedsHugo Osvaldo Barrera2024-08-031-1/+1
| | | | | | | | | | | | | | A Done event was sent from the worker to the UI unconditionally, so even if the deletion operation failed, the UI showed a "N messages deleted" confirmation. When no messages are deleted, don't send the done event. Given that the same function already sends an error in case of any failures, this error is what remains visible in the status bar. Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* acct: indicate connection state in tab titleKoni Marti2024-08-031-0/+1
| | | | | | | | | | | | | | | | Indicate the connection state in the tab title. Example [ui].tab-title-account option in aerc.conf: tab-title-account= {{if .Connected}}{{.Account}}✓{{else}}{{.Account}}✗{{end}} Suggested-by: inwit <inwit@sindominio.net> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Gregory Anders <greg@gpanders.com> Tested-by: Inwit <inwit@sindominio.net> Reviewed-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: remove redundant queryHugo Osvaldo Barrera2024-08-031-9/+8
| | | | | | | | | | | | | | This function first queried the notmuch database for a single filename (arbitrarily chosen), and then queried the database for all filenames of the same message. Drop one unnecessary query; only query all names, and then use the first one as an arbitrarily chosen one. Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: speed up lastmod query.Robin Dapp2024-08-031-1/+1
| | | | | | | | | | | | | | When changing the tag/label of a message we refresh all messages that were modified since the start of the transaction. To that end we add "lastmod before..now" to the current query without any conjunction. That would make us re-index basically all messages. This patch wraps the existing query in parentheses and ANDs it with "lastmod" instead which greatly speeds up the process. Signed-off-by: Robin Dapp <rdapp@modk.org> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: improve logging for watcherHugo Osvaldo Barrera2024-08-031-1/+2
| | | | | | | | | | | | | When an error occurs initialising a watcher, the error shown is completely unclear (e.g.: "no such file or directory"). Clarify the error so that its source is clear and log the path that was used. Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: don't reload all message on changeHugo Osvaldo Barrera2024-08-032-41/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | When a notmuch query result was shown and any message changes (e.g.: was marked as read, deleted, flagged, etc) the entire result set was reloaded from disk. This included querying the notmuch for paths for each file individually and then reading headers from each file one by one. If the current view was a query-map with 4000 results, then marking a single message as read resulted in 4000 files being read from disk. When a change is detected in the database, instead of sending an individual MessageInfo event for each message in the result set, send a single DirectoryContents event. The UI code will remove from view any messages that no longer exist, add new ones and request from the worker any data that may be required (this data will be lazy-fetched). This results in a dramatic performance improvement when reading messages from a query-map result. Previously reading a single message would result in about 2 minutes of CPU at 150% (on a i7-13700K). With this patch, the same operation uses less than 5% CPU for less than 2 seconds. Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* reply: handle the Sender headerBence Ferdinandy2024-08-033-3/+14
| | | | | | | | | | | | | | | | | | | | | | Sometimes emails will have a Sender: header, that is different from the From: header. The only use of this in the wild I have seen to date is when meeting invitation is forwarded by somebody. The From: header will be the person organising the meeting, and the Sender: will be the person forwarding. Naturally, when one replies (e.g. with on accept), it should go to the meeting oragniser, but sometimes one would want to include the Sender in such a reply. When executing :reply determine the To: address in order of Reply-To:, From:, Sender:. When executing :reply -a, include the Sender: in Cc:. Implements: https://todo.sr.ht/~rjarry/aerc/259 Link: https://www.rfc-editor.org/rfc/rfc4021#section-2.1.3 Changelog-added: Replying to all will include the Sender in Cc. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Reviewed-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: add {{.AccountFrom}} templateBence Ferdinandy2024-08-034-0/+16
| | | | | | | | | | Add template variable to access the current account's From address. Implements: https://todo.sr.ht/~rjarry/aerc/150 Changelog-added: New `{{.AccountFrom}}` template variable. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: add head and tail functionsBence Ferdinandy2024-08-033-0/+68
| | | | | | | | | | | | | | | Add head and tail functions to get beginning or ends of strings. E.g.: {{"hello" | head 2}} will return "he" {{"hello" | tail 2}} will return "lo" Implements: https://todo.sr.ht/~rjarry/aerc/220 Changelog-added: New `head` and `tail` templates functions for strings. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: add :redraw commandTim Culverhouse2024-08-033-1/+38
| | | | | | | | | | | Add a :redraw command to force a repaint of the entire screen. Changelog-added: New `:redraw` command to force a repaint of the screen. Requested-by: Remko Tronçon <r@mko.re> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: fix typo in man pageMatt Smith2024-08-031-1/+1
| | | | | | | | | Fix small typo within docs. Signed-off-by: Matt Smith <matt@xtaz.co.uk> Reviewed-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* Release version 0.18.20.18.2Robin Jarry2024-07-302-1/+10
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* deps: update vaxis to v0.10.3Tim Culverhouse2024-07-292-3/+3
| | | | | | | | | | | | | | | | | | | Vaxis v0.10.3 brings with it a few bug fixes, major sixel performance improvements, and a new VT extension which enables Vaxis to receive window resize updates in-band via escape sequences on supported terminals (foot, ghostty, iTerm2, and kitty as of this patch). - Improved performance all around for sixels (thanks, delthas) - Fix key decoding for Home and End for the st terminal - Implement mode 2048 for in-band resizes - Add quirk for tmux 3.4 to turn on unicode width measurements - Fix dropping of events during large pastes Changelog-fixed: Detection of unicode width measurements on tmux 3.4. Changelog-fixed: Dropping of events during large pastes. Changelog-fixed: Home and End key decoding for the st terminal. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* colorize: allow pipe '|' as uri characterRobin Jarry2024-07-291-1/+1
| | | | | | | | | | | | | | | Some HTML emails contain weird URLs that contain unescaped pipes '|'. For example: https://foo.baz.fr/?data=05|02|foo@bar.fr|1|0|Unknown|=|0|||&reserved=0 Sadly, this does not seem standard but there's probably not much we can do about it. Let's adapt colorize to also consider '|' as a valid URI character. Reported-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* jmap: fix typo in man pageAiden Fox Ivey2024-07-171-1/+1
| | | | | | | Fix small typo within docs. Signed-off-by: Aiden Fox Ivey <aiden@aidenfoxivey.com> Acked-by: Robin Jarry <robin@jarry.cc>
* calendar: fix error with non-gnu awkTimon Reinold2024-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the POSIX-specified function Awk keyword instead of the non-standard func to define the prepare function in the text/calendar filter. The GNU Awk manual[1] mentions that gawk supports abbreviating function to func, but recommends against using the func abbreviation, as POSIX only specifies function. On my system (Debian sid), gawk isn't installed and mawk (Debian priority "required", i.e. installed by default) provides /usr/bin/awk instead. mawk appears to not support the abbreviated func keyword. When viewing a text/calendar part, I only see the following: awk: /usr/libexec/aerc/filters/calendar: line 211: return outside function body Using the standardized function keyword allows mawk to parse the prepare function (including its return) and execute the script as intended. [1]: https://www.gnu.org/software/gawk/manual/html_node/Definition-Syntax.html (section 9.2.1 "Function Definition Syntax") Fixes: 0db924dc14a3 ("filters: fix calendar filter parsing") Changelog-fixed: Builtin `calendar` filter error with non-GNU Awk. Signed-off-by: Timon Reinold <tirei+aerc@agon.one> Acked-by: Robin Jarry <robin@jarry.cc>
* depends-diff: only print changes if anyRobin Jarry2024-07-151-13/+16
| | | | | | | Only print the New, Updated and Removed sections if they contain changes. If there are no dependency changes, only print "none". Signed-off-by: Robin Jarry <robin@jarry.cc>
* Release version 0.18.10.18.1Robin Jarry2024-07-152-1/+11
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* smtp: take smtp-domain into account for tls connectionsRobin Jarry2024-07-151-2/+9
| | | | | | | | | | | | | smtp-domain is ignored when using smtps:// transport. It is only configured for clear text and STARTTLS connections. Also use it for TLS encrypted connections. Fixes: c10cb370bb94 ("config: add option for SMTP HELO/EHLO local domain") Changelog-fixed: `smtp-domain` is now properly taken into account for TLS connections. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io>
* smtp: fix error when setting smtp-domain with starttlsRobin Jarry2024-07-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | Some MTA servers require clients to specify their fully qualified hostname in the HELO command. By default, go-smtp uses "localhost". SMTP error 504: <localhost>: Helo command rejected: need fully qualified hostname In go-smtp v0.21.0, there is a regression preventing manually issuing a HELO command after starttls authentication: Connection failed: Hello: smtp: Hello called after other methods The regression was fixed in go-smtp v0.21.3. Update our dependency. Fixes: 7c789624d7da ("mod: update all dependencies") Changelog-fixed: Error when trying to configure `smtp-domain` with STARTTLS enabled. Reported-by: Stefano <foxy@teapot.ovh> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io>
* rfc822: make header parsing less pedanticRobin Jarry2024-07-152-66/+45
| | | | | | | | | | | | | When receiving invalid headers, just log the errors and move on with our life. When failing to decode addresses, do whatever is possible to at least make the message readable. Changelog-fixed: Aerc is now less pedantic about invalid headers for the maildir and notmuch backends. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Vitaly Ovchinnikov <v@ovch.ru> Tested-by: inwit <inwit@sindominio.net>
* log: create directories if necessaryJens Grassel2024-07-151-0/+5
| | | | | | | | | | | | | | If a log file is configured via `log-file` and the parent directory does not exist then aerc exits with an error message on startup. Check if the directory for the log file exists and create it if necessary using sensible permissions (0700). Errors occurring while creating the directory structure are returned and printed out. Changelog-fixed: Startup error if `log-file` directory does not exist. Signed-off-by: Jens Grassel <jens@wegtam.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* Release version 0.18.00.18.0Robin Jarry2024-07-022-1/+88
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* ui: make textinput grapheme awareTim Culverhouse2024-07-022-22/+37
| | | | | | | | | | | | | | | | | The textinput widget operated on a slice of runes, and naively assumed a rune was a "character". When deleting or navigating the cursor through text which contains multi-codepoint characters (such as emoji), the cursor index could desync and cause panics. Use a slice of vaxis.Characters instead of runes to more accurately reflect the index state of the cursor with respect to characters. Fixes: https://todo.sr.ht/~rjarry/aerc/263 Reported-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mk: handle stale files when scdoc failsBrandon Maier2024-07-021-0/+2
| | | | | | | | | | | | | | | If scdoc fails for any reason, for example because a user hasn't installed it yet, the `> $$@` redirection will still create an empty destination file. On re-runs gmake will see the empty file and assume the target has already completed. This led to installing a blank man page. Use the GNU Make '.DELETE_ON_ERROR' special target which automatically deletes the target if a recipe fails. Link: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html#index-removing-targets-on-failure Signed-off-by: Brandon Maier <brandon.maier@collins.com> Acked-by: Robin Jarry <robin@jarry.cc>
* rfc822: be liberal with invalid address headersRobin Jarry2024-07-022-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | Some email clients format email addresses with quotes around B encoded names. E.g.: "=?utf-8?B?U21pZXRhbnNraSwgV29qY2llY2ggVGFkZXVzeiBpbiBUZWFtcw==?=" This seems non standard. I tried reading the multiple RFCs that describe the MIME headers encoding but could not find any precise answer to determine if adding quotes around encoded words is valid or not. In any case, ParseAddressList completely ignores any encoding when it encounters a double quote. When that happens, try to detect it and force decoding a second time after the quotes have been removed. Link: https://datatracker.ietf.org/doc/html/rfc2045#section-3 Link: https://datatracker.ietf.org/doc/html/rfc2047#section-2 Link: https://datatracker.ietf.org/doc/html/rfc822#section-3.3 Reported-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: wait random delay before un-flipping tablesRobin Jarry2024-07-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unflipping tables instantly is not very considerate and certainly does not have the same emotional impact compared to waiting for a moment to digest the table flipping. Wait for a random period of time using a log normal distribution: | # | # # | # # | # # | # # | # # # | # # # # | # # # # | # # # # # | # # # # # # | # # # # # # # | # # # # # # # # | # # # # # # # # # # # # | # # # # # # # # # # # # # # # # . . . +----------------------------------------------------- 0 1 2 3 4 5 6 7 8 delay(seconds) Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* jmap: do not keep invalid sessions in cacheRobin Jarry2024-07-028-58/+59
| | | | | | | | | | | If a session is found in the cache, check that it works by issuing a GetIdentities request. If that request fails, invalidate the cache and go through the authentication. Ensure that the session is valid and explicitly fail if it is not. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* imap: report errors from serverRobin Jarry2024-07-013-24/+50
| | | | | | | | | | | | Avoid eternal spinner on the message list when the imap server advertises some message UIDs but fails to provide their headers when aerc asks from them. When an error occurs, or if some UIDs are not returned, make sure to report the errors to the message list UI. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io>
* rfc822: properly parse address listsRobin Jarry2024-06-291-10/+7
| | | | | | | | | | | | | | | | h.Text() parses blobs of encoded text without taking into account specific handling for email addresses. h.AddressList(key) uses mail.ParseAddressList(h.Get(key)) already deals with charsets and quoted-printable stuff. Pass it the raw header value. In some cases, mail.ParseAddressList will return a list of addresses *and* an UnknownCharset error. In this specific case, ignore the error. Fixes: https://todo.sr.ht/~rjarry/aerc/257 Reported-by: Inwit <inwit@sindominio.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net> Reviewed-by: Tristan Partin <tristan@partin.io>
* jmap: revert fetch threads supportRobin Jarry2024-06-295-227/+32
| | | | | | | | | | | | | | This reverts commits: 9e93d9efdb88 ("jmap: fix go static check failure") 0465509eedad ("jmap: skip Email/get call if no emails to get") 9f97c698e3dd ("jmap: fetch entire threads") Issues have been reported about disappearing sent messages. Reported-by: Tristan Partin <tristan@partin.io> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tristan Partin <tristan@partin.io>
* ircbot: implement table unflippingRobin Jarry2024-06-281-0/+6
| | | | | | | | Some IRC users have a tendency to flip tables when they are upset. Improve our bot to put furniture back where it belongs. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: improve karma pluginRobin Jarry2024-06-281-14/+23
| | | | | | | Handle NICK++ and NICK-- in the middle of sentences. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: import upstream karma pluginRobin Jarry2024-06-283-0/+578
| | | | | | | | | Just a copy of the upstream code verbatim. I'll patch the plugin in the next commits. Link: https://github.com/progval/Limnoria/tree/a6aa553/plugins/Karma Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: use tabs for nginx configRobin Jarry2024-06-281-25/+25
| | | | | | | Who indents nginx config files with 8 spaces? Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>