]> granicus.if.org Git - mutt/log
mutt
5 years agoFix mutt_save_message() "enter_fname()" to use buffer version.
Kevin McCarthy [Sun, 22 Sep 2019 01:34:51 +0000 (18:34 -0700)]
Fix mutt_save_message() "enter_fname()" to use buffer version.

Commit be632f11 converted this function to use the buffer pool, but
accidentally used the non-buffer prompt when there was already a
buffer-converted version.

5 years agoMerge branch 'stable'
Kevin McCarthy [Sat, 21 Sep 2019 19:41:10 +0000 (12:41 -0700)]
Merge branch 'stable'

5 years agoautomatic post-release commit for mutt-1.12.2 mutt-1-12-2-rel
Kevin McCarthy [Sat, 21 Sep 2019 19:36:56 +0000 (12:36 -0700)]
automatic post-release commit for mutt-1.12.2

5 years agoUpdate UPDATING file for 1.12.2 release.
Kevin McCarthy [Sat, 21 Sep 2019 19:27:57 +0000 (12:27 -0700)]
Update UPDATING file for 1.12.2 release.

5 years agoConvert mutt_complete() to use the buffer pool.
Kevin McCarthy [Fri, 20 Sep 2019 01:52:24 +0000 (18:52 -0700)]
Convert mutt_complete() to use the buffer pool.

Add helper functions mutt_buffer_substrcpy() and
mutt_buffer_concatn_path().

Remove mutt_concatn_path() because mutt_complete() was the only
caller.

5 years agoImprove sidebar indentation and shortpath behavior.
Kevin McCarthy [Sun, 15 Sep 2019 22:41:42 +0000 (15:41 -0700)]
Improve sidebar indentation and shortpath behavior.

The previous implementation only enabled $sidebar_folder_indent for
mailboxes underneath $folder.  Change indentation to be based upon the
previous common-path mailbox in the list.  Indent one more than the
common-path mailbox, rather than the number of delimiters after
$folder.

Change $sidebar_short_path to shorten based on the previous mailbox in
the list too.

Invoke mutt_buffer_pretty_mailbox() to prefix the mailbox with '~' or
'=' characters.  This changes the output for the case where mailbox
equals $folder, but provides uniform display behavior across mutt.

Thanks to Christopher Zimmermann (@madroach) for the original patch,
which this commit is based upon.

5 years agoConvert print_attachment_list to use buffer pool.
Kevin McCarthy [Thu, 12 Sep 2019 02:47:13 +0000 (19:47 -0700)]
Convert print_attachment_list to use buffer pool.

5 years agoConvert query_pipe_attachment to use buffer pool.
Kevin McCarthy [Thu, 12 Sep 2019 02:40:48 +0000 (19:40 -0700)]
Convert query_pipe_attachment to use buffer pool.

5 years agoConvert recvattach save_attachment functions to use buffer pool.
Kevin McCarthy [Thu, 12 Sep 2019 02:10:02 +0000 (19:10 -0700)]
Convert recvattach save_attachment functions to use buffer pool.

Convert utility functions prepend_curdir() and mutt_check_overwrite()
to use BUFFER, as they are only used by those two functions.

5 years agoConvert mutt_save_message() to use buffer pool.
Kevin McCarthy [Wed, 11 Sep 2019 23:23:46 +0000 (16:23 -0700)]
Convert mutt_save_message() to use buffer pool.

Change imap_copy_messages() dest parameter to const char *.

mutt_default_save() will be converted to use a buffer next, removing
the dptr fixups.

5 years agoConvert mutt_display_message() to buffer pool.
Kevin McCarthy [Wed, 11 Sep 2019 22:55:01 +0000 (15:55 -0700)]
Convert mutt_display_message() to buffer pool.

Remove an unused mime-type string generation at the top of the
function too.  The code using the mime type was removed a long time
ago in commit 246198ae.

5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 10 Sep 2019 01:39:19 +0000 (18:39 -0700)]
Merge branch 'stable'

5 years agoFix mutt_write_mime_body() application/pgp-encrypted handling.
Kevin McCarthy [Tue, 10 Sep 2019 01:32:59 +0000 (18:32 -0700)]
Fix mutt_write_mime_body() application/pgp-encrypted handling.

It would blindly overwrite any attachment with that type, as if it
were the version label part of a multipart/encrypted message.

However attachments with extenstion .gpg are labeled that type if
$mime_type_query_command is set to "xdg-mime query filetype".  This
would cause the attachment to be overwritten too.

Add a check for a missing body->filename, which should only be the
case for the manually constructed part.

5 years agoChange browser <display-filename> to show full_path.
Kevin McCarthy [Tue, 10 Sep 2019 01:19:03 +0000 (18:19 -0700)]
Change browser <display-filename> to show full_path.

Prior to the introduction of display_name/full_path, it showed "name",
which was the full IMAP URL but the shortname for folder/mailbox view.

Now that the full_path is available, it makes sense to show that for
all cases.

5 years agoConvert remaining mutt_encode_path() call to use BUFFER.
Kevin McCarthy [Mon, 9 Sep 2019 21:06:31 +0000 (14:06 -0700)]
Convert remaining mutt_encode_path() call to use BUFFER.

Then rename the other uses of mutt_buffer_encode_path() to
mutt_encode_path().

5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 10 Sep 2019 01:07:16 +0000 (18:07 -0700)]
Merge branch 'stable'

5 years agoAdd $browser_sticky_cursor default set.
Kevin McCarthy [Sun, 8 Sep 2019 17:49:37 +0000 (10:49 -0700)]
Add $browser_sticky_cursor default set.

This option attempts to keep the browser cursor on the same mailbox.

It does this by keeping track of the current selected mailbox and
comparing that when regenerating the menu.

Modify imap_mailbox_create() and imap_mailbox_rename() to return the
new mailbox name so it can be automatically selected.

5 years agoRename browser fields to display_name and full_path.
Kevin McCarthy [Sun, 8 Sep 2019 19:09:51 +0000 (12:09 -0700)]
Rename browser fields to display_name and full_path.

Mailbox and Folder view don't make use of the desc field.  They store
an abbreviated version in the name field and expand it when selecting
or testing it.

IMAP stores the full URL in name, and stores an abbreviated
version (possibly with a trailing slash) in the desc field.

The asymetricity makes it awkward, and interferes with a smart-cursor
option in the next commit.  So instead rename the fields to
"display_name" and "full_path".

In Mailfox and Folder view, store the fully expanded path, which we
have while iterating, in "full_path", and the shortened version in
"display_name".

Likewise in IMAP, store the full URL in "full_path" and the shortened
version in "display_name".

Simplify the code in browser.c to use the full_path instead of
concatenating and expanding.

5 years agoConvert bcache to use buffer pools.
Kevin McCarthy [Fri, 6 Sep 2019 23:14:08 +0000 (16:14 -0700)]
Convert bcache to use buffer pools.

5 years agoFix memory leak when attaching messages.
Kevin McCarthy [Mon, 2 Sep 2019 02:10:23 +0000 (19:10 -0700)]
Fix memory leak when attaching messages.

Setting actx->idx[]->content->parts to NULL causes a memory leak,
because message attachments store a BODY there that needs to be freed.

I looked through the various use cases of ci_send_message() and
actually believe content->parts will be NULL for all other cases
except message attachments.  From the comment added to
delete_attachment():

  Other ci_send_message() message constructors are careful to free
  any body->parts, removing depth:
   - mutt_prepare_template() used by postponed, resent, and draft files
   - mutt_copy_body() used by the recvattach menu and $forward_attachments.

  I believe it is safe to completely remove the "content->parts =
  NULL" statement.  But for safety, am doing so only for the case
  it must be avoided: message attachments.

5 years agoReuse the static space_stuff function for unstuffing.
Kevin McCarthy [Sun, 1 Sep 2019 20:25:06 +0000 (13:25 -0700)]
Reuse the static space_stuff function for unstuffing.

5 years agoadd fallback for inotify_init1
Gero Treuner [Sun, 1 Sep 2019 14:58:46 +0000 (16:58 +0200)]
add fallback for inotify_init1

5 years agoRemove manual note about space-stuffing only once.
Kevin McCarthy [Sat, 31 Aug 2019 21:17:22 +0000 (14:17 -0700)]
Remove manual note about space-stuffing only once.

Stuffing is now performed each time.

5 years agoRe-enable and cleanup format-flowed space stuffing.
Kevin McCarthy [Sat, 31 Aug 2019 20:37:16 +0000 (13:37 -0700)]
Re-enable and cleanup format-flowed space stuffing.

Commit 04cb5bde tried to fix re-stuffing a postponed message more than
once, but unfortunately broke the normal case of composing a new
message.  So actually, space-stuffing has been turned off the past 7
years.

Move format=flowed parameter setting below the standard message
pre-processing block.  It shouldn't be performed for draft-files even
with $resume_draft_files set.  Moving out of the block makes that
clearer.

Create mutt_rfc3676_space_(un)stuff() functions, which check the
content type and stuff/unstuff apprpropriately.  Note that the
stuff/unstuff does not depend on $text_flowed, which is only in charge
of setting the format=flowed parameter.  This parameter can also come
from resumed/resent/draft messages and should still be respected.

Add unstuffing to mutt_prepare_template().  This is called by
postponed, resent, and draft files.  This will prevent double-stuffing
in those cases.

Unstuff/restuff around editing the message in the compose menu, to
keep everything transparent to the user.  I originally put the
stuffing *after* the compose menu, but previewing the messages in the
compose menu did not work properly in that case.  It's cleaner this
way too.

Change the stuff/unstuff functions to preserve the original
hdr->content->filename.  The "hack" previously used would interact
poorly with editable body files (mutt -i -E).  Fortunately space
stuffing was pretty much disabled except in unusual cases before.

5 years agoProperly revert on an autocrypt postpone failure.
Kevin McCarthy [Sat, 31 Aug 2019 20:36:28 +0000 (13:36 -0700)]
Properly revert on an autocrypt postpone failure.

5 years agoMerge branch 'stable'
Kevin McCarthy [Wed, 28 Aug 2019 21:47:15 +0000 (14:47 -0700)]
Merge branch 'stable'

5 years agoFix inotify configure test.
Kevin McCarthy [Wed, 28 Aug 2019 21:41:26 +0000 (14:41 -0700)]
Fix inotify configure test.

AC_CHECK_FUNCS executes "action-if-found" or "action-if-not-found" for
each function in the list.  If a system has some but not all of the
functions, both will end up being executed.

This caused a build failure on an older system with exactly that
situation.

Change to only define USE_INOTIFY if all functions exist.

5 years agode.po: proper translation for term collapse
Olaf Hering [Wed, 28 Aug 2019 20:22:10 +0000 (20:22 +0000)]
de.po: proper translation for term collapse

The intention of the term "collapse" is something like opening and
closing an item. The initial translation which was added two decades
ago means something like "breaks by weakness", which does not fit in
the context of mutt.

Use a term which means literally "opening and closing an item, like a
book".

Signed-off-by: Olaf Hering <olaf@aepfle.de>
5 years agoClean up the autocrypt doc a bit more.
Kevin McCarthy [Tue, 20 Aug 2019 22:37:06 +0000 (15:37 -0700)]
Clean up the autocrypt doc a bit more.

5 years agoUpdate autocrypt keyring documentation.
Kevin McCarthy [Tue, 20 Aug 2019 22:17:31 +0000 (15:17 -0700)]
Update autocrypt keyring documentation.

Recommend setting $autocrypt_dir to your normal keyring directory if
you want to use your existing key.

Trying to copy it over leads to signature verification issues.  Even
if I reversed the order (which is much less clean), that would just
lead to missing key signature errors for Autocrypt messages instead.

5 years agoFix --with-sqlite3 test for autocrypt.
Kevin McCarthy [Tue, 20 Aug 2019 21:57:29 +0000 (14:57 -0700)]
Fix --with-sqlite3 test for autocrypt.

Since $with_sqlite3 can contain a path, we want to check if it is
"no", not that it isn't "yes".

5 years agoAdd $ssl_use_tlsv1_3 config variable, default set.
Kevin McCarthy [Sat, 17 Aug 2019 22:38:34 +0000 (15:38 -0700)]
Add $ssl_use_tlsv1_3 config variable, default set.

5 years agoAdd size display configuration variables.
Kevin McCarthy [Fri, 28 Jun 2019 22:09:51 +0000 (15:09 -0700)]
Add size display configuration variables.

Although it would be nice to "open this up" more, performance and
security/stability issues would arise.

Based on the thread in mutt-dev, I hope these vars will satisfy most
customization needs:
  $size_show_bytes
  $size_show_mb
  $size_show_fractions
  $size_units_on_left

5 years agoFix LibreSSL build.
Kevin McCarthy [Wed, 14 Aug 2019 04:03:51 +0000 (21:03 -0700)]
Fix LibreSSL build.

Apparently LibreSSL doesn't implement SSL_has_pending(), even for
newer versions.

5 years agoUpdate POTFILES.in.
Kevin McCarthy [Tue, 13 Aug 2019 22:14:37 +0000 (15:14 -0700)]
Update POTFILES.in.

The file was missing a few files with translation strings:
copy.c, imap/auth_oauth.c, and safe_asprintf.c.

5 years agoAdd checks for buffered OpenSSL or GnuTLS data when polling.
Kevin McCarthy [Sun, 28 Jul 2019 14:54:32 +0000 (07:54 -0700)]
Add checks for buffered OpenSSL or GnuTLS data when polling.

I don't believe this has had an actual effect, because Mutt doesn't
support renegotiation, and we are only polling immediately after
sending NOOP.

However, it looks like checking is technically the correct thing to do
to avoid polling waiting for data that is already buffered.

5 years agoMention base64 keydata being stored in the autocrypt database.
Kevin McCarthy [Tue, 13 Aug 2019 21:20:33 +0000 (14:20 -0700)]
Mention base64 keydata being stored in the autocrypt database.

5 years agoMove LIBAUTOCRYPT before MUTTLIBS to fix building issues.
Kevin McCarthy [Sun, 11 Aug 2019 21:35:07 +0000 (14:35 -0700)]
Move LIBAUTOCRYPT before MUTTLIBS to fix building issues.

5 years agoAdd autocrypt and sqlite3 to .gitlab-ci.yml.
Kevin McCarthy [Sun, 11 Aug 2019 21:17:50 +0000 (14:17 -0700)]
Add autocrypt and sqlite3 to .gitlab-ci.yml.

5 years agoAdd L10N comment about autocrypt menu help line abbreviations.
Kevin McCarthy [Fri, 9 Aug 2019 21:15:18 +0000 (14:15 -0700)]
Add L10N comment about autocrypt menu help line abbreviations.

5 years agoAdd a note about autocrypt first-run and macros.
Kevin McCarthy [Fri, 9 Aug 2019 20:58:55 +0000 (13:58 -0700)]
Add a note about autocrypt first-run and macros.

5 years agoAdd autocrypt documentation about shared key and keyring strategies.
Kevin McCarthy [Fri, 9 Aug 2019 20:37:08 +0000 (13:37 -0700)]
Add autocrypt documentation about shared key and keyring strategies.

5 years agoMinor autocrypt manual section updates.
Kevin McCarthy [Fri, 9 Aug 2019 03:49:32 +0000 (20:49 -0700)]
Minor autocrypt manual section updates.

Mention key selection during account creation and $autocrypt_reply for
controlling autocrypt mode setting during replies.

5 years agoEnabled writing protected subject with autocrypt too.
Kevin McCarthy [Thu, 8 Aug 2019 16:18:53 +0000 (09:18 -0700)]
Enabled writing protected subject with autocrypt too.

5 years agoTurn off macro processing during autocrypt initialization.
Kevin McCarthy [Thu, 8 Aug 2019 01:34:58 +0000 (18:34 -0700)]
Turn off macro processing during autocrypt initialization.

The muttrc can push events into the macro buffer, with the assumption
that mailbox will be opened next.  This will interfere with the
prompts uses during first run.  The only issue is that macros won't
work inside the folder browser, if invoked.

5 years agoAllow nested setting of OPTIGNOREMACROEVENTS.
Kevin McCarthy [Thu, 8 Aug 2019 01:24:15 +0000 (18:24 -0700)]
Allow nested setting of OPTIGNOREMACROEVENTS.

This will be needed for the first-run of autocrypt initialization.
The initialization involves a number of prompts, and can even use the
folder browser.  The browser could in turn connect to IMAP which might
invoke a certificate prompt, login prompt, etc.

5 years agoAdd $autocrypt_reply.
Kevin McCarthy [Wed, 7 Aug 2019 21:31:53 +0000 (14:31 -0700)]
Add $autocrypt_reply.

This allows turning off the force-autocrypt mode when replying to an
autocrypt email.

5 years agoAutomatically clear screen when popping the last menu.
Kevin McCarthy [Wed, 7 Aug 2019 21:17:28 +0000 (14:17 -0700)]
Automatically clear screen when popping the last menu.

This removes the need to manually clear the screen during pre-menu
operations, such as autocrypt first run initialization.

5 years agoAdd ability to create autocrypt account from an existing key.
Kevin McCarthy [Wed, 7 Aug 2019 21:12:43 +0000 (14:12 -0700)]
Add ability to create autocrypt account from an existing key.

This is useful when adding accounts, or for users who want to use an
existing key from the keyring during initial account creation.

5 years agoDon't try to decrypt autocrypt messages if the option is off.
Kevin McCarthy [Sun, 4 Aug 2019 14:55:26 +0000 (07:55 -0700)]
Don't try to decrypt autocrypt messages if the option is off.

5 years agoManual typo fix.
Kevin McCarthy [Sun, 4 Aug 2019 14:52:19 +0000 (07:52 -0700)]
Manual typo fix.

Thanks to Petr Pisar for pointing out the error.

5 years agoAdd autocrypt README file
Kevin McCarthy [Sat, 3 Aug 2019 20:53:40 +0000 (13:53 -0700)]
Add autocrypt README file

5 years agoAdd documentation for the autocrypt feature.
Kevin McCarthy [Fri, 2 Aug 2019 16:03:41 +0000 (09:03 -0700)]
Add documentation for the autocrypt feature.

5 years agoAdd option to scan mailboxes during first run.
Kevin McCarthy [Thu, 1 Aug 2019 01:56:29 +0000 (18:56 -0700)]
Add option to scan mailboxes during first run.

The scanner will disable the header cache, allowing scanning all
messages in the mailbox.

5 years agoAdd more translation string comments for autocrypt.
Kevin McCarthy [Wed, 31 Jul 2019 22:42:09 +0000 (15:42 -0700)]
Add more translation string comments for autocrypt.

5 years agoBasic autocrypt account menu.
Kevin McCarthy [Mon, 29 Jul 2019 02:24:11 +0000 (19:24 -0700)]
Basic autocrypt account menu.

Provide ability to create, delete, and toggle the prefer-encrypt and
enabled flag for an account.

Hook into the index via 'A' <autocrypt-acct-menu>.

5 years agoConvert peer_update to just pass the peer object.
Kevin McCarthy [Wed, 31 Jul 2019 02:14:56 +0000 (19:14 -0700)]
Convert peer_update to just pass the peer object.

Unlike get and insert, there is no need for an addres parameter that
needs to be normalized, since the address is already in the peer
object.

5 years agoImprove gen-map-doc work on multi-word maps.
Kevin McCarthy [Mon, 29 Jul 2019 02:23:12 +0000 (19:23 -0700)]
Improve gen-map-doc work on multi-word maps.

5 years agoAdd account->enabled checks.
Kevin McCarthy [Sat, 27 Jul 2019 22:34:51 +0000 (15:34 -0700)]
Add account->enabled checks.

Add to ui recommendation, keylist generator, and autocrypt header
writing routines.

5 years agoAdd prefer-encrypt prompt during account creation.
Kevin McCarthy [Sat, 27 Jul 2019 22:11:38 +0000 (15:11 -0700)]
Add prefer-encrypt prompt during account creation.

5 years agoAdd AUTOCRYPT header to imap fetch list.
Kevin McCarthy [Sat, 27 Jul 2019 20:44:36 +0000 (13:44 -0700)]
Add AUTOCRYPT header to imap fetch list.

If $autocrypt is set, add the header to make IMAP behave the same as
other formats (parsing on initial mailbox opening).

This will also be useful if we perform an initial scan during account
creation, to make that work for IMAP too.

5 years agoAdd L10N translation message comments.
Kevin McCarthy [Fri, 26 Jul 2019 23:27:04 +0000 (16:27 -0700)]
Add L10N translation message comments.

5 years agoAdd autocrypt source files to POTFILES.in
Kevin McCarthy [Fri, 26 Jul 2019 23:00:22 +0000 (16:00 -0700)]
Add autocrypt source files to POTFILES.in

5 years agoPrint an error message if an autocrypt key can't be found.
Kevin McCarthy [Fri, 26 Jul 2019 22:59:47 +0000 (15:59 -0700)]
Print an error message if an autocrypt key can't be found.

5 years agoHandle autocrypt message decryption.
Kevin McCarthy [Fri, 26 Jul 2019 20:55:46 +0000 (13:55 -0700)]
Handle autocrypt message decryption.

Try autocrypt first for crypt_pgp_decrypt_mime() and
pgp_gpgme_encrypted_handler().

Propagate the autocrypt bit if successful.  This is used when replying
to an autocrypt message, to force a reply using autocrypt.

5 years agoSlightly improve the gossip header key update.
Kevin McCarthy [Fri, 26 Jul 2019 02:12:32 +0000 (19:12 -0700)]
Slightly improve the gossip header key update.

Don't set an empty peer.gossip_keydata with a value that matches the
current peer.keydata.  This just wastes space.

5 years agoFix process_gossip_headers() to look at the right envelope.
Kevin McCarthy [Thu, 25 Jul 2019 01:59:07 +0000 (18:59 -0700)]
Fix process_gossip_headers() to look at the right envelope.

5 years agoAutocrypt outgoing emails.
Kevin McCarthy [Sun, 21 Jul 2019 22:15:06 +0000 (15:15 -0700)]
Autocrypt outgoing emails.

Change crypt_get_keys() to query autocrypt.

When oppenc_mode is set, we still query the original keyring
regardless, because the compose menu can still run oppenc even if
autocrypt is on.

Since mutt_autocrypt_ui_recommendation() checks each key as part of
making the recommendation, add a keylist parameter and use that
function.

Add gpgme changes to use the autocrypt context for encryption.

Postpone work:
* Change mutt_protect() to have a postpone parameter.  Remove the
  manual toggling of the SIGN bit outside the call when postponing.

* Since autocrypt doesn't set the SIGN bit, this allows us to turn off
  signing inside mutt_protect() for both normal and autocrypt mode.

* Set the autocrypt postpone key in AutocryptDefaultKey.

Write autocrypt and gossip headers in outgoing emails.

5 years agoAdd autocrypt line to the compose menu.
Kevin McCarthy [Fri, 19 Jul 2019 19:54:32 +0000 (12:54 -0700)]
Add autocrypt line to the compose menu.

Remove the hardcoded HDR_ATTACH offset calcuation, and add an explicit
enum for the "-- Attachments" line to make loops and padding array
sizes easier.

Add security and recommendataion fields on the line.

Add mutt_autocrypt_ui_recommendation, following the autocrypt spec
guidelines.

5 years agoAdd another HEADER security bit for autocrypt.
Kevin McCarthy [Sat, 20 Jul 2019 21:48:06 +0000 (14:48 -0700)]
Add another HEADER security bit for autocrypt.

5 years agoChange gossip header address comparison to use normalized addresses.
Kevin McCarthy [Thu, 18 Jul 2019 20:22:52 +0000 (13:22 -0700)]
Change gossip header address comparison to use normalized addresses.

5 years agoChange autocrypt_db normalization to return ADDRESS.
Kevin McCarthy [Thu, 18 Jul 2019 20:19:47 +0000 (13:19 -0700)]
Change autocrypt_db normalization to return ADDRESS.

This makes reusing the code in autocrypt.c easier.

5 years agoAdd gossip header processing.
Kevin McCarthy [Tue, 16 Jul 2019 01:36:57 +0000 (18:36 -0700)]
Add gossip header processing.

5 years agoConvert to use sqllite3_prepare_v3().
Kevin McCarthy [Mon, 15 Jul 2019 01:59:28 +0000 (18:59 -0700)]
Convert to use sqllite3_prepare_v3().

The documentation suggests the SQLITE_PREPARE_PERSISTENT flag is
helpful for long-lived prepared statements, and Mutt is using.

5 years agoProcess autocrypt headers.
Kevin McCarthy [Fri, 12 Jul 2019 01:45:45 +0000 (18:45 -0700)]
Process autocrypt headers.

Create/update peer database accounts and gpg keys based on the headers.

5 years agoAdd autocrypt header parsing to mutt_parse_rfc822_line().
Kevin McCarthy [Fri, 12 Jul 2019 01:06:56 +0000 (18:06 -0700)]
Add autocrypt header parsing to mutt_parse_rfc822_line().

Convert parse_parameters() for autocrypt header usage:

  * change to use a BUFFER to accomodate large autocrypt keydata
    attribute values.

  * Autocrypt header parameters are not rfc2231 compliant.  Rather
    than rolling another very similar function, just change the
    existing one to allow space separation.

5 years agoAdd initial autocrypt account setup.
Kevin McCarthy [Tue, 9 Jul 2019 03:58:32 +0000 (20:58 -0700)]
Add initial autocrypt account setup.

Generate gpg key and add account record to the database.

5 years agoFactor out mutt_edit_address() in send.c.
Kevin McCarthy [Mon, 8 Jul 2019 22:23:44 +0000 (15:23 -0700)]
Factor out mutt_edit_address() in send.c.

For reuse by autocrypt for address prompts.

5 years agoStart autocrypt gpgme.
Kevin McCarthy [Sun, 7 Jul 2019 21:37:52 +0000 (14:37 -0700)]
Start autocrypt gpgme.

Add a basic init function.

Bump up the required gpgme version to 1.8.0 if autocrypt is enabled.

5 years agoAdd database and schema initialization.
Kevin McCarthy [Sat, 6 Jul 2019 21:01:13 +0000 (14:01 -0700)]
Add database and schema initialization.

Add mutt_mkdir() library function supporting recursive mkdir.

5 years agoAdd autocrypt config vars.
Kevin McCarthy [Sat, 6 Jul 2019 18:35:22 +0000 (11:35 -0700)]
Add autocrypt config vars.

5 years agoInitial autoconf and makefile setup for autocrypt.
Kevin McCarthy [Thu, 4 Jul 2019 02:51:09 +0000 (19:51 -0700)]
Initial autoconf and makefile setup for autocrypt.

5 years agoAdd a comment to the OPTIGNOREMACROEVENTS km_dokey() change.
Kevin McCarthy [Sun, 28 Jul 2019 17:13:22 +0000 (10:13 -0700)]
Add a comment to the OPTIGNOREMACROEVENTS km_dokey() change.

The option was added in commit 53900afa, and its actual purpose was
to separate out an "unget" event buffer from the "macro" buffer, to
solve a problem with certificate prompts.

The safest approach in a low-level function like km_dokey() was to
return an error if new macros were generated when the option is set.
However, this results in an unbuffered username/password prompt being
aborted.

Currently the only users of unbuffered input are the SSL certificate
prompts, which use menu->dialog mode (and thus mutt_getch() directly)
and username/password prompts.  So the only affected cases are
editor-menu prompts, and returning the pressed keys is likely less
surprising than aborting the prompt.

If other unbuffered menus are created in the future, we may want to
add a check for which menu mode is being used.

5 years agoChange OPTIGNOREMACROEVENTS to actuallly ignore macros instead of throwing errors...
Oneric [Fri, 26 Jul 2019 11:54:12 +0000 (13:54 +0200)]
Change OPTIGNOREMACROEVENTS to actuallly ignore macros instead of throwing errors on macros

5 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 26 Jul 2019 01:23:38 +0000 (18:23 -0700)]
Merge branch 'stable'

5 years agoFix accidental fall-through for <quote-char> if aborted.
Kevin McCarthy [Fri, 26 Jul 2019 01:18:08 +0000 (18:18 -0700)]
Fix accidental fall-through for <quote-char> if aborted.

If <quote-char> was aborted, it was falling through to the
<transpose-chars> function.

This problem was introduced 19 years when the <transpose-chars> case
was moved below <quote-char>.  Previously it fell through to the
default case which beeped.

5 years agoAdded * option to unattachments command
Andrew Marks [Fri, 5 Jul 2019 15:44:21 +0000 (08:44 -0700)]
Added * option to unattachments command

The * option clears all previous attachments settings. A
list_free_generic method is added to muttlib to enable generic freeing
of specific LIST structures. free_attachments_data is used with
list_free_generic to clear four LISTs which manage allowed and excluded
inline and attached "attachments"

refs #1

5 years agoAdd builds.sr.ht CI manifests
Drew DeVault [Thu, 18 Jul 2019 20:16:15 +0000 (16:16 -0400)]
Add builds.sr.ht CI manifests

For Alpine Linux (musl libc), Debian (glibc), and FreeBSD.

5 years agoFix a reference to HeaderCachePageSize.
Kevin McCarthy [Thu, 18 Jul 2019 20:44:19 +0000 (13:44 -0700)]
Fix a reference to HeaderCachePageSize.

Commit 4c728278 converted the config far to type DT_LNUM, but
embarrassingly I missed a usage.

5 years agoOmit User-Agent: header by default
Daniel Kahn Gillmor [Sun, 14 Jul 2019 01:49:05 +0000 (21:49 -0400)]
Omit User-Agent: header by default

The User-Agent: header can be fun and interesting and useful for
debugging, but it also leaks quite a bit of information about the user
and their software stack.

This represents a potential security risk (attackers can target the
particular stack) and also an anonymity risk (a user trying to
preserve their anonymity by sending mail from a non-associated account
might reveal quite a lot of information if their choice of mail user
agent is exposed).

Users who want to configure `user_agent` to `yes` can still do so, but
it makes sense to have safer defaults.

Closes: #159
5 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 28 Jun 2019 20:00:57 +0000 (13:00 -0700)]
Merge branch 'stable'

5 years agoDon't read or save history if $history_file isn't set.
Kevin McCarthy [Fri, 28 Jun 2019 19:57:24 +0000 (12:57 -0700)]
Don't read or save history if $history_file isn't set.

5 years agoRemove unnecessary "" checks for DT_STR and DT_PATH MuttVars.
Kevin McCarthy [Thu, 27 Jun 2019 22:35:12 +0000 (15:35 -0700)]
Remove unnecessary "" checks for DT_STR and DT_PATH MuttVars.

MuttVars of those types are set via safe_strdup(), which returns NULL
if the original is "".  Thus Var implies *Var.

A good portion of the code relies on that axiom, but over the years
some (Var && *Var) checks have crept in, including from me.

This was partially because of the INITVAL("") that were in the code,
which implied (incorrectly) the initial value could be "".  Commit
2f91d43e removed those to make it more clear.

This commit removes the *Var checks to make it even clearer, and help
avoid them creeping back in again.

5 years agoConvert $header_cache_pagesize to type DT_LNUM.
Kevin McCarthy [Thu, 27 Jun 2019 18:06:19 +0000 (11:06 -0700)]
Convert $header_cache_pagesize to type DT_LNUM.

Prior to commit 4bc76c2f there was no LNUM type, and so the workaround
was to store it as a string, converting in the hcache_open_gdbm()
call.

This will not affect the user interface or config file, because DT_NUM
and DT_LNUM read in a string from the config file and convert to a
number.  Quotes are used for escaping style, not passed through to the
variable setter.

So essentially this simply moves the conversion to parse_set(), and
provides feedback for a non-numeric type immediately.

5 years agoConvert Commands to use the union pointer_long_t too.
Kevin McCarthy [Tue, 25 Jun 2019 21:25:33 +0000 (14:25 -0700)]
Convert Commands to use the union pointer_long_t too.

As with MuttVars, Commands was using an unsigned long to hold pointers
as well as enums.  Convert to use the same union type of MuttVars.

Adjust command functions data parameter type to the union.  Since
these are used outside init.c, relocate the union definition to
mutt.h.

Although the number of functions affected was long, most of them did
not need much adjustment.  Many of them made no use of the parameter.
Those that did were easily cast into an added "data" variable at the
top.

5 years agoFix the makedoc program to cope with the new MuttVars format.
Kevin McCarthy [Tue, 25 Jun 2019 02:41:30 +0000 (19:41 -0700)]
Fix the makedoc program to cope with the new MuttVars format.

Add '=' to token delimiter, to make the parsing more robust if
someone decides to add spaces between a designator and value.

5 years agoConvert MuttVars.data and .init to use a union type.
Kevin McCarthy [Tue, 25 Jun 2019 01:07:54 +0000 (18:07 -0700)]
Convert MuttVars.data and .init to use a union type.

They were using an "unsigned long" and casting to a pointer when
needed.  Obviously this has "worked" for a long time, but it's not
correct to assume a pointer can fit in unsigned long.

Replace with a union contain "void *p" and "long l".  Fortunately, the
only parts making direct use of MuttVars are in init.h and init.c, so
we just need to update those manipulation functions.

In general I don't like single letter variables, but brevity is worth
it in this case.

5 years agoDetail the documentation of %l for index_format.
Vincent Lefevre [Sun, 23 Jun 2019 00:05:43 +0000 (02:05 +0200)]
Detail the documentation of %l for index_format.

5 years agoAdd NULL checks to rfc1524_free_entry().
Kevin McCarthy [Sat, 22 Jun 2019 23:13:46 +0000 (16:13 -0700)]
Add NULL checks to rfc1524_free_entry().

The existing code was fine, but make it robust like other free
functions in mutt, so the behavior isn't surprising.

5 years agoClean up mutt_print_attachment() cleanup.
Kevin McCarthy [Sat, 22 Jun 2019 23:01:19 +0000 (16:01 -0700)]
Clean up mutt_print_attachment() cleanup.

Check if mutt_save_attachment() fails and abort the print in that
case.