Commit graph

954 commits

Author SHA1 Message Date
Reto Brunner
6654c970e6 notmuch: close tag object 2020-09-24 21:24:44 +02:00
y0ast
42ce6b41ff propagate error from sendmail 2020-09-22 08:12:38 +02:00
Reto Brunner
8bf100f7b4 reply: don't override the answered flag if we didn't send
Aerc just sent the true / false update regardless, meaning if someone already
replied to a mail, then drafted yet another mail to the same parent the flag
would vanish. This commit fixes this behaviour.
2020-09-21 20:43:22 +02:00
Josh Holland
4f40eecef8 doc: fix typo in aerc man page 2020-09-17 22:11:29 +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
Seán C McCord
72d81ba603 doc: add oauth to aerc-smtp
Signed-off-by: Seán C McCord <ulexus@gmail.com>
2020-09-14 07:14:16 +02:00
Reto Brunner
9d80141408 Remove unused Simulator interface 2020-09-10 07:50:30 +02:00
Reto Brunner
504417b670 fix comment in ParseAddressList
Go pre 1.15 parsed an empty string as an error, 1.15 did not but this was
unintentional as per https://github.com/golang/go/issues/40803

Fix the comment accordingly
2020-09-10 07:35:56 +02:00
Reto Brunner
fe42beb3e4 dirlist: fix empty row if dir is added
There is a window where a new dir entry isn't yet in the dirlist.dir.
dirlist.ensureScroll however expected to always find a valid index.
Add a check so that we don't try to scroll to a -1 index.
2020-09-08 07:48:55 +02:00
y0ast
6ddd347b06 Make mimetype check consistent across cases 2020-09-07 07:27:15 +02:00
y0ast
f09e3966a7 correctly apply msglist_read color 2020-09-01 19:09:27 +02:00
Jeff Martin
0acb28645f handle message unknown charset error
This change handles message parse errors by printing the error when the
user tries to view the message. Specifically only handling unknown
charset errors in this patch, but there are many types of invalid
messages that can be handled in this way.

aerc currently leaves certain messages in the msglist in the pending
(spinner) state, and I'm unable to view or modify the message. aerc also
only prints parse errors with message when they are initially loaded.
This UX is a little better, because you can still see the header info
about the message, and if you try to view it, you will see the specific
error.
2020-08-31 22:00:28 +02:00
Reto Brunner
43c4f2f3ab update go-message 2020-08-31 21:48:07 +02:00
James Pond
dc0167b953 Fix color scheme for deleted emails
The color scheme for deleted emails should now match the old design,
making it easier to see when a message is deleted.

Signed-off-by: James Pond <james@cipher.host>
2020-08-31 09:06:13 +02:00
sqwishy
f6bc73c63a correct tcell.Style for underline 2020-08-29 10:52:38 +02:00
Reto Brunner
254b5ab517 docs: link to styleset(7) 2020-08-28 17:56:39 +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
720733bc6e reply: use set instead of linear search 2020-08-27 08:38:41 +02:00
Reto Brunner
b6ef116c36 ParseAddressList: return empty list if "" is provided
Go 1.15 handles "" in the address parser as a non error case, returning
an empty list.
Prior versions returned an error, which is not what we want.

Reported-by: anianz <a.ziegler@cioplenu.de>
Tested-by: anianz <a.ziegler@cioplenu.de>
2020-08-24 23:28:18 +02:00
Reto Brunner
eb1439c241 Localize timestamps in the message list
Not sure we need a flag for it, most people expect times to be in their local
time anyhow.
2020-08-22 10:32:02 +02:00
Reto Brunner
186d61f21c msg/reply: don't cc the sending address on reply all 2020-08-20 21:54:33 +02:00
y0ast
6a1c0f60af Add account alias configuration and correctly set From field
We infer the correct From using the To: and Cc: field of the email that
we reply to.
2020-08-20 21:54:31 +02:00
Reto Brunner
2a186cfd71 msg/reply: handle addresses as addresses
This simplifies the code considerably and makes it easier to follow
2020-08-20 21:53:45 +02:00
Reto Brunner
c846307144 base models.Address on the mail.Address type
This allows us to hook into the std libs implementation of parsing related stuff.
For this, we need to get rid of the distinction between a mailbox and a host
to just a single "address" field.

However this is already the common case. All but one users immediately
concatenated the mbox/domain to a single address.

So this in effects makes it simpler for most cases and we simply do the
transformation in the special case.
2020-08-20 19:18:57 +02:00
ARaspiK
fe1cabb077 Add support for :rmdir
The `:rmdir` command removes the current directory (`-f` is required if
the directory is not empty).

This is not supported on the notmuch backend.

An issue with the maildir backend is that some sync programs (e.g.
offlineimap) may recover the directory after it is deleted.  They need
to specifically be configured to accept deletions, or special commands
need to be executed (e.g. `offlineimap --delete-folder`) to properly
delete folders.

A danger of using this on the IMAP backend is that it is possible for a
new message to be added to the directory and for aerc to not show it
immediately (due to a slow connection) - using `:rmdir` at this moment
(with `-f` if the directory already contains messages) would delete the
directory and the new message that just arrived (and all other
contents).  This is documented in aerc(1) so that users are aware of
possible risks.
2020-08-19 11:38:57 +02:00
R Chowdhury
f4dc7e1f74 Add oauthbearer support for SMTP
This piggybacks on the existing IMAP support, and uses the same
configuration format (my local testing example has the IMAP and SMTP
lines almost copy-pasted from one another).

It's a little clumsy in that a new token is negotiated for every
`Send()` command, but it's a start...
2020-08-13 07:44:43 +02:00
Reto Brunner
f1a0fd20d6 improve date parsing for notmuch/maildir
If a message date would fail to parse, the worker would never receive
the MessageInfo it asked for, and so it wouldn't display the message.

The problem is the spec for date formats is too lax, so trying to ensure
we can parse every weird date format out there is not a strategy we want
to pursue. On the other hand, preventing the user from reading and
working with a message due to the error format is also not a solution.

The maildir and notmuch workers will now fallback to the internal date, which
is based on the received header if we can't parse the format of the Date header.

The UI will also fallback to the received header whenever the date header can't
be parsed.

This patch is based on the work done by Lyudmil Angelov <lyudmilangelov@gmail.com>
But tries to handle a parsing error a bit more gracefully instead of just returning
the zero date.
2020-08-10 08:00:52 +02:00
Reto Brunner
2d7a870725 show error if account view creation fails
This can happen for example if aerc is compiled without notmuch support but the
notmuch worker is requested.
Pushing a status message isn't good enough, as this gets overridden pretty
quickly if one has multiple accounts configured.
So we show a fullscreen error instead.
2020-08-10 08:00:34 +02:00
Reto Brunner
c3c982c3ec notmuch: docs 2020-08-08 12:34:34 +02:00
Thorben Günther
9f89fe1108 aerc-stylesets: properly indent examples 2020-08-07 18:10:48 +02:00
Thorben Günther
bf5f02a9e7 stylesets: only accept comment char after whitespace
Without the option SpaceBeforeInlineComment set, go-ini will parse just
a single "
This lead to people being unable to specify hex color codes
2020-08-07 18:05:39 +02:00
Reto Brunner
7a9fe3824f notmuch: manually close notmuch objects
There seems to be some race with the automatic closing that should happen
in theory... close it manually where we can to avoid the issue
2020-08-07 09:49:57 +02:00
Kalyan Sriram
1023dd9588 Rename selecter to selector 2020-08-06 21:42:06 +02:00
Kalyan Sriram
905cb9dfd3 Implement style configuration.
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
2020-08-06 21:42:06 +02:00
Nicolai Dagestad
548a5fff68 Set environment variables for the exec command 2020-08-03 06:30:28 +02:00
Reto Brunner
3d784c5d8c Revert "Implement style configuration."
This reverts commit 1ff687ca2b.
2020-07-30 23:22:32 +02:00
Reto Brunner
6ee7b1c3fd Revert "Rename selecter to selector"
This reverts commit 2c244222d5.
2020-07-30 23:22:16 +02:00
Kalyan Sriram
2c244222d5 Rename selecter to selector 2020-07-30 19:35:59 +02:00
Kalyan Sriram
1ff687ca2b Implement style configuration.
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
2020-07-30 19:35:59 +02:00
Reto Brunner
1bab1754f0 msgviewer: set max line length to 1 GB
some people send around huge html without any newline in between.
This did overflow the default 64KB buffer of bufio.Scanner.
If something can't fit in a GB there's no hope left

Also, ignoring errors is bad mkey
2020-07-30 19:35:59 +02:00
Reto Brunner
01885e2448 msgviewer: simplify attemptCopy
No functional changes, simply extract more complex stuff into
sub functions to help readability.
2020-07-30 19:35:59 +02:00
Drew DeVault
bc9d6fc187 Update .build.yml 2020-07-29 15:27:51 -04:00
Tero Koskinen
f81cc2803c maildir: Provide nicer error message on invalid url
If accounts.conf contains an invalid maildir url, return a nice
error instead of panicking.

Log a couple of different error cases to provide extra
information about the error to the user.
2020-07-27 18:26:57 +02:00
Reto Brunner
c574a838fa Remove hard coded bodystruct path everywhere
Aerc usually used the path []int{1} if it didn't know what the proper path is.
However this only works for multipart messages and breaks if it isn't one.

This patch removes all the hard coding and extracts the necessary helpers to lib.
2020-07-27 09:19:27 +02:00
Tobias Wölfel
494bd674a9 Add flag based search options
Provide search and filter with the option to specify more flag based
conditions.
Use '-x <flag>' to search for messages with a flag (seen, answered,
flagged) and '-X <flag>' to search for messages without a flag.
2020-07-25 08:08:08 +02:00
Andrew Jeffery
126c9437e8 Only send directory info once from maildir
The directory info only needs to be sent once for all the messages, this
reduces unnecessary messages being sent which could lock up the ui.
2020-07-19 11:16:05 +02:00
Tobias Wölfel
825996572f Document mailto argument usage 2020-07-19 11:15:56 +02:00
Reto Brunner
8446d48664 run go fmt 2020-07-17 17:50:24 +02:00
Lyudmil Angelov
cc44027545 Make it easier to debug date parsing errors
When message dates failed to parse, the error displayed would try to
include the time object it failed to obtain, which would display as
something like 0001-01-01 00:00:00 UTC, which isn't of much help.

Instead, display the text we were trying to parse into a date, which
makes the problem easier to debug.
2020-07-11 13:51:32 +02:00