summaryrefslogtreecommitdiffstats
path: root/copy.c
AgeCommit message (Collapse)Author
2016-06-18pass context in mx_close_messageDamien Riegel
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.
2016-05-09Change M_* symbols to MUTT_*Derek Martin
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.
2016-04-27Modify the pager to use windows.Kevin McCarthy
The pager view is somewhat complex, due to the "mini-index" and the positioning of the index_status vs pager_status changes depending on $status_on_top as well as $pager_index_lines and $help. To make things simpler, it creates four "pager windows": index_status_window, index_window, pager_status_window, pager_window. mutt_term_width() is renamed to mutt_window_wrap_cols() and a mutt_window_t parameter passed in. Also, the pager drawing loop calling display_line() has a mutt_window_move() added to move to the beginning of the next line each time. This is in case the pager_window isn't flush with the left side of the terminal.
2016-01-01Update copyright notices.Kevin McCarthy
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.
2014-03-11Fix buffer overrun caused by not updating a string length after address ↵Michael Elkins
expansion.
2012-07-08Fix some spelling errors (closes #3493)Antonio Radici
2010-03-02Fix thinko in [cc02f079b1b9]Brendan Cully
2010-03-01Guard dequote with NULL check on personal fieldBrendan Cully
2010-03-01Another attempt to dequote RFC2047-encoded address comments (see #2014)Brendan Cully
2009-06-13Rewrite header foldingRocco Rutte
We now distinct between sending and display case. For display, we always use tabs for folding for readability; for sending we now correctly fold using whitespace found in the header. Closes #2995. Closes #3080.
2009-06-11Don't reformat Return-Path (angle brackets are not optional). Closes #1702.Rocco Rutte
2009-03-15Use safe_fclose() instead of fclose(), add fclose() to check_sec.shRocco Rutte
2008-07-10Fix three bugs handling flags in mutt_copy_headerAron Griffis
1. mutt_copy_header incorrectly tests CH_UPDATE to determine whether to write the In-Reply-To and References headers. CH_UPDATE refers only to Status: and X-Status: 2. mutt_copy_header ignores CH_NOSTATUS which is supposed to indicate that the mailbox type doesn't use those headers. 3. mutt_copy_header tests h->env->irt_changed and h->env->refs_changed when it should be testing CH_UPDATE_IRT and CH_UPDATE_REFS, respectively. Early in the function this happens: if (h->env) flags |= (h->env->irt_changed ? CH_UPDATE_IRT : 0) | (h->env->refs_changed ? CH_UPDATE_REFS : 0); This means that for most callers, the result is the same, but mutt_copy_header should be testing the flags because the caller might have set them explicitly without setting irt_changed/refs_changed. Signed-off-by: Aron Griffis <agriffis@n01se.net>
2008-07-24Remove variables no longer used since [7729b1ad530c]Brendan Cully
2008-07-10Unify mutt_write_referencesAron Griffis
copy.c and sendlib.c have independent and different implementations of writing references to a file. Choose the one in sendlib since it's conservative with mallocs and supports trimming the list. Signed-off-by: Aron Griffis <agriffis@n01se.net>
2008-07-10Clean up error handling in mutt_copy_headerAron Griffis
mutt_copy_header unnecessarily tests the result of each fputc/fputs (well, most of them anyway, it's not consistent). This obfuscates the code and hides bugs. Remove these extraneous checks since ferror/feof are checked at the bottom of the function, and get rid of all the early returns. Signed-off-by: Aron Griffis <agriffis@n01se.net>
2008-07-01Bail out of copy if decryption is requested but the desired engine is missing.Brendan Cully
This closes #2684, but handling of mixed crypto in a single message needs more investigation.
2008-07-01When deleting attachments, always print newline separating header from body.rtc
Closes #3085.
2008-06-25Make mutt_copy_message distinguish between fatal and non-fatal errors.Brendan Cully
Non-fatal errors should prevent moving messages, since they indicate data loss. But mutt should still attempt to display them, since being able to see some attachments is better than nothing. Also stop printing out non-PGP material in application/pgp attachments. Closes #2545, #2912.
2007-11-08Turn down some debug logging levelsBrendan Cully
2007-04-07Fix some compiler warningsFabian Groffen
2007-03-12Improve strcat usage (#2802).Sami Farin
2007-03-03Add $wrap, which supersedes $wrapmargin.Brendan Cully
When set to a positive number, wrap at that column. When set to a negative number, keep that many characters empty on the right.
2007-01-09Smarter header wrapping -- different behavior for displayThomas Roessler
purposes and sent messages.
2006-08-16Do intelligent things with long header lines.Thomas Roessler
2005-10-21Full large file support. Keep a close watch on your mailboxes everyone!Brendan Cully
2005-09-29Ensure that Content-Length printf format specifier matches off_t size, toBrendan Cully
avoid mail-losing Content-Length: 0 (bug introduced by large file patch a couple of days ago). Closes: #2096.
2005-09-24Cosmetic fixes to MIME headers. Closes: #2086.Alain Bench
2005-09-17Gah, forgot the zip code when updating the FSF address...Brendan Cully
2005-09-17Update FSF address (via sed, I hope nothing got mangled). Closes: #2071.Brendan Cully
2005-08-11Add error results to mutt_body_handlers, and check them when doingBrendan Cully
decode-save. Closes: #1919.
2005-08-09Remove an unneeded cast, which introduces type-punning. Modified to use FREEMads Martin Joergensen
instead of safe_free, since that seems to be the convention. I personally don't see the point.
2005-07-25Get rid of IMAP-related special casing all over the thread editingThomas Roessler
code.
2005-07-24Add thread editing commands.Cedric Duval
2005-07-24Don't assume messages in MMDF mailboxes have From separators when copying them.Brendan Cully
Spotted by William Lovas. Initial patch by TAKAHASHI Tamotsu.
2005-02-03Add config.h to the top of every C file that could possibly want it.Brendan Cully
Remove it from mutt.h
2004-07-14$include_onlyfirst, again.TAKAHASHI Tamotsu
2004-07-14Fix a cvs commit SNAFU: This commit undoes the include_onlyfirstThomas Roessler
patch, but leaves the generic spam detection by David Champion in place (which, erroneously, hadn't been committed automatically).
2004-07-14Introduce $include_onlyfirst.TAKAHASHI Tamotsu
2004-04-12Fix #1804.Thomas Roessler
2003-09-19As the ones of you who compile with new gcc's probably have noticed,Mads Martin Joergensen
there's a lot of type-punning in Mutt. With help from Philipp Thomas, I've fixed all I could find in CVS (please double-check, one might have slipped through the cracks), I can make one for 1.4 CVS branch as well if wanted.
2003-08-05This patch removes the Kendra format from mutt. (The support wasBrendan Cully
broken anyways.)
2003-07-24Some functions/macros like isspace take an int and require theVincent Lefevre
argument to have the value of an unsigned char (or EOF). Under Solaris, gcc complains when the argument is a char (as this is a possible bug, on platforms where char is signed, like Solaris). The attached patch fixes such problems (well, perhaps I've changed more than necessary, but this doesn't hurt).
2003-03-12We need to re-format address headers instead of just decoding them.Thomas Roessler
2003-03-04Fix another stupid error, and decode IDNs in the CC header.Thomas Roessler
2003-03-03Fixing some nits.Thomas Roessler
2003-03-03IDN support for e-mail messages. Things should work automagicallyThomas Roessler
once you have the GNU IDN library available from ftp://alpha.gnu.org/pub/gnu/libidn/ installed. For IDN's which can't be losslessly recoded to your local character set, mutt should automatically fall back to using the ASCII representation. There's probably a considerable number of bugs in this, and the code may, at this point, not even compile on machines without libidn. Will start working on that ASAP.
2003-01-21- To cleanup the pgp/smime code and prepare for other backends.Werner Koch
- 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
2002-12-10Replace safe_free calls by the FREE macro.Thomas Roessler
2002-11-11Fix #1379 - update the total mailbox size when an attachment isMichael Elkins
deleted.