1. 01 Jun, 2018 1 commit
  2. 11 Jan, 2018 2 commits
    • Kevin J. McCarthy's avatar
      Add missing setup calls when resuming encrypted drafts. · 667a4710
      Kevin J. McCarthy authored
      Calls to get the passphrase were missing for app/pgp and app/smime.
      App/smime was also missing a call to crypt_smime_getkeys().
      
      If a failure occurs, report it back, rather than just continuing.
      Otherwise, postponed messages could be completely lost.
      667a4710
    • Kevin J. McCarthy's avatar
      Create pgp and s/mime default and sign_as key vars. (see #3983) · db252e61
      Kevin J. McCarthy authored
      The $postpone_encrypt and $(pgp/smime)_self_encrypt configuration
      variables have created a somewhat messier situation for users.  Many
      of them now have to specify their keys across multiple configuration
      variables.
      
      (Trac) Ticket #3983 had a reasonable request: "if my encrypt and
      signing keys are the same, why can't I just specify my key once in my
      .muttrc?"
      
      The problem currently is that $smime_default_key and $pgp_sign_as are
      both used to specify signing keys, and are set by the "sign (a)s"
      security menu choice.  So we can't store encryption keys there because
      some users have separate sign-only capability keys.
      
      Create $pgp_default_key to store the default encryption key.  Change
      signing to use $pgp_default_key, unless overridden by $pgp_sign_as.
      The pgp "sign (a)s" will continue setting $pgp_sign_as.
      
      Create $smime_sign_as.  Change signing to use $smime_default_key
      unless overridden by $smime_sign_as.  Change s/mime "sign (a)s" menu
      to set $smime_sign_as instead.
      
      Change $postpone_encrypt and $(pgp/smime)_self_encrypt to use
      $(pgp/smime)_default_key by default.
      
      Mark $(pgp/smime)_self_encrypt_as deprecated.  They are now aliases
      for the $(pgp/smime)_default_key config vars.
      
      Change $(pgp/smime)_self_encrypt default to set.
      
      The intent is that most users now need only set
      $(pgp/smime)_default_key.  If they have a sign-only key, or have
      separate signing and encryption keys, they can put that in
      $(pgp/smime)_sign_as.  This also enables to default self_encrypt on
      and solve a very common request.
      
      Thanks to Michele Marcionelli and Vincent Lefèvre for gently pushing
      me towards a solution.
      db252e61
  3. 05 May, 2017 1 commit
    • Kevin J. McCarthy's avatar
      Change message modifying operations to additively set redraw flags. · dff811a2
      Kevin J. McCarthy authored
      With the ability to set redraw flags with the menu stack operations,
      some operations internally modify the current menu redraw flag.
      For instance, _mutt_set_flag() can now set REDRAW_SIDEBAR.
      
      Change the ops that modify messages to use 'redraw |= REDRAW_X'
      instead of overwriting the flag value.
      dff811a2
  4. 27 Mar, 2017 1 commit
  5. 03 Sep, 2016 1 commit
  6. 18 Jul, 2016 1 commit
    • Kevin J. McCarthy's avatar
      Add the trash folder patch. · 347c517c
      Kevin J. McCarthy authored
      This is based on the trash folder patch by Cedric Duval.
      Modifications to the original patch are:
      
      * Use a flag called M_PURGE instead of M_APPENDED.  The same flag is
        then used in the following "purge" patch instead of adding a
        different flag.
      
      * Removed the counter in context.  The existing context->deleted
        is all that's needed.
      
      * Removed the "auto unset M_PURGE" when M_DELETED is unset inside
        _mutt_set_flag(), although this is convenient, it easily leads to
        header->purge not being reset in a few situations.
      
      * Reset purge flag along with the deleted flag if $delete is answered
        no.
      
      * Set M_PURGE on an edited message. (edit_one_message())
      
      * Preserve purge flag in mutt_reopen_mailbox()
      
      * Turn off OPTCONFIRMAPPEND when saving to the trash, rather than
        hardcoding it off in mutt_save_confirm().  That way, normal save to the
        folder will respect the option.
      347c517c
  7. 18 Jun, 2016 1 commit
    • Damien R.'s avatar
      pass context in mx_close_message · 6355572e
      Damien R. authored
      The mx_close_message is one of the few mx_* functions that don't have a
      context as parameter. To make them more consistent, pass the context.
      6355572e
  8. 09 May, 2016 1 commit
    • Derek Martin's avatar
      Change M_* symbols to MUTT_* · 9cafb05c
      Derek Martin authored
      Changeset 23334e967dd7 created a workaround for a namespace conflict
      with Solaris and derivatives.  After some discussion, the team decided
      it would be best to move away from using the "M_" prefix for macros.
      
      This patch was automatically generated by running:
        perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print`
      with the exception that sys_socket.h was exempted.  (That file will
      be backed out subsequent to this commit.)
      
      Thanks to Andras Salamon for supplying the perl script used to make
      this change.
      9cafb05c
  9. 07 Feb, 2016 1 commit
    • Kevin J. McCarthy's avatar
      Fix pgp and smime decryption in mutt_prepare_template(). · bac3a154
      Kevin J. McCarthy authored
      Change the "combined" multipart decryption block to only work for pgp,
      since mutt_is_multipart_encrypted() currently only checks for pgp
      headers and it therefore only worked for pgp in the first place.
      
      Fix the newhdr->security to be based on what that function returns,
      instead of the "context" hdr passed in.
      
      Add a smime decryption block below when iterating through the content.
      
      Fix the application/pgp decryption block to assign to hdr->security
      using the type of the app/pgp part instead of hdr->content.
      bac3a154
  10. 01 Jan, 2016 2 commits
    • Kevin J. McCarthy's avatar
      Convert copyright years to all use 4 digit years. · 8ce41525
      Kevin J. McCarthy authored
      Vincent Lefèvre pointed out the common shortcut, e.g 1996-9, is
      actually not allowed for copyright years.  Convert all the copyright
      years (for mutt files) to use 4 digits.
      8ce41525
    • Kevin J. McCarthy's avatar
      Update copyright notices. · 1b329ffe
      Kevin J. McCarthy authored
      This patch only updates existing copyright notices in the source
      files, using commit dates since the last copyright update in commits
      e3af935cdb1a and f8fd60d8d3f2.
      
      Add a notice to the COPYRIGHT file to refer to our mercurial
      repository for the full commit history.
      
      Add myself to the COPYRIGHT file and smime_keys.pl file.
      1b329ffe
  11. 30 Mar, 2015 1 commit
    • Kevin J. McCarthy's avatar
      Add a security bit to the message for oppenc mode. · 15b61571
      Kevin J. McCarthy authored
      This allows oppenc to be enabled/disabled on a message level.  If
      something initially enables encryption, such as crypt_autoencrypt or
      crypt_replyencrypt, oppenc is turned off for the message.
      
      Change the postpone/resume code to persist the oppenc bit.
      
      Also change resend message to enable and invoke oppenc if the option is
      set.
      15b61571
  12. 02 Feb, 2015 1 commit
    • Kevin J. McCarthy's avatar
      Fix mutt_parse_crypt_hdr() sign_as behavior. · 9ec02bba
      Kevin J. McCarthy authored
      Currently, if a message is postponed with only the E encryption flag,
      when it is resumed, pgp_sign_as will be overwritten (with an empty
      string).
      
      This intention of the behavior was probably to restore the exact state
      of pgp_sign_as upon resuming.  However, if the message wasn't marked for
      signing, the state of pgp_sign_as is not known.  This patch changes the
      mutt_parse_crypt_hdr() to only set an empty pgp_sign_as if there is an S
      flag (and if set_empty_signas is true).
      
      mutt_edit_headers() also uses the function, but it doesn't want to
      overwrite pgp_sign_as with just an S flag.  The set_signas parameter is
      renamed to (a hopefully clearer) "set_empty_signas".
      9ec02bba
  13. 04 Oct, 2013 1 commit
  14. 26 Apr, 2013 2 commits
    • Kevin J. McCarthy's avatar
      Fix postpone/resume to not remove a Mail-Followup-To header (closes #3070) · acbd9d38
      Kevin J. McCarthy authored
      This solution changes mutt_prepare_template() to check whether the
      message_id field is NULL to decide whether to wipe the message-id and
      mail-followup-to headers when instantiating the message.
      
      If we are resending a message, we don't want the previous message-id
      and mail-followup-to headers.  If we are resuming a postponed message,
      however, we want to keep the mail-followup-to header if any was set
      before the postpone.
      (grafted from d7d83298011a6e7aa31bde49e0b6b21209a85fd2)
      acbd9d38
    • Kevin J. McCarthy's avatar
      Fix postpone/resume to not remove a Mail-Followup-To header (closes #3070) · 3c44f482
      Kevin J. McCarthy authored
      This solution changes mutt_prepare_template() to check whether the
      message_id field is NULL to decide whether to wipe the message-id and
      mail-followup-to headers when instantiating the message.
      
      If we are resending a message, we don't want the previous message-id
      and mail-followup-to headers.  If we are resuming a postponed message,
      however, we want to keep the mail-followup-to header if any was set
      before the postpone.
      3c44f482
  15. 18 Dec, 2012 1 commit
    • Michael Elkins's avatar
      rename iswsp() to is_email_wsp() · 90eb6a39
      Michael Elkins authored
      add new inline funtion skip_email_wsp() to be used in lieu of SKIPWS() when parsing ASCII protocols rather than user input.
      
      change use of SKIPWS() to skip_email_wsp() in places where it is likely to be a problem.
      90eb6a39
  16. 03 Dec, 2011 1 commit
    • Dan Fandrich's avatar
      Declare many structures const (closes #3552) · 05df9d08
      Dan Fandrich authored
      Many structs used in mutt are actually constant but are defined
      without the 'const' keyword. This can slow initialization (slightly)
      in some environments due to extra copying and increases the amount of
      writable RAM required at run-time, which can be significant on non-MMU
      systems. Using const can also increase the opportunities for compiler
      optimization.
      
      The attached patch marks many such structures as const. On my test x86
      build, this reduces the size of .data by over 50%.
      05df9d08
  17. 09 Aug, 2010 1 commit
  18. 13 Jun, 2009 1 commit
  19. 17 Mar, 2009 1 commit
  20. 15 Mar, 2009 1 commit
  21. 04 Jan, 2009 2 commits
  22. 17 Dec, 2008 1 commit
  23. 30 Nov, 2008 1 commit
    • Rocco Rutte's avatar
      Manage last search pattern outside of menu lifecycle · 30541be3
      Rocco Rutte authored
      Previously, the pattern was thrown away during menu destruction.
      For the next search, mutt then can't provide a good suggestion.
      The new behaviour is to manage the pattern outside the lifecyle
      to always provide the last pattern as suggestion.
      30541be3
  24. 02 Jul, 2008 1 commit
  25. 20 Mar, 2007 1 commit
    • Rocco Rutte's avatar
      Enlarge help string buffers · 64f58f42
      Rocco Rutte authored
      Even on 80x25 terminals, SHORT_STRING (128 byte) may not be enough so use
      LONG_STRING (1k) as STRING (256 byte) may well be too short for wider
      terminals. Closes debian #4152777.
      64f58f42
  26. 20 Apr, 2006 1 commit
  27. 03 Jan, 2006 1 commit
  28. 13 Dec, 2005 1 commit
  29. 21 Oct, 2005 1 commit
  30. 17 Sep, 2005 2 commits
  31. 03 Feb, 2005 1 commit
  32. 27 Jun, 2004 1 commit
  33. 12 Apr, 2004 1 commit
  34. 03 Sep, 2003 1 commit
    • Dan Fandrich's avatar
      I've attached a patch for bug number 1036, as reported at · 3d8baab5
      Dan Fandrich authored
      http://bugs.guug.de/db/pa/lmutt.html ("segfault when more than one
      msg is postponed").  This is a patch against mutt 1.4.1.
      
      As it was previously left, no one could reproduce it.  The problem
      occurs because sorting is disabled when opening the postponed
      folder, but the Sort global variable still tells mutt to use
      whatever sorting algorithm the $sort config option indicates.
      Eventually, the code would get to mutt_messages_in_thread and try to
      dereference a NULL thread object, causing the segfault.
      3d8baab5
  35. 21 Jan, 2003 1 commit
    • Werner Koch's avatar
      - To cleanup the pgp/smime code and prepare for other backends. · c901be35
      Werner Koch authored
       - Support gpg-agent by not asking for a passphrase
       - autconf cleanups.
      
      This is just a start and probably we need a couple of other things to
      do. One drawback is that the help menu does always list all crypto
      realted stuff even when configured for no crypto at all.  Same goes
      for the configure options but I consider thsi a feature: It allows to
      use the same .muttrc for different versions of mutt - at least during
      development, this is an advantage.  This all might be fixed but
      requires some changes to the configuration system.
      
      Note, the use of the WithCrypto macro - it enables the compiler to do
      dead-code-elimination depending on the configured backend.  This is
      better readable than all the nested ifdefs.  I did some short tests
      and it seems to work, althoug mutt's size does not change largely when
      compiled w/o crypto.
      
      cryptglue.c is new as a warpper to all crypto calls; some are still in
      crypt.c but they should eventually also be wrapped.  We don't use
      function pointers to keep a path to use dlopen or runtime configured
      backends.  crypt.h is also new and replaces pgp.h and smime.h in most
      files (except for the backend).
      
      
      
      2003-01-06  Werner Koch  <wk@gnupg.org>
      
      	* crypt.c (crypt_valid_passphrase): Detect gpg-agent and don't ask
      	for the passphrase.
      	* pgp.c (pgp_decrypt_part, pgp_application_pgp_handler)
      	(pgp_sign_message, pgp_encrypt_message)
      	(pgp_traditional_encryptsign): Make sure that we never ever send
      	the passphrase if the gpg-agent has been detected.  Likewise.
      
      	* acconfig.h: Removed all remaining stuff as AC_TEMPLATEs to
      	configure.in. BTW, we should consider to rename configure.in to
      	configure.ac.
      
      2003-01-04  Werner Koch  <wk@gnupg.org>
      
              Replaced the use of HAVE_PGP and HAVE_SMIME by a more readable
      	and extendable solution.
      
      	* pgplib.h: Moved enum pgp_ring and KEYFLAGS_* to
      	* crypt.h: here.
      	* smime.c (mutt_is_application_smime): Moved to
      	* crypt.c (mutt_is_application_smime): here.
      	* pgp.c (mutt_is_application_pgp): Moved to
      	* crypt.c (mutt_is_application_pgp): here.
      	* pgp.c (pgp_is_multipart_encrypted): Removed. Merged code with
      	* crypt.c (mutt_is_multipart_encrypted): this.
      
      	* mutt.h: Protect against double inclusion.
      
      	* pgplib.h (struct pgp_keyinfo): Remove the typedef to pgp_key_t.
      	* crypt.h (pgp_key_t): Declare the typedef here.  NOTE:  This is
      	now a pointer.  Changed all usages accordingly.
      
      	* configure.in: Replace HAVE_PGP and HAVE_SMIME by the new
      	CRYPT_BACKEND macros.  Always include all OPS.*.
      	(LIBOBJ): Replaced by AC_LIBOBJ as required by newer autoconfs.
      	* Makefile.am (EXTRA_mutt_SOURCES): Move crypt.c to mutt_SOURCES.
      	(mutt_SOURCES): Add cryptglue.c
      	(EXTRA_DIST): Add crypt.h
      
      	* pgp.h, pgplib.h, smime.h: Use the header only when the
      	approriate backend has been configured.
      	* pgp.c, pgpkey.c, smime.c: Build only if the approriate
      	CRYPT_BACKEND_ macro is defined.
      	* pgp.h, smime.h, global.h: Moved all variable declarations to
      	global.h because they are now always defined.
      
      	* sort.h: Always define PgpSortKey, although it does not belong to
      	here.
      
      	* keymap.h: Unconditionally include all PGP and SMIME stuff.
      	* mutt.h: Ditto.
      	* protos.h: Ditto.
      
      	* init.h (HAVE_SMIME): Unconditionally include all crypto related
      	definitions.  Mark the doc entries with "(Crypto/PGP/SMIME only)".
      
      	* globals.h: Replace gpg.h and smime.h by crypt.h.
      
      	* functions.h: Always include all crypto commands.
      
      	* copy.h: Unconditionally define the crypto related M_CM_
      
      	* pgplib.h: Move APPLICATION_PGP and PGP* to crypt.h and include
      	it.
      	* smime.h: Move APPLICATION_SMIME and SMIME* to crypt.h and
      	include it.
      	* mutt_crypt.h (ENCRYPT,SIGN,GOODSIGN, BADSIGN): Move to crypt.h.
      
      	* crypt.c: Replaced pgp.h and smime.h header by crypt.h.  Always
      	include all functions but shortcut them depending on WITHCRYPTO.
              All over the place use WITHCRYPTO instead of ifdefs.  Replaced all
      	direct calls of the backend fucntions by twrapper functions
      	defined in cryptglue.c
      	(crypt_get_keys): Removed prototypes.
      	* pgp.h (pgp_findKeys): New prototype.
      	* smime.h (smime_findKeys): New prototype.
      	* cryptglue.c: New.
      	* crypt.h: New.
      	* mutt_crypt.h: Moved all crypt_* prototypes to gcrypt.h.
      	Unconditionally use this file.
      
      	* init.c: Replaced pgp.h and smime.h header by crypt.h.
      	(parse_set): Use WITHCRYPTO instead of ifdefs.
      	(mutt_var_value_complete): Ditto.
      
      	* sendlib.c: Replaced pgp.h and smime.h header by crypt.h.
      	(write_as_text_part): Now one macro using WITHCRYPTO.
      	(mutt_write_mime_body): Use WITHCRYPTO instead of ifdefs.
      	(mutt_make_message_attach): Ditto.
      	(mutt_write_fcc): Ditto.
      
      	* send.c: Replaced pgp.h and smime.h header by crypt.h.
      	(include_forward): Use WITHCRYPTO and validate passphrases for pgp
      	and smime.
      	(include_reply): Ditto.
      	(generate_body): Use WITHCRYPTO instead of ifdefs.
      	(ci_send_message): Ditto.
      
      	* recvattach.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_gen_attach_list): Use WITHCRYPTO instead of ifdefs.
      	(mutt_attach_display_loop): Ditto
      	(mutt_view_attachments): Ditto.
      
      	* postpone.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_get_postponed): Use WITHCRYPTO instead of ifdefs.
      	(mutt_parse_crypt_hdr): Always include and use WITHCRYPTO instead
      	of ifdefs.
      	(mutt_prepare_template): Use WITHCRYPTO instead of ifdefs.
      
      	* pop.c: Removed pgp.h and smime.h.
      	(pop_fetch_message): Use WITHCRYPTO instead of ifdefs.
      
      	* pattern.c: Replaced pgp.h and smime.h header by crypt.h.
      	(Flags): Always include the crypto flags.
      	(msg_search): Use WITHCRYPTO instead of ifdefs.
      	(mutt_pattern_exec): Ditto.
      
      	* parse.c: Removed pgp.h and smime.h.
      	(mutt_parse_mime_message): Use WITHCRYPTO instead of ifdefs.
      
      	* pager.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_pager): Use WITHCRYPTO instead of ifdefs.
      
      	* mx.c: Removed smime.h and pgp.h.
      	(mx_update_context): Use WITHCRYPTO instead of ifdefs.
      
      	* muttlib.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_needs_mailcap): Use WITHCRYPTO. Note, that there used to be
      	an error when PGP was not configured so that TYPEAPPLICATION was
      	not recognized for SMIME.
      	(mutt_is_text_part): Use WITHCRYPTO instead of ifdefs.
      
      	* main.c: Include crypt.h.
      	(show_version): Remove HAVE_PGP and HAVE_SMIME.  Add
      	CRYPT_BACKEND_CLASSIC_PGP, CRYPT_BACKEND_CLASSIC_SMIME.
      
      	* keymap.c: Include crypt.h so that we can test WITHCRYPTO.
      	(Menus): Always include pgp and smime.
      	(km_init): Create smime and pgp bindings depending on WITHCRYPTO.
      	(km_get_table): Return OpPgp depending on WITHCRYPTO.
      
      	* hook.c (mutt_parse_hook): Use WITHCRYPTO instead of ifdefs.
      	(mutt_crypt_hook): Always include.
      
      	* headers.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_edit_headers): Use WITHCRYPTO instead of ifdefs
      
      	* hdrline.c: Replaced pgp.h and smime.h header by crypt.h.
      	(hdr_format_str): Use WITHCRYPTO.
      
      	* handler.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_can_decode): Use WITHCRYPTO instead of ifdefs.
      	(mutt_can_decode): Application/smime is now also checked when PGP
      	support is not configured.
      	(mutt_body_handler): Use WITHCRYPTO
      
      	* curs_main.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_index_menu): Shortcut crypto only operations depending on
      	WITHCRYPTO.
      
      	* copy.c: Replaced pgp.h and smime.h header by crypt.h.
      	(_mutt_copy_message):
      
      	* compose.c: Replaced pgp.h and smime.h header by crypt.h.
      	(enum): Always include HDR_CRYPT and HDR_CRYPTINFO.
      	(redraw_crypt_lines): Always include this fnc but shortcut it
      	depending on WITHCRYPT.  Draw lines depending on the configured
      	crypto support.
      	(pgp_send_menu): Always include this one.  Call wrapper functions.
      	(smime_send_menu): Likewise.
      	(draw_envelope): Use WITHCRYPTO instead of ifdefs.
      	(mutt_compose_menu): Allow pgp/smime commands only when configured.
      
      	* commands.c: Replaced pgp.h and smime.h header by crypt.h.
      	(mutt_display_message,pipe_msg, _mutt_pipe_message)
      	(set_copy_flags, mutt_save_message, mutt_edit_content_type)
      	(_mutt_check_traditional_pgp): Use pgp wrapper.
      
      	* attach.c (mutt_view_attachment): Removed HAVE_GPG and HAVE_SMIME
      	and replaced by global variable WITHCRYPTO.  Replaced pgp and
      	smime header by crypt.h.x
      c901be35