| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, names of recipients in From, To, Cc and Bcc headers are
(almost) always wrapped in quotes. Even if they are pure ASCII and
contain one upper case letter. E.g.:
From: "Foo" <foo@baz.org>
There is no valid reason to add these quotes unless the name contains
special characters as specified by RFC 5322, section 3.2.3:
specials = "(" / ")" / ; Special characters that do
"<" / ">" / ; not appear in atext
"[" / "]" /
":" / ";" /
"@" / "\" /
"," / "." /
DQUOTE
Adapt the check accordingly.
Link: https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.3
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
|
| |
Remove unused TruncateHead function.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
This function is not used anywhere. Remove it.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
| |
Now that this is not used anywhere, remove it.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since previous commit, all commands now support expanding text/template
markup. Reuse that for the new-email trigger command.
Update commands.ExecuteCommand to take optional *AccountConfig and
*MessageInfo arguments. If these are nil, fallback to using the
currently selected account and message (if any).
Pass the proper *AccountConfig and *MessageInfo objects when firing the
trigger command so that these are used instead of the currently selected
ones.
If new-email contains % placeholders, try to convert them to template
markup reusing the same conversion added in commit 535300cfdbfc
("config: add columns based index format"). Warn the user that they need
to update their configuration file.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
| |
The runewidth module only allows truncating at the end of strings. Add
a function to truncate at the beginning. It will be used for the table
widget in the next commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
| |
Using a list of integers is not optimal. Use a bit mask instead.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
| |
Add indicator of an attachment to the flags and make the character used
to be configurable.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Jens Grassel <jens@wegtam.com>
|
|
|
|
|
|
|
|
|
|
| |
The ThisDayTimeFormat and friends are missing from the message view
which just uses the message list's default setting. This might not be
desirable since the amount of space available is different. Introduce
separate settings for formatting dates in the message view.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When errors occur during a fetch header request, the requested headers
are deleted from pending and no information is given to the UI. Spinners
keep spinning, and ultimately as the view is refreshed, the headers are
fetched again. This can lead to infinite loops, and extremely long logs.
Update the store with a MessageInfo message when an error is received.
Have the UI display that the header couldn't be fetched in the message
list.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply GoDoc comment policy (comments for humans should have a space
after the //; machine-readable comments shouldn't)
Use strings.ReplaceAll instead of strings.Replace when appropriate
Remove if/else chains by replacing them with switches
Use short assignment/increment notation
Replace single case switches with if statements
Combine else and if when appropriate
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Run `make fmt`.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a workaround for https://todo.sr.ht/~rjarry/aerc/22, by
injecting zero-width spaces in front of wide characters to make up width
calculation in fmt.Sprintf.
With this applied, columns will still be misaligned a little only if
they are left with trailing zero-width spaces when cut. It is better
than a large offset caused by each wide characters in the column.
References: https://todo.sr.ht/~rjarry/aerc/22
Signed-off-by: Pinghao Wu <xdavidwuph@gmail.com>
Acked-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add the format specifier %N to the dirlist-format to display compacted
folder names.
A folder such as INBOX/WORK/PROJECT will be compacted to I/W/PROJECT in
the directoy list.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Also allow specific time format for messages received within the last
7 days.
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With IMAP, due to an unidentified reason, some messages to not have any
body accessible. When viewing them, aerc crashes:
git.sr.ht/~sircmpwn/aerc/lib.usePGP
lib/messageview.go:37
git.sr.ht/~sircmpwn/aerc/lib.NewMessageStoreView
lib/messageview.go:67
git.sr.ht/~sircmpwn/aerc/commands/account.ViewMessage.Execute
commands/account/view.go:45
git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand
commands/commands.go:66
main.execCommand
aerc.go:61
main.main.func2
aerc.go:160
aerc crashed: runtime error: invalid memory address or nil pointer
dereference
Check the pointer before dereferencing.
Also, add a global check in ParseMessageFormat where a similar issue may
occur.
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a message has been sent today (or this year) allow formatting the
date differently.
For example, with:
[ui]
index-format=%-25.25n %-25.25D %s
timestamp-format=2006 Jan 02, 15:04 GMT-0700
this-day-time-format=Today at 15:04
this-year-time-format=Jan 02
The message list would look like this (spaces collapsed):
Robin Jarry Today at 16:30 [PATCH 1/2] bindings: prepare for more modifers
bugzilla@dpdk.org Oct 26 [dpdk-dev] [Bug 839] pdump: any subsequent runs of pdump_autotest fail
Holger Levsen 2020 Mar 15, 13:44 GMT+01 +1 (Re: FTP Team -- call for volunteers)
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
We made a new type out of go-message/mail.Address without any real reason.
This suddenly made it necessary to convert from one to the other without actually
having any benefit whatsoever.
This commit gets rid of the additional type
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Not sure we need a flag for it, most people expect times to be in their local
time anyhow.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
When getting the format for a message the envelope can be nil and this
shouldn't crash the program.
|
|
|
|
| |
Exposes the notmuch tags accordingly, stubs it for the maildir worker.
|
| |
|
|
|
|
|
|
| |
Note that, until we get color configuration, this means that the user *must*
have the %Z verb in the index format else it'll be horribly confusing
as no visual indication is provided
|
| |
|
|
|
|
|
| |
%F now shows the auth name or recepient name/address if the
message is from you.
|
|
This patch sets up the trigger config section of aerc.conf.
Each trigger has its own function which is called from the place where
it is triggered. Currently only the new-email trigger is implemented.
The triggers make use of format strings. For instance, in the new-email
trigger this allows the user to select the trigger command and also the
information extracted from the command and placed into their command.
To actually execute the trigger commands the keypresses are simulated.
Further triggers can be implemented in the future.
Formatting of the command is moved to a new package.
|