Commit Graph

8394 Commits

Author SHA1 Message Date
Kevin McCarthy
423f5002b4 Merge branch 'stable' 2024-12-02 11:38:38 +08:00
Kevin McCarthy
cba1fc27b1 Remove "." from MimeSpecials (RFC2045 tspecials).
RFC2045 declares tspecials to not include a period.  So encoding it
inside 2231 parameter values, or adding double quotes to MIME
parameter values (such as in Content-Type and Content-Disposition)
because of the presence of a period, while not illegal, is
unnecessary.

Ticket 491 reported a case where some Android clients were not
decoding the "." in an attachment filename extension for some unknown
reason.  While this is clearly a bug in the Android client, it's also
true that the period need not have been encoded in the first place.

However, "." couldn't simply be removed from MIMESpecials, because it
was also used for RFC2047 encoding.  RFC2047 encoded-words are used in
non-MIME headers, and cannot be double quoted.

Create a third "specials" list, RFC2047Specials, adding back in the
".", to keep RFC2047 encoding the same as it was.  Add a comment as to
why it exists, to prevent someone from making the unfortunate mistake
of thinking it can just be changed back to use MIMESpecials.

Thanks to Peter Seiderer for reporting the issue and suggesting a fix,
which this patch is based upon.
2024-12-02 11:34:24 +08:00
Kevin McCarthy
f87ab401d0 Merge branch 'stable' 2024-11-04 11:15:11 +08:00
Kevin McCarthy
a5bd98212d Fix configure.ac AM_ICONV result checking.
--disable-iconv seeds the cache value variable, $am_cv_func_iconv, to
"no" to skip the test and disable iconv.

However, the result of an existing and *working* AM_ICONV test is
stored in $am_func_iconv.  The call to AC_DEFINE(HAVE_ICONV) depends
on that variable.

Mutt was improperly checking $am_cv_func_iconv below.

In the event of an existing but broken iconv, this would result in
HAVE_ICONV being undefined, but mutt_idna.o being added to
MUTT_LIB_OBJECTS.  This would cause both the stub functions in
mutt_idna.h and the full functions in mutt_idna.c to be defined,
giving a compilation error.

Thanks to @juanitotc for the bug report and helping to test the fix.
2024-11-02 11:13:26 +08:00
William Yardley
9dc98409c1
Add note about remote mailboxes to $spoolfile docs 2024-06-20 11:29:12 -07:00
Kevin McCarthy
1f3da81014 Merge branch 'stable' 2024-04-20 11:46:40 +08:00
Alejandro Colomar
0af8a6fcdb crypt-gpgme.c: Fix NULL dereference
Fixes: 1afaa74a19ee ("gpgme integration.  See documentation for $crypt_use_gpgme, and http://www.gnupg.org/aegypten2/.")
2024-04-20 11:41:04 +08:00
Kevin McCarthy
762590bb92 Don't untag after edit-label.
Mutt is pretty consistent about NOT untagging automatically after an
operation.  The only place where it does so is when deleting, but even
this is configurable via $delete_untag.
2024-04-13 18:39:33 +08:00
Kevin McCarthy
680042df1b Merge branch 'stable' 2024-04-13 18:31:59 +08:00
Kevin McCarthy
0d75d71a6f Add $smime_pkcs7_default_smime_type config option.
This works around Outlook sending application/pkcs7-mime ".p7m" parts
without a smime-type parameter.

Mutt previously hardcoded an assumption that these were SignedData to
work around an old Outlook book.  However Outlook now appears to also
send EnvelopedData in this form.
2024-04-13 18:29:40 +08:00
Kevin McCarthy
3c98bfa875 Merge branch 'stable' 2024-03-09 18:35:21 +08:00
Kevin McCarthy
00d56288d3 automatic post-release commit for mutt-2.2.13 2024-03-09 18:29:03 +08:00
Kevin McCarthy
ceecc40bf9 Update UPDATING file for 2.2.13 release. 2024-03-09 18:24:58 +08:00
Kevin McCarthy
e2d235147c Merge branch 'stable' 2024-03-09 18:16:00 +08:00
Kevin McCarthy
9b967f07ab Fix smtp client to respect $use_envelope_from option.
The code was only looking to see if $envelope_from_address had a
value, not if $use_envelope_from was set.

Add extra safety checks to make sure the mailbox value isn't NULL.
2024-03-09 18:01:11 +08:00
Kevin McCarthy
039cc5211b Fix smtp client $envelope_from_address possible dangling pointer.
If the account-hook invoked by mutt_conn_find() modifies
$envelope_from_address, envfrom could point no longer point to the
address.

Move the mutt_conn_find() before the code that determines the envelope
from address.
2024-03-09 17:54:34 +08:00
Norman Wood
354c5b11ea Use readline to overcome macOS input() restrictions
Under macOS, for a python script launched in a terminal, input() accepts only 1024 characters.  In the authcode flow, the authorization code that is read by the call to input() around line 200 is longer than this and will be truncated, causing token retrieval to fail.  Importing readline resolves this, allowing input() to accept a longer character string.
2023-12-10 15:16:27 +08:00
Florian Weimer
563c5f6052 configure.ac: Fix ICONV_NONTRANS probe
The standard iconv function uses char ** even for its input argument.
With a const char ** argument, ICONV_NONTRANS is incorrectly set to 1
if the compiler produces an error for such incompatible pointer types.

Although as far as I can see, the only thing that accomplishes is
disabling an assert, so it probably does not matter much.
2023-12-07 19:39:06 +01:00
Kevin McCarthy
757ca3b39e Merge branch 'stable' 2023-09-09 14:55:00 +08:00
Kevin McCarthy
0a81a2a7ca automatic post-release commit for mutt-2.2.12 2023-09-09 14:45:24 +08:00
Kevin McCarthy
6a155b4933 Update UPDATING file for 2.2.12 release. 2023-09-09 14:42:14 +08:00
Kevin McCarthy
a4752eb0ae Fix write_one_header() illegal header check.
This is another crash caused by the rfc2047 decoding bug fixed in the
second prior commit.

In this case, an empty header line followed by a header line starting
with ":", would result in t==end.

The mutt_substrdup() further below would go very badly at that point,
with t >= end+1.  This could result in either a memcpy onto NULL or a
huge malloc call.

Thanks to Chenyuan Mi (@morningbread) for giving a working example
draft message of the rfc2047 decoding flaw.  This allowed me, with
further testing, to discover this additional crash bug.
2023-09-09 14:31:19 +08:00
Kevin McCarthy
4cc3128abd Check for NULL userhdrs.
When composing an email, miscellaneous extra headers are stored in a
userhdrs list.  Mutt first checks to ensure each header contains at
least a colon character, passes the entire userhdr field (name, colon,
and body) to the rfc2047 decoder, and safe_strdup()'s the result on
the userhdrs list.  An empty result would from the decode would result
in a NULL headers being added to list.

The previous commit removed the possibility of the decoded header
field being empty, but it's prudent to add a check to the strchr
calls, in case there is another unexpected bug resulting in one.

Thanks to Chenyuan Mi (@morningbread) for discovering the two strchr
crashes, giving a working example draft message, and providing the
stack traces for the two NULL derefences.
2023-09-09 14:31:19 +08:00
Kevin McCarthy
452ee330e0 Fix rfc2047 base64 decoding to abort on illegal characters.
For some reason, the rfc2047 base64 decoder ignored illegal
characters, instead of aborting.  This seems innocuous, but in fact
leads to at least three crash-bugs elsewhere in Mutt.

These stem from Mutt, in some cases, passing an entire header
field (name, colon, and body) to the rfc2047 decoder.  (It is
technically incorrect to do so, by the way, but is beyond scope for
these fixes in stable).  Mutt then assumes the result can't be empty
because of a previous check that the header contains at least a colon.

This commit takes care of the source of the crashes, by aborting the
rfc2047 decode.  The following two commits add protective fixes to the
specific crash points.

Thanks to Chenyuan Mi (@morningbread) for discovering the strchr
crashes, giving a working example draft message, and providing the
stack traces for the two NULL derefences.
2023-09-09 14:31:01 +08:00
Kevin McCarthy
b85b0dbfcb Merge branch 'stable' 2023-08-23 15:42:19 +08:00
Kevin McCarthy
7eb9c18f27 Add a documentation note that aliases are case insensitive.
It's very old behavior, but doesn't seem to be documented anywhere.

Thanks to Charles for pointing that out.
2023-08-23 15:40:19 +08:00
Kevin McCarthy
45bfedafc6 Merge branch 'stable' 2023-08-18 11:25:06 +08:00
Kevin McCarthy
6b538297bc automatic post-release commit for mutt-2.2.11 2023-08-18 11:17:23 +08:00
Kevin McCarthy
d619496e99 Update UPDATING file for 2.2.11 release. 2023-08-18 11:07:42 +08:00
Kevin McCarthy
1480121fda Merge branch 'stable' 2023-08-15 13:15:49 +08:00
Kevin McCarthy
d52c6115b0 Fix GPGME build failure on MacOS.
Commit 012981e8 (in release 2.2.9) updated the GPGME autoconf files,
to fix a build issue with newer GPGME releases.

Unfortunatley that caused a build issue for hosts where the gpg-error
header files aren't in the include path.  The newer autoconf file
expect GPG_ERROR_CFLAGS to be added to the list of flags for the
compiler.

Thanks to Will Yardley for reporting the issue and quickly testing the
proposed fix.
2023-08-15 13:03:58 +08:00
Aram Hamo
bf9887628e Update smime_keys.pl
accepting old/insecure smime certificates
2023-07-18 19:03:05 +00:00
Kevin McCarthy
b470a9ada6 Merge branch 'stable' 2023-06-05 18:55:17 +08:00
TAKAHASHI Tamotsu
a5423c4033 Updated Japanese translation. 2023-06-05 18:53:55 +08:00
Kevin McCarthy
5347d1c5c0 Merge branch 'stable' 2023-04-15 12:46:04 -07:00
Kevin McCarthy
50954c4ab7 Fix <collapse-all> behavior for sort=reverse-threads.
When uncollapsing, _mutt_traverse_thread() returns the virtual number
of the root message in the thread.  <collapse-thread> directly sets
menu->current to this value to cause the cursor to be on the *first*
message of the thread (which isn't the same as the root message when
sort=reverse-threads).  <collapse-all> finds the corresponding message
by searching for it after re-indexing.

However, when collapsing, _mutt_traverse_thread() had code to try and
find the *first* message in the thread and return that virtual number.
<collapse-thread> then did the same trick, because the old first
message is now the new root message for sort=reverse-threads.

However, that cleverness caused a bug for <collapse-all> - it can't
use that virtual number directly, and it can't "find" the message at
the index after reindexing.

To fix this, remove the cleverness from _mutt_traverse_thread() when
collapsing.  Return the virtual number of the root.  Add searching
behavior for <collapse-thread> to fix its behavior.
2023-04-14 19:55:52 -07:00
Kevin McCarthy
d2ed5d1815 Merge branch 'stable' 2023-03-25 13:20:30 -07:00
Kevin McCarthy
e0e92c3122 automatic post-release commit for mutt-2.2.10 2023-03-25 13:07:19 -07:00
Kevin McCarthy
9138232d8d Update UPDATING files for 2.2.10 release. 2023-03-25 13:03:39 -07:00
Kevin McCarthy
caea30181e Merge branch 'stable' 2023-03-13 18:27:45 -07:00
Kevin McCarthy
33f8b7cee8 Update copyright notices.
This is generated from the copyright-updater script, with manual
updates for the main.c and documentation, and po files.
2023-03-13 18:24:31 -07:00
Kevin McCarthy
3263c95379 Merge branch 'stable' 2023-03-12 19:54:44 -07:00
Kevin McCarthy
9f01d4ab0b Abort imap_fast_trash() if previously checkpointed.
We don't want to copy the deleted flag over to the trash folder too.

I looked into various ways to keep the UID COPY, but they lead to
niggling issues with error handling along with handling if the server
sends flag updates back to the client.

So for that (hopefully rare) case, abort the fast trash and just use a
regular copy.
2023-03-12 19:42:27 -07:00
Kevin McCarthy
277a12d110 Merge branch 'stable' 2023-03-12 19:41:08 -07:00
Kevin McCarthy
216dd145d4 Improve smtp oauth authentication.
Split XOAUTH2 to use two steps.

This follows the microsoft.com documentation example for smtp.  Since
office365 is the main site using XOAUTH2 now, it's better to match
their documentation.

It also matches msmtp's behavior, which probably means somewhere or
another needs it that way.

At the same time, improve response code checking.  Mutt was using
smtp_get_resp() before, which returns 0 for both a ready and success
response code.  Make sure it's a success response code when done
authenticating.
2023-03-12 19:29:32 -07:00
Kevin McCarthy
cf88e6d814 Merge branch 'stable' 2023-03-06 15:04:59 -08:00
Sebastian Andrzej Siewior
5df8619946 Use base64 URL safe alphabet for message id generation.
The character '/' from base64 alphabet breaks web redirectors if the
message-id from an email is used as part of the URL for redirectors and/
or automatic pointers to an email.

Use the URL safe alphabet from RFC4648 section 5 for message id
generation.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2023-03-04 18:11:15 -08:00
Sebastian Andrzej Siewior
cecddeac3b base64val: Add support to decode base64 safe URL.
In the base64 safe URL dictionary the characters '+' and '/' are
replaced by '-' and '_'.
Add the characters to Index_64 to allow decoding if needed.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2023-03-04 18:06:11 -08:00
Kevin McCarthy
90236f5ab8 Merge branch 'stable' 2022-12-20 09:16:42 -08:00
Cline, Wade
7c4fa47888 mutt_oauth2: Print access token request message
There are cases when using the 'authcode' grant where the authorization
request will succeed but the access token request will fail (for
example: if the user's web browser and terminal use different proxy
settings).  The current implementation of the script does not inform
the user that the authorization token is being exchanged for an access
code, with the result that it can appear that a request has both
succeeded (according to the browser) and failed (according to the
terminal output) simultaneously.  Add a message to inform the user that
a second request is being made so there is less potential for confusion.
2022-12-20 09:13:11 -08:00