Max Görner [Wed, 3 Oct 2018 20:28:57 +0000 (22:28 +0200)]
Add several "Durchkopplungsbindestrich" to some German translations
While up to personal taste to a certain extent, in general it is more
appropriate to use dashes instead of spaces to to combine related but
distinct terms.
This commit introduces dashes, so called Durchkopplungsbindestriche, to
some of the terms, were found more suiting.
Kevin McCarthy [Fri, 28 Sep 2018 22:08:19 +0000 (15:08 -0700)]
Convert pgp_invoke_list_keys and mix_send_message to use BUFFERs.
Both repetitively perform a lot of copying back in forth, which is
much cleaner with a BUFFER.
Note that in pgp_invoke_list_keys, if there are no hints uids->data
would be NULL. However, the pgp_invoke() checks and wraps all the
format substitutions with NONULL.
Kevin McCarthy [Fri, 28 Sep 2018 00:29:16 +0000 (17:29 -0700)]
Increase buffer sizes for some IMAP commands.
Use to ensure assembled IMAP commands fit in the resultant buffer to
be imap_exec()'ed.
RFC2683 suggested a limit of 1000, but asked servers to accept up to
8000. Furthermore, RFC7162 bumped the client limit suggestion up to
8192. So I don't believe any issues will be caused by this.
Most of these are increases are just to remove theoretical truncation
warned about by the compiler; I don't believe we've had reports of
actual command truncation due to a mailbox 1024 characters long.
Kevin McCarthy [Wed, 26 Sep 2018 02:03:56 +0000 (19:03 -0700)]
Fix non-threaded $sort_aux "reverse-" sorting.
The secondary sort was looking at (Sort & SORT_REVERSE) instead
of (SortAux & SORT_REVERSE), so wasn't even performing the reverse
based on the correct flag.
Additionally, afterwards, the primary sort was improperly applying a
reverse when the secondary sort returned non-zero.
Change SORTCODE() to look at SortAux when we are inside a secondary
sort.
Change AUXSORT() to return the result if the secondary sort returns
non-zero. It is ugly to put a return inside the macro, but the check
for non-zero needs to be performed inside the AUXSORT if branch.
If the secondary sort returns 0, then the primary sort can still
compare index and apply a reverse as needed.
Kevin McCarthy [Tue, 18 Sep 2018 02:40:22 +0000 (19:40 -0700)]
Send imap keepalives for interactive filters.
When viewing attachments externally with a (non-copiousoutput) mailcap
entry missing %s, the command is invoked as a filter, with the
attachment piped into stdin. However, unlike a filter, the user
interacts with the command, instead of just displaying the output in
the pager.
Just as with the mutt_system() command, Mutt needs to send imap
keepalives to keep those connections from closing during the
potentially extended invocation.
Thanks to John Hawkinson for the bug report, and his suggested patch,
which this commit is based upon.
Kevin McCarthy [Fri, 14 Sep 2018 21:23:04 +0000 (14:23 -0700)]
Remove purpose checks in smime_keys.pl verify step.
The purpose checks are subsequently performed, and added as a field to
the .index. In any case, it turns out passing multiple '-purpose'
arguments isn't even correct: openssl appears to just use the last
one.
Thanks to David J. Weller-Fahy for reporting the problem, and for
including a possible patch.
Kevin McCarthy [Thu, 13 Sep 2018 01:23:00 +0000 (18:23 -0700)]
Change imap_conn_find() to always return an authenticated conn.
With the flag MUTT_IMAP_CONN_NONEW, it was already ensured the
connection would be authenticated. However, without that flag, an
error in opening the connection or authentication would still return
an idata.
The callers that didn't bother to check the state were still assuming
authenticated, because they were all subseqeuently issuing an
"authenticated state" command to the server.
Rather than add state checks to every caller, just change the function
to return NULL if the idata did not end up in an authenticated state.
Remove the now redundant state checks in imap_open_mailbox() and
imap_get_mailbox().
Kevin McCarthy [Wed, 29 Aug 2018 22:08:19 +0000 (15:08 -0700)]
Rename pgpring to mutt_pgpring.
pgpring is used by another common package, signing-party. At the
request of ArchLinux, I am renaming our version to be prefixed by
"mutt_" in order to remove a naming conflict.
This is a minor inconvenience for pgp2, pgp5, and pgp6 users, but I
believe this constitutes an extremely small number of users at this
point.
I am keeping pgpewrap as-is because it is also used by GnuPG, and has
no such naming conflict.
Kevin McCarthy [Wed, 29 Aug 2018 20:00:14 +0000 (13:00 -0700)]
Remove extra lstats() in safe_rename() upon link success.
I originally kept the lstat()'s in order to make as few changes as
possible to the function. However, Derek Martin argues correctly that
if we are trusting the link() 0-retval, the lstats are unnecessary and
in fact can cause a performance impact over NFS.
Kevin McCarthy [Mon, 27 Aug 2018 01:43:20 +0000 (18:43 -0700)]
Add additional error handling to safe_rename().
It is apparently possible for link() to return an error but the link
to still be created. Add a double check for that case. If the files
match, unlink the src and return success.
Kevin McCarthy [Fri, 24 Aug 2018 19:56:54 +0000 (12:56 -0700)]
Display an error message if syncing fails.
Ticket 36 reported an issue where a maildir was removed while the
mailbox was opened. Later, attempting to sync displayed the message
"Writing xxx...", which remained on the screen. The reporter actually
thought mutt was frozen, but it was simply that on a sync error Mutt
wasn't clearing or updating the message window.
There is some error message handling for mbox.c check_mailbox, but I
don't think that is the right place to further propogate messages.
Instead, add an error to the same place the initial "Writing..."
message is created.
Kevin McCarthy [Wed, 22 Aug 2018 22:07:45 +0000 (15:07 -0700)]
Add compose-to-sender functionality.
This patch is loosely based on the NeoMutt feature, but adds in
support for the attach menu, reuses functionality in send.c, and has
proper mode checks.
Thanks to Enno for the opening the ticket requesting the port.
Kevin McCarthy [Tue, 21 Aug 2018 22:51:09 +0000 (15:51 -0700)]
Fix nested macro warning.
Pull the #if/#else outside of the snprintf in imap.c. On some
platforms, snprintf is a macro itself, which leads to a warning about
undefined behavior.
Thanks to Charles Diza for pointing out the problem.
Kevin McCarthy [Tue, 14 Aug 2018 21:31:34 +0000 (14:31 -0700)]
Remove compare_stat() call in safe_rename().
Some filesystems, such as sshfs, implement hard links strangely. The
hard link is created, but is represented by a different inode number
by the sshfs layer. The current maildir code goes into an infinite
loop in this case. Remove the compare_stat() and trust that a link()
return code of 0 means the link really did get created. Still, keep
the stats just as a minor check.
Kevin McCarthy [Wed, 15 Aug 2018 23:13:45 +0000 (16:13 -0700)]
Allow ctrl-c to interrupt initial IMAP header download.
Once the mailbox is open, it is significantly more complicated to
abort and keep Mutt from crashing. But during the initial
open/download Mutt is prepared to close the mailbox cleanly on
failure.
Kevin McCarthy [Tue, 14 Aug 2018 21:04:05 +0000 (14:04 -0700)]
Remove legacy trim_incomplete_mbyte() in the pager.
Commit 4b1deb57 added the trim_incomplete_mbyte() call, but at
that time, the function was using fgets() into a fixed-sized
buffer. The function was passing in "blen - 1" to the size
parameter of fgets, so the check for blen-2 was to see if the
buffer was completely filled by the fgets.
Commit d39d9c0c converted to use a dynamic buffer, but the
trim_incomplete_mbyte() was left in. It now serves no purpose
because the entire line will be read in. Presumably the buggy
regexp lib should have been fixed by now too.
Kevin McCarthy [Mon, 13 Aug 2018 16:43:55 +0000 (09:43 -0700)]
Only sync CONDSTORE and QRESYNC on the initial download.
In the midst of the imap_read_headers() refactor, I forgot to put this
guard on the /MODSEQ and /UIDSEQSET storage.
Because we don't deal with flag sync issues while the mailbox is open,
or when it closes, we only want to write those values to the header
cache during the initial download.
It makes no sense to perform all the header cache work if new messages
come into an open empty mailbox, so add a parameter to flag the
initial download, rather than check for msn_begin==1.
Kevin McCarthy [Sat, 26 May 2018 23:02:04 +0000 (16:02 -0700)]
Add QRESYNC support.
Refactor imap_read_headers() to break into functions for the different
queries.
Move uid_hash population to the same place msn_index is populated.
Change the VANISHED handler to not decrement MSNs for EARLIER.
FastMail, at least, does assume there are no gaps, and really it makes
no sense for there to be. Further testing will be needed.
Kevin McCarthy [Tue, 15 May 2018 01:12:39 +0000 (18:12 -0700)]
Add basic CONDSTORE support when fetching initial messages.
Store MODSEQ in the header cache, and use that to perform a "FETCH
CHANGEDSINCE" for header updates when initially downloading messages.
Further improvements could be made to add support when syncing.
Handling MODSEQ for FLAG updates while the mailbox is open would be
complicated by the fact that Mutt supports locally modified headers,
so we couldn't accept the new (or subsequent) MODSEQ.
However, this initial step may at least provide some benefit when
opening the mailbox, which is generally the most time and data
intensive.
Kevin McCarthy [Sat, 28 Jul 2018 22:26:34 +0000 (15:26 -0700)]
Fix -z and -Z options to work with IMAP.
-Z did not work if $imap_passive was set (the default). I think using
the option implies the desire to open a new connection and check
buffy at startup, so temporarily turn it off during the buffy.
-z was not hooked up for IMAP. Change it to call imap_status(). This
also requires $imap_passive be unset, so temporarily turn the option
off too.
Kevin McCarthy [Sat, 28 Jul 2018 20:16:50 +0000 (13:16 -0700)]
Add a note about doc/manual.tex generation.
The invocation doesn't work for me, but does work for Ken. I'm
reluctant to touch and break it for existing users, so instead
add a note to the Makefile.am. Perhaps someone with more knowledge of
those tools can make it portable.
Kevin McCarthy [Sat, 28 Jul 2018 19:59:35 +0000 (12:59 -0700)]
Fix AUXSORT usage in compare_spam.
AUXSORT already checks if the first parameter is zero.
Additionally, the macro expands into more than one statement, so
putting inside an unbracketed if is misleading and generates a
warning on the latest gcc.
Fortunately, both statements checked if the first parameter was zero,
so no actual bug resulted.
Ken Moffat [Thu, 26 Jul 2018 22:34:50 +0000 (15:34 -0700)]
Fix manual.pdf toc page numbers.
When TeX engines are not run sufficient times there are undefined
references - for manual.tex the page numbers in the Table of
Contents and the List of Tables render as '??'. In this case:
Kevin McCarthy [Thu, 26 Jul 2018 00:52:40 +0000 (17:52 -0700)]
Add mx_ops.msg_padding_size to return the padding for a mx type.
Mbox pads with a 1 byte, while mmdf pads with 10. Because compress
depends on the child type, we create a mx_ops, which allows compress.c
to delegate to the child ops.
Kevin McCarthy [Wed, 25 Jul 2018 01:23:25 +0000 (18:23 -0700)]
Skip sort in mbox_sync_mailbox() when new/reopen occurs.
Callers of mx_sync_mailbox() and mx_close_mailbox() already check for
those cases and call update_index(). So remove the need_sort flag
setting when mbox_check_mailbox() returns new/reopen inside
mbox_sync_mailbox().
Kevin McCarthy [Wed, 25 Jul 2018 01:12:20 +0000 (18:12 -0700)]
Handle reopen/new_mail when closing mailbox in <imap-logout-all>.
Other callers, such as OP_QUIT, OP_MAIN_CHANGE_FOLDER, and
OP_MAIN_SYNC_FOLDER handle the case where a sync or close_mailbox
fails due to new mail or a reopen.
OP_MAIN_LOGOUT_ALL appears to have been accidentally missed. Add a
call to update_index() to properly sort and update vcounts.
Vincent Lefevre [Tue, 24 Jul 2018 01:52:41 +0000 (03:52 +0200)]
Add ctx->vsize = 0 in a couple of places.
It is not clear whether this is needed, but in both cases, the old value
(if not 0) is obsolete. If there is a bug somewhere else about vsize, it
will be easier to notice it.
Vincent Lefevre [Sun, 22 Jul 2018 00:57:32 +0000 (02:57 +0200)]
Improved limit-to-all detection by skipping leading spaces of the pattern.
There are many equivalent limit-to-all patterns, but in practice, one
may want to limit to " ~A" in order to prevent the pattern from being
recorded in the history. Thus it is important to detect at least this
pattern and similar ones.
Vincent Lefevre [Sat, 21 Jul 2018 23:46:03 +0000 (01:46 +0200)]
Bug fix: reset ctx->vsize in update_index_unthreaded on reopened mailbox.
This fixes a bug observed when doing the following:
1. Start Mutt on some mailbox.
2. Limit the view.
3. Set sort by date (thus unthreaded).
4. Set $status_format to display the size of the messages shown (%L).
5. Copy a message matching the limit pattern to this mailbox.
6. With another Mutt instance, remove this message from this mailbox.
7. Move the cursor to update the view.
Result: one was getting a value equal to twice the initial size.
Kevin McCarthy [Fri, 20 Jul 2018 03:28:38 +0000 (20:28 -0700)]
Display matching new messages in a thread-limited index.
Previously, the index performed pattern matching first, and then
resorted new mail. The problem was that thread-limiting patterns,
e.g. ~(pattern), require threading data to properly match against the
new messages.
We already save new messages for the purposes of uncollapsing threads.
To keep the code cleaner, split off update_index() into
update_index_threaded()/unthreaded(). Then for threaded mode, save
the new messages first. We can then sort (before pattern matching),
and use the save_new array to pattern match the new messages
afterwards.
The $uncollapse_new loop was unnecessarily performing a n^2 search.
Simplify to just iteratate over the save_new instead.
Brandon Long [Tue, 26 Jun 2018 22:42:08 +0000 (15:42 -0700)]
Improve OAUTHBEARER support.
Move token refresh commands to their own config variables. Consolidate
code for refreshing tokens and generating the SASL OAUTHBEARER
argument in account.c. Add support for OAUTHBEARER to pop.
Fix pop_auth_oauth() mutt_from_base64() call from 1.10.1 release.
Kevin McCarthy [Sun, 8 Jul 2018 02:03:44 +0000 (19:03 -0700)]
Properly quote IMAP mailbox names when (un)subscribing.
When handling automatic subscription (via $imap_check_subscribed), or
manual subscribe/unsubscribe commands, mutt generating a "mailboxes"
command but failed to properly escape backquotes.
Thanks to Jeriko One for the detailed bug report and patch, which this
commit is based upon.
Kevin McCarthy [Wed, 27 Jun 2018 16:27:05 +0000 (09:27 -0700)]
Reset all MonitorContext state on context removal.
Reset both the descriptor and changed flag when the current context is
removed. Don't make this dependent on the context being valid or
being found by monitor_resolve(), in case the context was closed due
to some type of error condition.
Kevin McCarthy [Wed, 27 Jun 2018 02:48:25 +0000 (19:48 -0700)]
Fix MonitorContextDescriptor update on removal.
Reset the context descriptor before checking for the monitor being
shared by another mailbox. Technically, it would be set properly
during the next add, but it shouldn't be left incorrect.
Kevin McCarthy [Tue, 26 Jun 2018 00:54:43 +0000 (17:54 -0700)]
Work around open mailbox monitor code check issue.
The monitor code is too fast, and can result in all the changes for a
single directory stat update being missed.
Work around this issue by not recording stat time updates when the
check_mailbox() is triggered by the monitor. This will cause the next
subsequent check to take another look.
Kevin McCarthy [Mon, 25 Jun 2018 20:13:55 +0000 (13:13 -0700)]
Generate error if makedoc is missing a type.
Add a comment in init.h to remind devs to update makedoc.c when adding
a new type.
Change makedoc to fail on a missing type. Otherwise it's too easy to
miss the resulting problem in the documentation.
Credit goes to Eike Rathke for noting that it was too easy to forget
to do this, and something should be fixed. I found his solution a bit
too complicated though, and opted for just adding comment and program
failure.
Eike Rathke [Sat, 23 Jun 2018 08:25:15 +0000 (10:25 +0200)]
Make make ctags actually work
make ctags broke with
Making ctags in po
make[1]: Entering directory '.../mutt/po'
make[1]: *** No rule to make target 'ctags'. Stop.
make[1]: Leaving directory '.../mutt/po'
Makefile:867: recipe for target 'ctags-recursive' failed
make: *** [ctags-recursive] Error 1
and once fixed the same in intl/
Note that this ctags target scatters tags files over directories.
If you use exuberant ctags then simply run
ctags -R
once in mutt's root dir instead.