summaryrefslogtreecommitdiffstats
path: root/mbox.c
AgeCommit message (Collapse)Author
2016-11-08Move mbox close-append logic inside mbox_close_mailbox().Kevin McCarthy
The mx_fastclose_mailbox() calls mx_ops->close(), which invokes mbox_close_mailbox(). Also, close the ctx->fp inside mbox_close_mailbox(). This way, the (to be added) compress logic can call the mx_ops->close() instead of "knowing" to close the fp before recompressing. mx_fastclose_mailbox() will safe_fclose() the fp again, but I'm leaving it there just in case I missed a usage of the fp in some other part of the code. Thanks to Damien Riegel for the original patch.
2016-08-01Convert mx_open_mailbox_append() to use ctx->mx_ops.Kevin McCarthy
Set the flag MUTT_NEWFOLDER to signal Maildir and MH to create the directory structure. Distribute the "open append" code to mbox, mh, and imap/imap.c. Set pop's mx_ops handler to NULL to signal it is not supported.
2016-07-31Move fflush and fsync to the mbox and mmdf commit_msg functions.Kevin McCarthy
The case statement in mx_commit_message() was previously distributed to the various ops->commit_msg() handlers, but the fflush and fsync were not.
2016-07-17Add the trash folder patch.Kevin McCarthy
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.
2016-06-18add commit_msg to struct mx_opsDamien Riegel
2016-06-18add mmdf_commit_message functionDamien Riegel
Move MMDF operations that were done in mx_commit_message to a dedicated mmdf_commit_message function.
2016-06-18add mbox_commit_message functionDamien Riegel
Move mbox operations that were done in mx_commit_message to a dedicated mbox_commit_message function.
2016-06-18add close_msg to struct mx_opsDamien Riegel
2016-06-17Add open_msg to struct mx_opsDamien Riegel
Add the callback to open an existing message to struct mx_ops. For mbox, mmdf, maildir, and mh, the code was implemented directly into mx_open_message, so it is moved in their respective source files. For imap and pop, there were already <mailbox>_fetch_message functions, but their argument order has been changed to pass the context as a first argument.
2016-06-07Make extended buffy independent of the sidebar.Kevin McCarthy
Add new boolean option $mail_check_stats (default off) and $mail_check_stats_interval. The first turns extended buffy on. The second sets the amount of time in between extended buffy checks (defaulting to 60 seconds). Remove the option $sidebar_refresh_time. Change mutt_buffy_check() to only notify the sidebar to redraw if a mailbox buffy value changes. Remove the #ifdefs around the extended buffy functions. The next patch will merge these functions with the basic functions and pass a parameter instead. Imap is a special case, because it sends out the status in one batch. Change this to perform the comparisons inside cmd_parse_status() and flag the sidebar there. It was previously directly assigning the status counters (unsigned int) to the buffy->new (short). Change this to assign 1/0.
2016-06-04Add neomutt version of sidebar patch. (closes #3829)Richard Russon
This is the patch from neomutt; branch 'devel/win-sidebar'; commit c796fa85f9cacefb69b8f7d8545fc9ba71674180 with the following changes: - move the sample muttrc and vimrc to contrib. - remove the README.sidebar. - empty out the PATCHES file.
2016-05-26add check operation to struct mx_opsDamien Riegel
In mx_check_mailbox switch case, we simply call <mailbox>_check_mailbox, so this operation can be move into the mx_ops structure pretty easily. This commit adds a mandatory "check" operation to struct mx_ops and change all mailboxes to use it. Check functions are made static as they are only used in their respective source files now.
2016-05-25add open_new_msg operation to struct mx_opsDamien Riegel
The code was already using a function pointer to do this operation. This commit moves this function pointer to the mx_ops structure and the open_new_message functions to their respective source files if it needs to.
2016-05-12Start decoupling mailbox operations.Damien Riegel
Introduce a dedicated structure for mailbox operations: struct mx_ops. Move the open and close operations into that structure. Assign this structure to the context in mx_open_mailbox. This is currently based on the "magic" for the mailbox type, but may be refactored in the future. Add a stub mbox_close_mailbox function. This function does nothing, the main purpose is to introduce a mx_ops structure for mbox, so its usage is similar to mh/imap/pop. We reuse the name that was made available by the previous commmit. Note that the actual closing of the descriptor is done in mx.c. To be more consistent with other mailboxes, introduce functions mh_open_mailbox and maildir_open_mailbox, and create a dedicated structure for mmdf.
2016-05-12rename mbox_close_mailbox to mx_close_mailbox_append and move itDamien Riegel
mbox_close_mailbox was used as the counterpart of mx_open_mailbox_append. To make things clearer, rename it mx_close_mailbox_append. As it is only used in mx.c, move it there and make it static.
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-03-15Prevent ctx->fp from being closed twice in the event of an error.Kevin McCarthy
The previous patch from Vincent exposed a crash if ftruncate() fails in mbox_sync_mailbox(). Change fclose() to safe_fclose(), to avoid it being called twice.
2016-03-15Check return value of ftruncate() in mbox_sync_mailbox().Vincent Lefevre
Generate an error in the event that ftruncate() fails.
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.
2013-07-23fix typos in commentsOndřej Bílka
2013-04-11backout c1371176ea45Michael Elkins
2013-04-10fix various compiler warnings; most were due to unchecked return values from ↵Michael Elkins
system calls.
2011-05-22Fix some minor warningsBrendan Cully
2010-09-20Fix typoEmanuele Giaquinta
2010-09-12add $mail_check_recent boolean to control whether Mutt will notify about all ↵Michael Elkins
new mail, or just new mail received since the last visit to a mailbox closes #3271 partly addresses #3310
2010-08-05when parsing From_ lines in mmdf/mbox, the TZ should be computed based on ↵Michael Elkins
the time in the string rather than the current time, otherwise DST issues cause the computed time to be wrong. closes #2177
2009-06-21Pass buffer size to mutt_mktemp()Rocco Rutte
2009-06-19Fixup atime for mbox/mmdf also when mailbox is unchanged but has new mail. ↵Rocco Rutte
See #1362.
2009-06-19Don't mangle atime/mtime for mbox folders without new mail upon sync. Closes ↵Rocco Rutte
#1362, #3271.
2009-06-18Backout experimental patchRocco Rutte
2009-06-18UPDATING: add note about -a and --Rocco Rutte
2009-06-10Only print messages about CONTEXT when quiet flag not setRocco Rutte
2009-05-30Keep new mail flag for mbox/mmdf folders after closing. Closes #1362.Rocco Rutte
2009-05-13Prune empty address groups when preparing replies. Closes #2875.Rocco Rutte
2009-05-13Actually reopen mbox/mmdf files in case we find modifications. Closes #2725.Rocco Rutte
Since the file is changed while we have it open in ctx->fp, we likely get wrong information when parsing the mailbox. Now we explicitely close and (re)open it.
2009-05-12Backout errorneously commited mbox atime fixRocco Rutte
2009-05-12Fix description for <save-message>Rocco Rutte
2009-03-15Use safe_fclose() instead of fclose(), add fclose() to check_sec.shRocco Rutte
2008-07-02Use realpath() in mutt_pretty_mailbox() for paths that may need it.Rocco Rutte
This requires to add the buffer size as parameter since the result may be longer than the original but still fit in the buffer. Closes #2948.
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.
2008-05-21Use ftello() instead of ftell() in more places that need it (fixesRocco Rutte
progress updates for >2 GB mbox files)
2008-03-11Respect ctx->quiet when initializing progress bar.N.J. Mann
2007-11-06Add percentages to progress bar optionally supplied by caller.Rocco Rutte
This is necessary to let the mbox driver print useful percentages. If there's no percentage given and we have a size, calculate on it on our own. Closes #2929.
2006-11-28Rename PROG_(SIZE|MSG) to M_PROGRESS_\1.Rocco Rutte
2006-11-21Teach mbox/mmdf to use the new progress update API.Rocco Rutte
2005-10-21Full large file support. Keep a close watch on your mailboxes everyone!Brendan Cully
2005-09-24Use fseeko/ftello when available while opening mbox/mmdf. Closes: #2084.Brendan Cully
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-01Restore Sort immediately after sorting by mailbox order in mbox_sync_mailbox.Brendan Cully
(closes #972)