Kevin McCarthy [Fri, 26 Apr 2019 02:41:04 +0000 (19:41 -0700)]
Add $forward_attachments quadoption for inline-forward mode
When set or answered yes, non text-decodable parts will be attached to
the new message. The default value is "ask-yes", because I believe
this is something people will want to use, and should be made aware of
the new possible behavior.
The option presents a nice middle ground between previous
inline-forwarding behavior (where all the non-text parts were
dropped), and $mime_forward where the entire email was included as an
attachment.
This was previously difficult to achieve, but after the
recv-attachment refactoring: (a19e5266^..faabd621)
it became possible to use the ATTACH_CONTEXT and the recvattach.c
helper mutt_generate_recvattach_list() to properly deal with nesting
and multiple file-handles.
Kevin McCarthy [Sun, 19 Aug 2018 16:25:53 +0000 (09:25 -0700)]
Add $imap_fetch_chunk_size to allow FETCHing new headers in chunks
For extremely large mailboxes, some implementations will time out just
while fetching the new headers, because the client doesn't send any
commands for 30 minutes while downloading the large number of headers.
Rewrite imap_fetch_msn_seqset() to return chunks of size
$imap_fetch_chunk_size.
The change requires trusting the server will follow the RFC and not
send an EXPUNGE during or between the FETCH chunks; otherwise we'll
miss MSNs between the chunks because the shift.
We could in theory continue to set "msn_begin = idata->max_msn + 1",
but that makes the assumption there are no holes in the header cache
that we are filling in during a chunk. Personally I am dubious about
"header cache holes", but the IMAP code has explicitly mentioned and
handled them since prior to my involvement.
Since the RFC forbids the interleaving EXPUNGE I believe it's safe
enough to set "msn_begin = fetch_msn_end + 1" until proven otherwise.
Kevin McCarthy [Sat, 20 Apr 2019 19:34:35 +0000 (12:34 -0700)]
Convert compress to use mutt_buffer_quote_filename()
Because the compress expandos operate differently than the rest of
mutt, requiring manual outer quoting, add a parameter to the function
to toggle outer quoting off.
Kevin McCarthy [Wed, 17 Apr 2019 01:11:35 +0000 (18:11 -0700)]
Convert other users of struct Mailbox->pathbuf to use Buffers
A few functions in browser.c, buffy.c, and monitor.c were using
struct Mailbox->pathbuf but were potentially truncating via fixed size buffers.
Convert those to use Buffers too.
buffy_get() was creating epath and expanding it, apparently to match
against expanded struct Mailbox list entries, was wasn't using the epath. I
believe this is a bug, and have switched the comparison to epath.
Kevin McCarthy [Tue, 16 Apr 2019 20:41:10 +0000 (13:41 -0700)]
Convert struct Buffer->path to a struct Buffer
Rename to struct Buffer->pathbuf to make it clear the field is a struct Buffer, and
to make sure to catch and review all usages.
There are still uses of pathbuf that are truncating and need to be
fixed, for example in browser.c and buffy.c.
Fix up sidebar usage in one place, that was pointing inside the
struct Mailbox->path with a char *. At the same time, change their "short
folder" computation to also use a struct Buffer.
Pietro Cerutti [Fri, 3 May 2019 11:53:40 +0000 (11:53 +0000)]
Fix utf7/utf8 conversion of mailbox names in LIST response
Because of a wrong argument passed into `imap_unmunge_mbox_name`, mailbox names
encoded in utf7 are not properly converted into utf8. This causes two problems:
1. mailbox names are mangled in the UI (M&AOY-lstr&APY-m instead of Mælström)
2. mailbox names are re-encoded to utf7 before being sent to the server,
resulting in "Mailbox does not exists" errors in commands such as DELETE
Richard Russon [Wed, 1 May 2019 22:38:00 +0000 (23:38 +0100)]
merge: upstream Buffer changes
* Change autoview_handler() to use struct Buffer
* Convert mutt_check_simple() to accept a struct Buffer parameter
* Add mutt_buffer_quote_filename()
* Convert mutt_expand_file_fmt() to accept struct Buffer dest parameter
* Convert mutt_get_tmp_attachment to use struct Buffer
* Convert mutt_compose_attachment to use struct Buffer
* Convert mutt_edit_attachment to use struct Buffer
* Convert mutt_view_attachment to use struct Buffer
* Convert mutt_print_attachment to use struct Buffer
* Convert mutt_expand_fmt() and rfc1524_expand_filename() to struct Buffer
* Rename to mutt_rfc1524_expand_filename()
* Convert remaining mutt_adv_mktemp() calls to use buffer version
* Rename mutt_buffer_adv_mktemp()
* test: update for buffer changes
Kevin McCarthy [Wed, 10 Apr 2019 00:52:14 +0000 (17:52 -0700)]
Convert mutt_expand_fmt() and rfc1524_expand_filename() to struct Buffer
These two functions were tied together and so are converted at the
same time.
Note that rfc1524_expand_filename() had an off-by-one error for the
left hand size of the name template. It was only copying i-1 instead
of the i characters before %s.
Richard Russon [Tue, 30 Apr 2019 16:40:59 +0000 (17:40 +0100)]
merge: fix bind/macro translations
* icommands.c: Unify error messages about temp file creation
* icommands.c: Add hints about '%s' for the translators
* icommands.c: I18N: Fix piecemeal constructed translation string
* po: Update PO files due to icommands.c change
Do not translate individual parts of a message and then combine them in
a printf-style way. This might work for English but miserably fails for
other languages. Instead use two or more complete sentences and pass
each of the sentences to the translator.