From: Richard Russon Date: Sun, 22 May 2016 15:52:38 +0000 (+0100) Subject: merge: compress X-Git-Tag: neomutt-20160530~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1289724fb522e5b37d8aa76424f5fbcae4f597ef;p=neomutt merge: compress * feature: compress * fix code to match latest version of mutt * add docs * add ident to PATCHES * conditional build * reorder - static first * renames * whitespace * style - {}s, pointers, etc * comments * doc: check for installed patches --- 1289724fb522e5b37d8aa76424f5fbcae4f597ef diff --cc Makefile.am index 547a5773a,d36e7c631..3ce816ef7 --- a/Makefile.am +++ b/Makefile.am @@@ -81,21 -77,10 +81,25 @@@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP EXTRA_SCRIPTS = smime_keys +if BUILD_SIDEBAR +mutt_SOURCES += sidebar.c sidebar.h +endif + +EXTRA_DIST += OPS.SIDEBAR + +if BUILD_NOTMUCH +mutt_SOURCES += mutt_notmuch.c mutt_notmuch.h +mutt_LDADD += $(NOTMUCH_LIBS) +endif + +# kz +EXTRA_DIST += UPDATING.kz README.notmuch OPS.NOTMUCH + + + if BUILD_COMPRESS + mutt_SOURCES += compress.c compress.h + endif + mutt_dotlock_SOURCES = mutt_dotlock.c mutt_dotlock_LDADD = $(LIBOBJS) diff --cc PATCHES index a1cd1f56f,1fbac870b..dab0e5e6a --- a/PATCHES +++ b/PATCHES @@@ -1,14 -1,1 +1,15 @@@ +patch-quasi-delete-neo-UNKNOWN +patch-progress-neo-UNKNOWN +patch-status-color-neo-UNKNOWN +patch-index-color-neo-UNKNOWN +patch-nested-if-neo-UNKNOWN +patch-cond-date-neo-UNKNOWN +patch-tls-sni-neo-UNKNOWN +patch-sidebar-neo-UNKNOWN +patch-ifdef-neo-UNKNOWN +patch-fmemopen-neo-UNKNOWN +patch-initials-neo-UNKNOWN +patch-trash-neo-UNKNOWN +patch-limit-current-thread-neo-UNKNOWN +patch-skip-quoted-neo-UNKNOWN + patch-compress-neo-UNKNOWN diff --cc configure.ac index 4c83742b1,6f2d63c55..4322b424b --- a/configure.ac +++ b/configure.ac @@@ -175,40 -175,14 +175,48 @@@ if test x$have_smime != xno ; the SMIMEAUX_TARGET="smime_keys" fi +AC_ARG_ENABLE(sidebar, AC_HELP_STRING([--enable-sidebar], [Enable Sidebar support]), +[ if test x$enableval = xyes ; then + AC_DEFINE(USE_SIDEBAR,1,[ Define if you want support for the sidebar. ]) + OPS="$OPS \$(srcdir)/OPS.SIDEBAR" + need_sidebar="yes" + fi +]) +AM_CONDITIONAL(BUILD_SIDEBAR, test x$need_sidebar = xyes) + +AC_ARG_ENABLE(notmuch, AC_HELP_STRING([--enable-notmuch], [Enable NOTMUCH support]), +[ if test x$enableval = xyes ; then + AC_CHECK_LIB(notmuch, notmuch_database_open,, + AC_MSG_ERROR([Unable to find Notmuch library])) + AC_DEFINE(USE_NOTMUCH,1,[ Define if you want support for the notmuch. ]) + NOTMUCH_LIBS="-lnotmuch" + OPS="$OPS \$(srcdir)/OPS.NOTMUCH" + need_notmuch="yes" + + AC_MSG_CHECKING([for notmuch api version 3]) + AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( + [[#include ]], + [[notmuch_database_open("/path", NOTMUCH_DATABASE_MODE_READ_ONLY, (notmuch_database_t**)NULL);]] + )], + [notmuch_api_3=yes + AC_DEFINE([NOTMUCH_API_3], 1, [Define to 1 if you have the notmuch api version 3.]) + ], + [notmuch_api_3=no] + ) + AC_MSG_RESULT([$notmuch_api_3]) + fi +]) +AM_CONDITIONAL(BUILD_NOTMUCH, test x$need_notmuch = xyes) + + + AC_ARG_ENABLE(compressed, AC_HELP_STRING([--enable-compressed], [Enable compressed folders support]), + [ if test x$enableval = xyes ; then + AC_DEFINE(USE_COMPRESSED,1, [ Define to enable compressed folders support. ]) + need_compress="yes" + fi + ]) + AM_CONDITIONAL(BUILD_COMPRESS, test x$need_compress = xyes) + AC_ARG_WITH(mixmaster, AS_HELP_STRING([--with-mixmaster@<:@=PATH@:>@],[Include Mixmaster support]), [if test "$withval" != no then diff --cc curs_main.c index 64052d127,6ae63b68d..0924ec54d --- a/curs_main.c +++ b/curs_main.c @@@ -488,176 -477,6 +488,181 @@@ static void resort_index (MUTTMENU *men menu->redraw = REDRAW_INDEX | REDRAW_STATUS; } +/** + * mutt_draw_statusline - XXX + */ +void +mutt_draw_statusline (int cols, char *inbuf) +{ + int i = 0; + int cnt = 0; + int last_color = 0; + int color = 0; + int offset = 0; + int found = 0; + int null_rx = 0; + char buf[2048]; + + struct line_t { + short chunks; + struct syntax_t { + int color; + int first; + int last; + } *syntax; + } lineInfo = { 0, NULL }; + + mutt_format_string (buf, sizeof (buf), cols, cols, 0, ' ', inbuf, mutt_strlen (inbuf), 0); + + lineInfo.syntax = safe_malloc (sizeof (struct syntax_t)); + lineInfo.syntax[0].first = -1; + lineInfo.syntax[0].last = -1; + lineInfo.syntax[0].color = ColorDefs[MT_COLOR_STATUS]; + lineInfo.chunks = 1; + + do { + found = 0; + null_rx = 0; + COLOR_LINE *color_line = ColorStatusList; + + if (!buf[offset]) + break; + + while (color_line) { + regmatch_t pmatch[color_line->match + 1]; + + if (regexec (&color_line->rx, buf + offset, color_line->match + 1, pmatch, (offset ? REG_NOTBOL : 0)) == 0) { + if (pmatch[color_line->match].rm_eo != pmatch[color_line->match].rm_so) { + if (!found) { + if (++(lineInfo.chunks) > 1) { + safe_realloc (&(lineInfo.syntax), (lineInfo.chunks) * sizeof (struct syntax_t)); + } + } + i = lineInfo.chunks - 1; + pmatch[color_line->match].rm_so += offset; + pmatch[color_line->match].rm_eo += offset; + if (!found || + (pmatch[color_line->match].rm_so < (lineInfo.syntax)[i].first) || + ((pmatch[color_line->match].rm_so == (lineInfo.syntax)[i].first) && + (pmatch[color_line->match].rm_eo > (lineInfo.syntax)[i].last))) { + (lineInfo.syntax)[i].color = color_line->pair; + (lineInfo.syntax)[i].first = pmatch[color_line->match].rm_so; + (lineInfo.syntax)[i].last = pmatch[color_line->match].rm_eo; + } + found = 1; + null_rx = 0; + } else { + null_rx = 1; /* empty regexp; don't add it, but keep looking */ + } + } + color_line = color_line->next; + } + + if (null_rx) + offset++; /* avoid degenerate cases */ + else + offset = (lineInfo.syntax)[i].last; + } while (found || null_rx); + + for (cnt = 0; cnt < mutt_strlen (buf); cnt++) { + color = lineInfo.syntax[0].color; + for (i = 0; i < lineInfo.chunks; i++) { + /* we assume the chunks are sorted */ + if (cnt > (lineInfo.syntax)[i].last) + continue; + if (cnt < (lineInfo.syntax)[i].first) + break; + if (cnt != (lineInfo.syntax)[i].last) { + color = (lineInfo.syntax)[i].color; + break; + } + /* don't break here, as cnt might be in the next chunk as well */ + } + if (color != last_color) { + attrset (color); + last_color = color; + } + /* XXX more than one char at a time? */ + addch ((unsigned char)buf[cnt]); +#if 0 + waddnstr (stdscr, tgbuf, 10); + SETCOLOR (MT_COLOR_NORMAL); + waddnstr (stdscr, tgbuf + 10, -1); +#endif + } + + safe_free (&lineInfo.syntax); +} + +static int main_change_folder(MUTTMENU *menu, int op, char *buf, size_t bufsz, + int *oldcount, int *index_hint) +{ + mutt_expand_path (buf, bufsz); +#ifdef USE_SIDEBAR + sb_set_open_buffy (buf); +#endif + if (mx_get_magic (buf) <= 0) + { + mutt_error (_("%s is not a mailbox."), buf); + return -1; + } + mutt_str_replace (&CurrentFolder, buf); + + /* keepalive failure in mutt_enter_fname may kill connection. #3028 */ + if (Context && !Context->path) + FREE (&Context); + + if (Context) + { + int check; + ++#ifdef USE_COMPRESSED ++ if (Context->compress_info && Context->realpath) ++ mutt_str_replace (&LastFolder, Context->realpath); ++ else ++#endif + mutt_str_replace (&LastFolder, Context->path); + *oldcount = Context ? Context->msgcount : 0; + + if ((check = mx_close_mailbox (Context, index_hint)) != 0) + { + if (check == M_NEW_MAIL || check == M_REOPENED) + update_index (menu, Context, check, *oldcount, *index_hint); + + set_option (OPTSEARCHINVALID); + menu->redraw = REDRAW_INDEX | REDRAW_STATUS; + return 0; + } + FREE (&Context); + } + + mutt_sleep (0); + + /* Set CurrentMenu to MENU_MAIN before executing any folder + * hooks so that all the index menu functions are available to + * the exec command. + */ + + CurrentMenu = MENU_MAIN; + mutt_folder_hook (buf); + + if ((Context = mx_open_mailbox (buf, + (option (OPTREADONLY) || op == OP_MAIN_CHANGE_FOLDER_READONLY) ? + M_READONLY : 0, NULL)) != NULL) + { + menu->current = ci_first_message (); + } + else + menu->current = 0; + + mutt_clear_error (); + mutt_buffy_check(1); /* force the buffy check after we have changed the folder */ + menu->redraw = REDRAW_FULL; + set_option (OPTSEARCHINVALID); + + return 0; +} + static const struct mapping_t IndexHelp[] = { { N_("Quit"), OP_QUIT }, { N_("Del"), OP_DELETE }, diff --cc doc/manual.xml.head index 1d26cfb8b,4b3414a7b..c09ee4839 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@@ -8863,2582 -8167,325 +8881,2959 @@@ please have a look at the mixmaster doc --> - - Commands - - open-hook - - pattern - - - shell-command - - close-hook - - pattern - + + Muttrc + +# Example Mutt config file for the 'quasi-delete' feature. + +# The 'quasi-delete' function marks an email that should be hidden +# from the index, but NOT deleted. +bind index,pager Q quasi-delete + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + notmuch patch + + + + + Known Bugs + None + + + + Credits + + Karel Zak kzak@redhat.com + Richard Russon rich@flatcap.org + + + + + + Progress Bar Patch + Show a visual progress bar on slow operations + + + Patch + + + To check if Mutt supports Progress Bar, look for + patch-progress in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The progress patch shows a visual progress bar on slow + tasks, such as indexing a large folder over the net. + + + + + + + Colors + + Progress Colors + + + + Name + Default Color + Description + + + + + progress + default + Visual progress bar + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'progress' patch. + +# The 'progress' patch provides clear visual feedback for +# slow tasks, such as indexing a large folder over the net. + +# Set the color of the progress bar +# White text on a red background +color progress white red + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Color command + + + + + Known Bugs + None + + + + Credits + + Rocco Rutte pdmef@gmx.net + Vincent Lefevre vincent@vinc17.org + Stefan Kuhn wuodan@hispeed.ch + Karel Zak kzak@redhat.com + Richard Russon rich@flatcap.org + + +
+ + + Status Color Patch + Custom rules for theming the status bar + + + Patch + + + To check if Mutt supports Status Color, look for + patch-status-color in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The status-color patch allows you to theme different + parts of the status bar (also when it's used by the index). + + + + Unlike normal color commands, color status can now + take up to 2 extra parameters (regex, num). + + + + + + + Commands + + color + + + + + foreground + + + background + + + + regex + + + + num + + + + + + + With zero parameters, Mutt will set the default color for the entire + status bar. + + + + With one parameter, Mutt will only color the parts matching the + regex. + + + + With two parameters, Mutt will only color the num'th sub-match of + the regex. + + + + + Colors + + + Status Colors + + + + Name + Default Color + Description + + + + + status + reverse + Status bar + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'status-color' patch. + +# The 'status-color' patch allows you to theme different parts of +# the status bar (also when it's used by the index). + +# For the examples below, set some defaults +set status_format='-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---' +set index_format='%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s' +set sort=threads +set sort_aux=last-date-received + +# 'status color' can take up to 2 extra parameters + +# color status foreground background [ regex [ num ]] + +# 0 extra parameters +# Set the default color for the entire status line +color status blue white + +# 1 extra parameter +# Set the color for a matching pattern +# color status foreground background regexp + +# Highlight New, Deleted, or Flagged emails +color status brightred white '(New|Del|Flag):[0-9]+' + +# Highlight mailbox ordering if it's different from the default +# First, highlight anything (*/*) +color status brightred default '\([^)]+/[^)]+\)' + +# Then override the color for one specfic case +color status default default '\(threads/last-date-received\)' + +# 2 extra parameters +# Set the color for the nth submatch of a pattern +# color status foreground background regexp num + +# Highlight the contents of the []s but not the [] themselves +color status red default '\[([^]]+)\]' 1 + +# The '1' refers to the first regex submatch, which is the inner +# part in ()s + +# Highlight the mailbox +color status brightwhite default 'Mutt: ([^ ]+)' 1 + +# Search for 'Mutt: ' but only highlight what comes after it + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Compile-Time Features + Regular Expressions + Patterns + index-color patch + Color command + + + + + Known Bugs + None + + + + Credits + + David Sterba dsterba@suse.cz + Thomas Glanzmann thomas@glanzmann.de + Kirill A. Shutemov kirill@shutemov.name + Richard Russon rich@flatcap.org + + +
+ + + Index Color Patch + Custom rules for theming the email index + + + Patch + + + To check if Mutt supports Index Color, look for + patch-index-color in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + status-color patch + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The index-color patch allows you to specify colors for + individual parts of the email index. e.g. Subject, Author, Flags. + + + + First choose which part of the index you'd like to color. + Then, if needed, pick a pattern to match. + + + + Note: The pattern does not have to refer to the object you wish to + color. e.g. + + + +color index_author red default "~smutt" + + + + The author appears red when the subject (~s) contains mutt. + + + + + + + Colors + + + All the colors default to default, i.e. unset. + + + + The index objects can be themed using the color command. + Some objects require a pattern. + + + +color index-object foreground background +color index-object foreground background pattern + + + + Index Colors + + + + Object + Pattern + Highlights + + + + + index + yes + Entire index line + + + index_author + yes + Author name, %A %a %F %L %n + + + index_collapsed + no + Number of messages in a collapsed thread, %M + + + index_date + no + Date field + + + index_flags + yes + Message flags, %S %Z + + + index_label + no + Message label, %y %Y + + + index_number + no + Message number, %C + + + index_size + no + Message size, %c %l + + + index_subject + yes + Subject, %s + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'index-color' feature. + +# Entire index line +color index white black '.*' + +# Author name, %A %a %F %L %n + +# Give the author column a dark grey background +color index_author default color234 '.*' + +# Highlight a particular from (~f) +color index_author brightyellow color234 '~fRay Charles' + +# Message flags, %S %Z +# Highlight the flags for flagged (~F) emails +color index_flags default red '~F' + +# Subject, %s +# Look for a particular subject (~s) +color index_subject brightcyan default '~s\(closes #[0-9]+\)' + +# Number of messages in a collapsed thread, %M +color index_collapsed default brightblue + +# Date field +color index_date green default + +# Message label, %y %Y +color index_label default brightgreen + +# Message number, %C +color index_number red default + +# Message size, %c %l +color index_size cyan default + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Regular Expressions + Patterns + $index_format + Color command + Status-Color patch + Keywords patch + + + + + Known Bugs + None + + + + Credits + + Christian Aichinger Greek0@gmx.net + Christoph Myon Berg myon@debian.org + Elimar Riesebieter riesebie@lxtec.de + Eric Davis edavis@insanum.com + Vladimir Marek Vladimir.Marek@oracle.com + Richard Russon rich@flatcap.org + + +
+ + + Nested If Patch + Allow complex nested conditions in format strings + + + Patch + + + To check if Mutt supports Nested If, look for + patch-nested-if in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + Mutt's format strings can contain embedded if-then-else conditions. + They are of the form: + + + +%?VAR?TRUE&FALSE? + + + + If the variable VAR has a value greater than zero, + print the TRUE string, otherwise print the + FALSE string. + + + + e.g. %?S?Size: %S&Empty? + + + Which can be read as: + + + if (%S > 0) { + print "Size: %S" + } else { + print "Empty" + } + + + + These conditions are useful, but in Mutt they cannot be nested + within one another. This patch uses the notation + %<VAR?TRUE&FALSE> and allows them to be nested. + + + + The %<...> notation was used to format the + current local time. but that's not really very useful since mutt + has no means of refreshing the screen periodically. + + + + A simple nested condition might be: + (Some whitespace has been introduced for clarity) + + + + %<x? %<y? XY & X > & %<y? Y & NONE > > Conditions + %<y? XY & X > x>0 + XY x>0,y>0 + X x>0,y=0 + + + + %<x? %<y? XY & X > & %<y? Y & NONE > > Conditions + %<y? Y & NONE > x=0 + Y x=0,y>0 + NONE x=0,y=0 + + + Equivalent to: + + + if (x > 0) { + if (y > 0) { + print 'XY' + } else { + print 'X' + } + } else { + if (y > 0) { + print 'Y' + } else { + print 'NONE' + } + } + + + Examples: + + +set index_format='%4C %Z %{%b %d} %-25.25n %s%> %<M?%M Msgs &%<l?%l Lines&%c Bytes>>' + + + + if a thread is folded + display the number of messages (%M) + else if we know how many lines in the message + display lines in message (%l) + else + display the size of the message in bytes (%c) + + + +set index_format='%4C %Z %{%b %d} %-25.25n %<M?[%M] %s&%s%* %<l?%l&%c>>' + + + + if a thread is folded + display the number of messages (%M) + display the subject (%s) + else if we know how many lines in the message + display lines in message (%l) + else + display the size of the message in bytes (%c) + + + + + + Variables + The nested-if patch doesn't have any config of its own. + It modifies the behavior of the format strings. + + + + + + Muttrc + +# Example Mutt config file for the 'nested-if' feature. + +# This patch uses the format: '%<VAR?TRUE&FALSE>' for conditional +# format strings that can be nested. + +# Example 1 +# if a thread is folded +# display the number of messages (%M) +# else if we know how many lines in the message +# display lines in message (%l) +# else display the size of the message in bytes (%c) +set index_format='%4C %Z %{%b %d} %-25.25n %s%> %<M?%M Msgs &%<l?%l Lines&%c Bytes>>' + +# Example 2 +# if a thread is folded +# display the number of messages (%M) +# display the subject (%s) +# else if we know how many lines in the message +# display lines in message (%l) +# else +# display the size of the message in bytes (%c) +set index_format='%4C %Z %{%b %d} %-25.25n %<M?[%M] %s&%s%* %<l?%l&%c>>' + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + cond-date patch + $index_format + $status_format + + + + + Known Bugs + Patch overwrites $<fmt> handler in $index_format + + + + Credits + + David Champion dgc@uchicago.edu + Richard Russon rich@flatcap.org + + + + + + Conditional Dates Patch + Use rules to choose date format + + + Patch + + + To check if Mutt supports Conditional Dates, look for + patch-cond-date in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + nested-if patch + + + + This patch is part of the NeoMutt Project. + + + + + Introduction + + + The cond-date patch allows you to construct + $index_format expressions based on the age of the email. + + + + Mutt's default $index_format displays email dates in the + form: abbreviated-month day-of-month — Jan 14. + + + + The format is configurable but only per-mailbox. This patch allows you + to configure the display depending on the age of the email. + + + + Potential Formatting Scheme + + + + Email Sent + Format + Example + + + + + Today + %H:%M + 13:23 + + + This Month + %a %d + Thu 17 + + + This Year + %b %d + Dec 10 + + + Older than 1 Year + %m/%y + 06/14 + + + +
+ + + For an explanation of the date formatting strings, see + strftime(3). + + + + By carefully picking your formats, the dates can remain + unambiguous and compact. + + + + Mutt's conditional format strings have the form: + (whitespace introduced for clarity) + + + %? TEST ? TRUE & FALSE ? + + + The examples below use the test %[ — the date + of the message in the local timezone. They will also work with + %( — the local time that the message arrived. + + + + The date tests are of the form: + + + %[nX? TRUE & FALSE ? + + + n is an optional count (defaults to 1 if missing) + X is the time period + + + + Date Formatting Codes + + + + Letter + Time Period + + + + + y + Years + + + m + Months + + + w + Weeks + + + d + Days + + + H + Hours + + + M + Minutes + + + +
+ + + Example Date Tests + + + + Test + Meaning + + + + + %[y + This year + + + %[1y + This year + + + %[6m + In the last 6 months + + + %[w + This week + + + %[d + Today + + + %[4H + In the last 4 hours + + + +
+ + + Example 1 + + We start with a one-condition test. + + + Example 1 + + + + Test + Date Range + Format String + Example + + + + + %[1m + This month + %[%b %d] + Dec 10 + + + + Older + %[%Y-%m-%d] + 2015-04-23 + + + +
+ + The $index_format string would contain: + +%?[1m?%[%b %d]&%[%Y-%m-%d]? + + + + Reparsed a little, for clarity, you can see the + test condition and the two format strings. + + + +%?[1m? & ? + %[%b %d] %[%Y-%m-%d] + + +
+ + + Example 2 + + + This example contains three test conditions and four date formats. + + + + Example 2 + + + + Test + Date Range + Format String + Example + + + + + %[d + Today + %[%H:%M ] + 12:34 + + + %[m + This month + %[%a %d] + Thu 12 + + + %[y + This year + %[%b %d] + Dec 10 + + + + Older + %[%m/%y ] + 06/15 + + + +
+ + The $index_format string would contain: + + +%<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> + + + + Reparsed a little, for clarity, you can see the + test conditions and the four format strings. + + + +%<[y? &%[%m/%y ]> Older + %<[m? &%[%b %d]> This year + %<[d? &%[%a %d]> This month + %[%H:%M ] Today + + + + This a another view of the same example, with some whitespace + for clarity. + + + +%<[y? %<[m? %<[d? AAA & BBB > & CCC > & DDD > + + + +AAA = %[%H:%M ] +BBB = %[%a %d] +CCC = %[%b %d] +DDD = %[%m/%y ] + +
+
+ + + Variables + + + The cond-date patch doesn't have any config of its own. + It modifies the behavior of the format strings. + + + + + + + Muttrc + +# Example Mutt config file for the 'index-color' feature. +# +# The default index_format is: +# '%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s' +# +# We replace the date field '%{%b %d}', giving: +set index_format='%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s' + +# Test Date Range Format String Example +# -------------------------------------------- +# %[d Today %[%H:%M ] 12:34 +# %[m This month %[%a %d] Thu 12 +# %[y This year %[%b %d] Dec 10 +# - Older %[%m/%y ] 06/15 + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + $index_format + nested-if patch + strftime(3) + + + + + Known Bugs + + + Date parsing doesn't quite do what you expect. + 1w doesn't mean the in the last 7 days, but + this week. This doesn't match + the normal Mutt behaviour: for example ~d>1w + means emails dated in the last 7 days. + + + + + + Credits + + Aaron Schrab aaron@schrab.com + Eric Davis edavis@insanum.com + Richard Russon rich@flatcap.org + + +
+ + + TLS-SNI Patch + Negotiate with a server for a TSL/SSL certificate + + + Patch + + + To check if Mutt supports TLS-SNI, look for + patch-tls-sni in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + OpenSSL + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The TLS-SNI patch adds support for TLS virtual hosting. + If your mail server doesn't support this everything will still work + normally. + + + + TLS supports sending the expected server hostname during the + handshake, via the SNI extension. This can be used to select a + server certificate to issue to the client, permitting + virtual-hosting without requiring multiple IP addresses. + + + + This has been tested against Exim 4.80, which optionally logs SNI + and can perform vhosting. + + + + To verify TLS SNI support by a server, you can use: + + + +openssl s_client -host <imap server> -port <port> -tls1 -servername <imap server> + + + + + + + Muttrc + None + + + + See Also + + + NeoMutt Project + + + + + Known Bugs + None + + + + Credits + + Jeremy Katz katzj@linuxpower.org + Phil Pennock mutt-dev@spodhuis.demon.nl + Richard Russon rich@flatcap.org + + + + + + Sidebar Patch + Overview of mailboxes + + + Patch + + + To check if Mutt supports Sidebar, look for + +USE_SIDEBAR in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The Sidebar shows a list of all your mailboxes. The list can be + turned on and off, it can be themed and the list style can be + configured. + + + + This part of the manual is a reference guide. + If you want a simple introduction with examples see the + Sidebar Howto. + If you just want to get started, you could use the sample + Sidebar muttrc. + + + + This version of Sidebar is based on Terry Chan's + 2015-11-11 release. + It contains many + new features, + lots of + bugfixes. + + + + + Variables + + + Sidebar Variables + + + + Name + Type + Default + + + + + sidebar_delim_chars + string + /. + + + sidebar_divider_char + string + | + + + sidebar_folder_indent + boolean + no + + + sidebar_format + string + %B%?F? [%F]?%* %?N?%N/?%S + + + sidebar_indent_string + string +    (two spaces) + + + sidebar_new_mail_only + boolean + no + + + sidebar_next_new_wrap + boolean + no + + + sidebar_refresh_time + number + 60 + + + sidebar_short_path + boolean + no + + + sidebar_sort_method + enum + SORT_ORDER + + + sidebar_visible + boolean + no + + + sidebar_whitelist + list + (empty) + + + sidebar_width + number + 20 + + + +
+
+ + + Functions + + + Sidebar adds the following functions to Mutt. + By default, none of them are bound to keys. + + + + Sidebar Functions + + + + Menus + Function + Description + + + + + index,pager + <sidebar-next> + Move the highlight to next mailbox + + + index,pager + <sidebar-next-new> + Move the highlight to next mailbox with new mail + + + index,pager + <sidebar-open> + Open highlighted mailbox + + + index,pager + <sidebar-page-down> + Scroll the Sidebar down 1 page + + + index,pager + <sidebar-page-up> + Scroll the Sidebar up 1 page + + + index,pager + <sidebar-prev> + Move the highlight to previous mailbox + + + index,pager + <sidebar-prev-new> + Move the highlight to previous mailbox with new mail + + + index,pager + <sidebar-toggle-visible> + Make the Sidebar (in)visible + + + +
+
+ + + Commands + + sidebar_whitelist + + mailbox + + + mailbox + + + + + + Colors + + + Sidebar Colors + + + + Name + Default Color + Description + + + + + sidebar_divider + default + The dividing line between the Sidebar and the Index/Pager panels + + + sidebar_flagged + default + Mailboxes containing flagged mail + + + sidebar_highlight + underline + Cursor to select a mailbox + + + sidebar_indicator + mutt indicator + The mailbox open in the Index panel + + + sidebar_new + default + Mailboxes containing new mail + + + sidebar_spoolfile + default + Mailbox that receives incoming mail + + + +
+ + If the sidebar_indicator color isn't set, then the default Mutt + indicator color will be used (the color used in the index panel). +
+ + + Sort + + + Sidebar Sort + + + + Sort + Description + + + + + alpha + Alphabetically by path + + + count + Total number of messages + + + flagged + Number of flagged messages + + + name + Alphabetically by path + + + new + Number of new messages + + + path + Alphabetically by path + + + unsorted + Do not resort the paths + + + +
+
+ + + Muttrc + +# This is a complete list of sidebar-related configuration. + +# -------------------------------------------------------------------------- +# VARIABLES - shown with their default values +# -------------------------------------------------------------------------- + +# Should the Sidebar be shown? +set sidebar_visible = no + +# How wide should the Sidebar be in screen columns? +# Note: Some characters, e.g. Chinese, take up two columns each. +set sidebar_width = 20 + +# Should the mailbox paths be abbreviated? +set sidebar_short_path = no + +# When abbreviating mailbox path names, use any of these characters as path +# separators. Only the part after the last separators will be shown. +# For file folders '/' is good. For IMAP folders, often '.' is useful. +set sidebar_delim_chars = '/.' + +# If the mailbox path is abbreviated, should it be indented? +set sidebar_folder_indent = no + +# Indent mailbox paths with this string. +set sidebar_indent_string = ' ' + +# Make the Sidebar only display mailboxes that contain new, or flagged, +# mail. +set sidebar_new_mail_only = no + +# Any mailboxes that are whitelisted will always be visible, even if the +# sidebar_new_mail_only option is enabled. +sidebar_whitelist '/home/user/mailbox1' +sidebar_whitelist '/home/user/mailbox2' + +# When searching for mailboxes containing new mail, should the search wrap +# around when it reaches the end of the list? +set sidebar_next_new_wrap = no + +# The character to use as the divider between the Sidebar and the other Mutt +# panels. +# Note: Only the first character of this string is used. +set sidebar_divider_char = '|' + +# Display the Sidebar mailboxes using this format string. +set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S' + +# Sidebar will not refresh its list of mailboxes any more frequently than +# this number of seconds. This will help reduce disk/network traffic. +set sidebar_refresh_time = 60 + +# Sort the mailboxes in the Sidebar using this method: +# count - total number of messages +# flagged - number of flagged messages +# new - number of new messages +# path - mailbox path +# unsorted - do not sort the mailboxes +set sidebar_sort_method = 'unsorted' + +# -------------------------------------------------------------------------- +# FUNCTIONS - shown with an example mapping +# -------------------------------------------------------------------------- + +# Move the highlight to the previous mailbox +bind index,pager \Cp sidebar-prev + +# Move the highlight to the next mailbox +bind index,pager \Cn sidebar-next + +# Open the highlighted mailbox +bind index,pager \Co sidebar-open + +# Move the highlight to the previous page +# This is useful if you have a LOT of mailboxes. +bind index,pager <F3> sidebar-page-up + +# Move the highlight to the next page +# This is useful if you have a LOT of mailboxes. +bind index,pager <F4> sidebar-page-down + +# Move the highlight to the previous mailbox containing new, or flagged, +# mail. +bind index,pager <F5> sidebar-prev-new + +# Move the highlight to the next mailbox containing new, or flagged, mail. +bind index,pager <F6> sidebar-next-new + +# Toggle the visibility of the Sidebar. +bind index,pager B sidebar-toggle-visible + +# -------------------------------------------------------------------------- +# COLORS - some unpleasant examples are given +# -------------------------------------------------------------------------- +# Note: All color operations are of the form: +# color OBJECT FOREGROUND BACKGROUND + +# Color of the current, open, mailbox +# Note: This is a general Mutt option which colors all selected items. +color indicator cyan black + +# Color of the highlighted, but not open, mailbox. +color sidebar_highlight black color8 + +# Color of the divider separating the Sidebar from Mutt panels +color sidebar_divider color8 black + +# Color to give mailboxes containing flagged mail +color sidebar_flagged red black + +# Color to give mailboxes containing new mail +color sidebar_new green black + +# -------------------------------------------------------------------------- + +# vim: syntax=muttrc + + + + + See Also + + + Regular Expressions + Patterns + Color command + notmuch patch + + + + + Known Bugs + Unsorted isn't + + + + Credits + + Justin Hibbits jrh29@po.cwru.edu + Thomer M. Gil mutt@thomer.com + David Sterba dsterba@suse.cz + Evgeni Golov evgeni@debian.org + Fabian Groffen grobian@gentoo.org + Jason DeTiberus jdetiber@redhat.com + Stefan Assmann sassmann@kpanic.de + Steve Kemp steve@steve.org.uk + Terry Chan tchan@lunar-linux.org + Tyler Earnest tylere@rne.st + Richard Russon rich@flatcap.org + + +
+ + + Ifdef Patch + Conditional config options + + + Patch + + + To check if Mutt supports ifdef, look for + patch-ifdef in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The ifdef patch introduces three new commands to + Mutt and allow you to share one config file between versions of Mutt + that may have different features compiled in. + + + +ifdef symbol config-command [args...] # If a symbol is defined +ifndef symbol config-command [args...] # If a symbol is not defined +finish # Finish reading the current file + + + + Here a symbol can be a $variable, + <function>, + command or compile-time symbol, such + as USE_IMAP. + + + + finish is particularly useful when combined with + ifndef. e.g. + + + +# Sidebar config file +ifndef USE_SIDEBAR finish + + + + + + + + Commands + + ifdef + + symbol + + + "config-command [args]" + + ifndef + + symbol + + + "config-command [args]" + + finish + + + + + + + Muttrc + +# Example Mutt config file for the 'ifdef' feature. + +# This feature introduces three useful commands which allow you to share +# one config file between versions of Mutt that may have different +# features compiled in. + +# ifdef symbol config-command [args...] +# ifndef symbol config-command [args...] +# finish + +# The 'ifdef' command tests whether Mutt understands the name of +# a variable, function, command or compile-time symbol. +# If it does, then it executes a config command. + +# The 'ifndef' command tests whether a symbol does NOT exist. + +# The 'finish' command tells Mutt to stop reading current config file. + +# If the 'trash' variable exists, set it. +ifdef trash 'set trash=~/Mail/trash' + +# If the 'tag-pattern' function exists, bind a key to it. +ifdef tag-pattern 'bind index <F6> tag-pattern' + +# If the 'imap-fetch-mail' command exists, read my IMAP config. +ifdef imap-fetch-mail 'source ~/.mutt/imap.rc' + +# If the compile-time symbol 'USE_SIDEBAR' does not exist, then +# stop reading the current config file. +ifndef USE_SIDEBAR finish + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + + + + + Known Bugs + None + + + + Credits + + Cedric Duval cedricduval@free.fr + Matteo F. Vescovi mfvescovi@gmail.com + Richard Russon rich@flatcap.org + + + + + + Fmemopen Patch + Replace some temporary files with memory buffers + + + Patch + + + To check if Mutt supports fmemopen, look for + patch-fmemopen in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + open_memstream(), fmemopen() from glibc + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The fmemopen patch speeds up some searches. + + + + This patch changes a few places where Mutt creates temporary files. + It replaces them with in-memory buffers. This should improve the + performance when searching the header or body using the + $thorough_search option. + + + + There are no user-configurable parts. + + + + This patch depends on open_memstream() and + fmemopen(). They are provided by glibc. Without + them, Mutt will simply create temporary files. + + + + + + + Muttrc + None + + + + See Also + + + NeoMutt Project + Compile-Time Features + fmemopen(3) + + + + + Known Bugs + None + + + + Credits + + Julius Plenz plenz@cis.fu-berlin.de + Richard Russon rich@flatcap.org + + + + + + Initials Expando Patch + Expando for author's initials + + + Patch + + + To check if Mutt supports Initials, look for + patch-initials in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The initials patch adds an expando (%I) for an author's + initials. + + + + The index panel displays a list of emails. Its layout is controlled by + the $index_format variable. Using + this expando saves space in the index panel. This can be useful if you + are regularly working with a small set of people. + + + + + Variables + + + This patch has no config of its own. It adds an expando which can be + used in the $index_format variable. + + + + + + + Muttrc + +# Example Mutt config file for the 'initials' patch. + +# The 'initials' patch has no config of its own. +# It adds an expando for an author's initials, +# which can be used in the 'index_format' variable. + +# The default 'index_format' is: +set index_format='%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s' + +# Where %L represents the author/recipient + +# This might look like: +# 1 + Nov 17 David Bowie Changesbowie ( 689) +# 2 ! Nov 17 Stevie Nicks Rumours ( 555) +# 3 + Nov 16 Jimi Hendrix Voodoo Child ( 263) +# 4 + Nov 16 Debbie Harry Parallel Lines ( 540) + +# Using the %I expando: +set index_format='%4C %Z %{%b %d} %I (%?l?%4l&%4c?) %s' + +# This might look like: +# 1 + Nov 17 DB Changesbowie ( 689) +# 2 ! Nov 17 SN Rumours ( 555) +# 3 + Nov 16 JH Voodoo Child ( 263) +# 4 + Nov 16 DH Parallel Lines ( 540) + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + $index_format + index-color patch + folder-hook + + + + + Known Bugs + None + + + + Credits + + Vsevolod Volkov vvv@mutt.org.ua + Richard Russon rich@flatcap.org + + + + + + Trash Folder Patch + Automatically move "deleted" emails to a trash bin + + + Patch + + + To check if Mutt supports Trash Folder, look for + patch-trash in the mutt version. + See: . + + + If IMAP is enabled, this patch will use it + + + Dependencies: + mutt-1.6.1 + IMAP support + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + In Mutt, when you delete an email it is first marked + deleted. The email isn't really gone until + <sync-mailbox> is called. + This happens when the user leaves the folder, or the function is called + manually. + + + + After <sync-mailbox> has been called the email is gone forever. + + + + The $trash variable defines a folder in + which to keep old emails. As before, first you mark emails for + deletion. When <sync-mailbox> is called the emails are moved to + the trash folder. + + + + The $trash path can be either a full directory, + or be relative to the $folder + variable, like the mailboxes command. + + + + Emails deleted from the trash folder are gone forever. + + + + + Variables + + Trash Variables + + + + Name + Type + Default + + + + + trash + string + (none) + + + +
+
+ + + Functions + + Trash Functions + + + + Menus + Default Key + Function + Description + + + + + index,pager + (none) + <purge-message> + really delete the current entry, bypassing the trash folder + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'trash' feature. + +# This feature defines a new 'trash' folder. +# When mail is deleted it will be moved to this folder. + +# Folder in which to put deleted emails +set trash='+Trash' +set trash='/home/flatcap/Mail/Trash' + +# The default delete key 'd' will move an email to the 'trash' folder +# Bind 'D' to REALLY delete an email +bind index D purge-message + +# Note: Deleting emails from the 'trash' folder will REALLY delete them. + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + folder-hook + + + + + Known Bugs + None + + + + Credits + + Cedric Duval cedricduval@free.fr + Benjamin Kuperman kuperman@acm.org + Paul Miller paul@voltar.org + Richard Russon rich@flatcap.org + + +
+ + + Limit-Current-Thread Patch + Focus on one Email Thread + + + Patch + + + To check if Mutt supports limit-current-thread, look for + patch-limit-current-thread in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + This patch adds a new way of using the + Limit Command. + The <limit-current-thread> + function restricts the view to just the current thread. + Setting the limit (the l key) to + all will restore the full email list. + + + + + + + Functions + + + Limit-Current-Thread Functions + + + + Menus + Default Key + Function + Description + + + + + index + <Esc> L + <limit-current-thread> + Limit view to current thread + + + +
+ +
+ + + + Muttrc + + +# Example Mutt config file for the 'limit-current-thread' patch. + +# Limit view to current thread +bind index <esc>L limit-current-thread + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + + + + + Known Bugs + None + + + + Credits + + David Sterba dsterba@suse.cz + Richard Russon rich@flatcap.org + + +
+ + + Skip-Quoted Patch + Leave some context visible + + + Patch + + + To check if Mutt supports skip-quoted, look for + patch-skip-quoted in the mutt version. + See: . + + + + Dependencies: + mutt-1.6.1 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + When viewing an email, the + <skip-to-quoted> function (by default the + S key) will scroll past any quoted text. + Sometimes, a little context is useful. + + + + By setting the $skip_quoted_offset variable, you + can select how much of the quoted text is left visible. + + + + + Variables + + Skip-Quoted Variables + + + + Name + Type + Default + + + + + skip_quoted_offset + number + 0 + + + +
+
+ + + + + Muttrc + + +# Example Mutt config file for the 'skip-quoted' patch. + +# The 'S' (skip-quoted) command scrolls the pager past the quoted text (usually +# indented with '> '. Setting 'skip_quoted_offset' leaves some lines of quoted +# text on screen for context. + +# Show three quoted lines before the reply +set skip_quoted_offset = 3 + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + + + + + Known Bugs + None + + + + Credits + + David Sterba dsterba@suse.cz + Richard Russon rich@flatcap.org + + +
+ ++ ++ Compressed Folders Patch ++ Read from/write to compressed mailboxes ++ ++ ++ Patch ++ ++ ++ To check if Mutt supports Compress Folders, look for ++ +USE_COMPRESSED in the mutt version. ++ See: . ++ ++ ++ ++ Dependencies: ++ mutt-1.5.24 ++ ++ ++ This patch is part of the NeoMutt Project. ++ ++ ++ ++ Introduction ++ ++ ++ The Compressed Folder patch allows Mutt to read mailbox files that are ++ compressed. But it isn't limited to compressed files. It works well ++ with encrypted files, too. In fact, if you can create a program/script ++ to convert to and from your format, then Mutt can read it. ++ ++ ++ ++ The patch adds three hooks to Mutt: open-hook, ++ close-hook and append-hook. They ++ define commands to: uncompress a file; compress a file; append ++ messages to an already compressed file. ++ ++ ++ ++ There are some examples of both compressed and encrypted files, ++ later. For now, the documentation will just concentrate on ++ compressed files. ++ ++ ++ ++ ++ ++ ++ ++ Commands ++ ++ open-hook ++ ++ pattern ++ ++ ++ shell-command ++ ++ close-hook ++ ++ pattern ++ + + shell-command + + append-hook + + pattern + + + shell-command + + + + + The shell-command must contain two placeholders for filenames: + %f and %t. These represent + from and to filenames. It's a good idea to + put quotes around these placeholders. + + + + If you need the exact string %f or %t in your + command, simply double up the % character, e.g. + %%f or %%t. + + + + Not all Hooks are Required + + + + Open + Close + Append + Effect + Useful if + + + + + Open + - + - + Folder is readonly + The folder is just a backup + + + Open + Close + - + Folder is read/write, but the entire folder must be + written if anything is changed + Your compression format doesn't support appending + + + Open + Close + Append + Folder is read/write and emails can be efficiently added + to the end + Your compression format supports appending + + + Open + - + Append + Folder is readonly, but can be appended to + You want to store emails, but never change them + + + +
+ + + The command: + + should return a non-zero exit status on failure + should not delete any files + + + + + Read from compressed mailbox + + open-hook regexp shell-command + + + If Mutt is unable to open a file, it then looks for + open-hook that matches the filename. + + + + If your compression program doesn't have a well-defined extension, + then you can use . as the regexp. + + + + Example of open-hook + + open-hook '\.gz$' "gzip -cd '%f' > '%t'" + + + Mutt finds a file, example.gz, + that it can't read + Mutt has an open-hook + whose regexp matches the filename: + \.gz$ + Mutt uses the command gzip -cd + to create a temporary file that it can + read + + + + + + Write to a compressed mailbox + + close-hook regexp shell-command + + + When Mutt has finished with a compressed mail folder, it will look + for a matching close-hook to recompress the file. + This hook is optional. + + + + If the folder has not been modifed, the + close-hook will not be called. + + + + Example of close-hook + + close-hook '\.gz$' "gzip -c '%t' > '%f'" + + + Mutt has finished with a folder, example.gz, + that it opened with open-hook + The folder has been modified + Mutt has a close-hook whose regexp + matches the filename: \.gz$ + Mutt uses the command gzip -c + to create a new compressed file + + + + + + Append to a compressed mailbox + + append-hook regexp shell-command + + + When Mutt wants to append an email to a compressed mail folder, it + will look for a matching append-hook. + This hook is optional. + + + + Using the append-hook will save time, but + Mutt won't be able to determine the type of the mail folder + inside the compressed file. + + + + Mutt will assume the type to be that of + the $mbox_type variable. Mutt also uses + this type for temporary files. + + + + Mutt will only use the append-hook for existing files. + The close-hook will be used for empty, or missing files. + + + + Example of append-hook + + append-hook '\.gz$' "gzip -c '%t' >> '%f'" + + + Mutt wants to append an email to a folder, example.gz, + that it opened with open-hook + Mutt has an append-hook whose regexp matches + the filename: \.gz$ + Mutt knows the mailbox type from the $mbox + variable + Mutt uses the command gzip -c + to append to an existing compressed file + + + + + + + Empty Files + + + Mutt assumes that an empty file is not compressed. In this + situation, unset $save_empty, so + that the compressed file will be removed if you delete all of the + messages. + + + + + Security + + + Encrypted files are decrypted into temporary files which are + stored in the $tmpdir directory. + This could be a security risk. + + +
+ + + + + Muttrc + + # Example Mutt config file for the 'compressed folders' feature. + + # This feature adds three hooks to Mutt which allow it to + # work with compressed, or encrypted, mailboxes. + + # The hooks are of the form: + # open-hook regexp "shell-command" + # close-hook regexp "shell-command" + # append-hook regexp "shell-command" + + # The 'append-hook' is optional. + + # Hander for gzip compressed mailboxes + open-hook '\.gz$' "gzip -cd '%f' > '%t'" + close-hook '\.gz$' "gzip -c '%t' > '%f'" + append-hook '\.gz$' "gzip -c '%t' >> '%f'" + + # Hander for bzip2 compressed mailboxes + open-hook '\.bz2$' "bzip2 -cd '%f' > '%t'" + close-hook '\.bz2$' "bzip2 -c '%t' > '%f'" + append-hook '\.bz2$' "bzip2 -c '%t' >> '%f'" + + # Hander for xz compressed mailboxes + open-hook '\.xz$' "xz -cd '%f' > '%t'" + close-hook '\.xz$' "xz -c '%t' > '%f'" + append-hook '\.xz$' "xz -c '%t' >> '%f'" + + # Hander for pgp encrypted mailboxes + # PGP does not support appending to an encrypted file + open-hook '\.pgp$' "pgp -f < '%f' > '%t'" + close-hook '\.pgp$' "pgp -fe YourPgpUserIdOrKeyId < '%t' > '%f'" + + # Hander for gpg encrypted mailboxes + # gpg does not support appending to an encrypted file + open-hook '\.gpg$' "gpg --decrypt < '%f' > '%t'" + close-hook '\.gpg$' "gpg --encrypt --recipient YourGpgUserIdOrKeyId < '%t' > '%f'" + + # vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Compile-Time Features + Regular Expressions + $tmpdir + $mbox_type + $save_empty + folder-hook + + + + + Known Bugs + + + The Compressed Folder hooks cannot deal with filenames that contains quotes/apostrophes. + + + + + Credits + + Roland Rosenfeld roland@spinnaker.de + Alain Penders Alain@Finale-Dev.com + Christoph Myon Berg myon@debian.org + Evgeni Golov evgeni@debian.org + Richard Russon rich@flatcap.org + + +
+ diff --cc mx.c index 3e35705f5,7f3e8e110..9a76313f3 --- a/mx.c +++ b/mx.c @@@ -29,10 -29,11 +29,14 @@@ #include "copy.h" #include "keymap.h" #include "url.h" +#ifdef USE_SIDEBAR +#include "sidebar.h" +#endif + #ifdef USE_COMPRESSED + #include "compress.h" + #endif + #ifdef USE_IMAP #include "imap.h" #endif @@@ -777,12 -739,12 +797,16 @@@ void mx_fastclose_mailbox (CONTEXT *ctx mutt_clear_threads (ctx); for (i = 0; i < ctx->msgcount; i++) mutt_free_header (&ctx->hdrs[i]); +#ifdef USE_SIDEBAR + ctx->msgcount -= ctx->deleted; + sb_set_buffystats (ctx); +#endif FREE (&ctx->hdrs); FREE (&ctx->v2r); + #ifdef USE_COMPRESSED + if (ctx->compress_info) + comp_fast_close (ctx); + #endif FREE (&ctx->path); FREE (&ctx->pattern); if (ctx->limit_pattern) diff --cc mx.h index 18fc84534,d926cf68e..2920dc2fd --- a/mx.h +++ b/mx.h @@@ -36,8 -35,10 +36,11 @@@ enu M_MH, M_MAILDIR, M_IMAP, + M_NOTMUCH, M_POP + #ifdef USE_COMPRESSED + , M_COMPRESSED + #endif }; WHERE short DefaultMagic INITVAL (M_MBOX); diff --cc status.c index c458516e6,2573b8d32..101fa814d --- a/status.c +++ b/status.c @@@ -99,13 -95,12 +99,19 @@@ status_format_str (char *buf, size_t bu break; case 'f': - snprintf (fmt, sizeof(fmt), "%%%ss", prefix); + { +#ifdef USE_NOTMUCH + char *p; + if (Context && Context->magic == M_NOTMUCH && + (p = nm_get_description(Context))) + strfcpy(tmp, p, sizeof (tmp)); + else ++#endif + #ifdef USE_COMPRESSED + if (Context && Context->compress_info && Context->realpath) { + strfcpy (tmp, Context->realpath, sizeof (tmp)); + mutt_pretty_mailbox (tmp, sizeof (tmp)); + } else #endif if (Context && Context->path) { diff --cc version.c index f21f0a7bd,000000000..c6cdce3fd mode 100644,000000..100644 --- a/version.c +++ b/version.c @@@ -1,506 -1,0 +1,511 @@@ +/** + * Copyright (C) 1996-2007 Michael R. Elkins + * Copyright (C) 1999-2007 Thomas Roessler + * Copyright (C) 2016 Richard Russon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#ifdef HAVE_STRINGPREP_H +#include +#elif defined (HAVE_IDN_STRINGPREP_H) +#include +#endif +#ifdef USE_SLANG_CURSES +#include "slang.h" +#endif + +#include "lib.h" + +// #include "protos.h" +const char * mutt_make_version (void); +void mutt_print_patchlist (void); + +// #include "hcache.h" +const char * mutt_hcache_backend (void); + +const int SCREEN_WIDTH = 80; + +extern const char cc_version[]; +extern const char cc_cflags[]; +extern const char configure_options[]; + +static const char *Copyright = N_( + "Copyright (C) 1996-2014 Michael R. Elkins \n" + "Copyright (C) 1996-2002 Brandon Long \n" + "Copyright (C) 1997-2009 Thomas Roessler \n" + "Copyright (C) 1998-2005 Werner Koch \n" + "Copyright (C) 1999-2014 Brendan Cully \n" + "Copyright (C) 1999-2002 Tommi Komulainen \n" + "Copyright (C) 2000-2004 Edmund Grimley Evans \n" + "Copyright (C) 2006-2009 Rocco Rutte \n" + "Copyright (C) 2014-2015 Kevin J. McCarthy \n" + "\n" + "Many others not mentioned here contributed code, fixes,\n" + "and suggestions.\n" +); + +static const char *License = N_( + " This program is free software; you can redistribute it and/or modify\n" + " it under the terms of the GNU General Public License as published by\n" + " the Free Software Foundation; either version 2 of the License, or\n" + " (at your option) any later version.\n" + "\n" + " This program is distributed in the hope that it will be useful,\n" + " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + " GNU General Public License for more details.\n" +); + +static const char *Obtaining = N_( + " You should have received a copy of the GNU General Public License\n" + " along with this program; if not, write to the Free Software\n" + " Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n" +); + +static const char *ReachingUs = N_( + "To learn more about NeoMutt, visit: http://www.neomutt.org/\n" + "If you find a bug in NeoMutt, please raise an issue at:\n" + " https://github.com/neomutt/neomutt/issues\n" + "or contact the lead developer: Richard Russon \n" +); + +static const char *Notice = N_( + "Copyright (C) 1996-2016 Michael R. Elkins and others.\n" + "Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.\n" + "Mutt is free software, and you are welcome to redistribute it\n" + "under certain conditions; type `mutt -vv' for details.\n" +); + +struct compile_options { + const char *name; + int enabled; +}; + +static struct compile_options comp_opts[] = { +#ifdef CRYPT_BACKEND_CLASSIC_PGP + { "CRYPT_BACKEND_CLASSIC_PGP", 1 }, +#else + { "CRYPT_BACKEND_CLASSIC_PGP", 0 }, +#endif +#ifdef CRYPT_BACKEND_CLASSIC_SMIME + { "CRYPT_BACKEND_CLASSIC_SMIME", 1 }, +#else + { "CRYPT_BACKEND_CLASSIC_SMIME", 0 }, +#endif +#ifdef CRYPT_BACKEND_GPGME + { "CRYPT_BACKEND_GPGME", 1 }, +#else + { "CRYPT_BACKEND_GPGME", 0 }, +#endif +#ifdef DEBUG + { "DEBUG", 1 }, +#else + { "DEBUG", 0 }, +#endif +#ifdef DL_STANDALONE + { "DL_STANDALONE", 1 }, +#else + { "DL_STANDALONE", 0 }, +#endif +#ifdef ENABLE_NLS + { "ENABLE_NLS", 1 }, +#else + { "ENABLE_NLS", 0 }, +#endif +#ifdef EXACT_ADDRESS + { "EXACT_ADDRESS", 1 }, +#else + { "EXACT_ADDRESS", 0 }, +#endif +#ifdef HOMESPOOL + { "HOMESPOOL", 1 }, +#else + { "HOMESPOOL", 0 }, +#endif +#ifdef LOCALES_HACK + { "LOCALES_HACK", 1 }, +#else + { "LOCALES_HACK", 0 }, +#endif +#ifdef SUN_ATTACHMENT + { "SUN_ATTACHMENT", 1 }, +#else + { "SUN_ATTACHMENT", 0 }, +#endif +#ifdef HAVE_BKGDSET + { "HAVE_BKGDSET", 1 }, +#else + { "HAVE_BKGDSET", 0 }, +#endif +#ifdef HAVE_COLOR + { "HAVE_COLOR", 1 }, +#else + { "HAVE_COLOR", 0 }, +#endif +#ifdef HAVE_CURS_SET + { "HAVE_CURS_SET", 1 }, +#else + { "HAVE_CURS_SET", 0 }, +#endif +#ifdef HAVE_GETADDRINFO + { "HAVE_GETADDRINFO", 1 }, +#else + { "HAVE_GETADDRINFO", 0 }, +#endif +#ifdef HAVE_GETSID + { "HAVE_GETSID", 1 }, +#else + { "HAVE_GETSID", 0 }, +#endif +#ifdef HAVE_ICONV + { "HAVE_ICONV", 1 }, +#else + { "HAVE_ICONV", 0 }, +#endif +#ifdef HAVE_LANGINFO_CODESET + { "HAVE_LANGINFO_CODESET", 1 }, +#else + { "HAVE_LANGINFO_CODESET", 0 }, +#endif +#ifdef HAVE_LANGINFO_YESEXPR + { "HAVE_LANGINFO_YESEXPR", 1 }, +#else + { "HAVE_LANGINFO_YESEXPR", 0 }, +#endif +#ifdef HAVE_LIBIDN + { "HAVE_LIBIDN", 1 }, +#else + { "HAVE_LIBIDN", 0 }, +#endif +#ifdef HAVE_META + { "HAVE_META", 1 }, +#else + { "HAVE_META", 0 }, +#endif +#ifdef HAVE_REGCOMP + { "HAVE_REGCOMP", 1 }, +#else + { "HAVE_REGCOMP", 0 }, +#endif +#ifdef HAVE_RESIZETERM + { "HAVE_RESIZETERM", 1 }, +#else + { "HAVE_RESIZETERM", 0 }, +#endif +#ifdef HAVE_START_COLOR + { "HAVE_START_COLOR", 1 }, +#else + { "HAVE_START_COLOR", 0 }, +#endif +#ifdef HAVE_TYPEAHEAD + { "HAVE_TYPEAHEAD", 1 }, +#else + { "HAVE_TYPEAHEAD", 0 }, +#endif +#ifdef HAVE_WC_FUNCS + { "HAVE_WC_FUNCS", 1 }, +#else + { "HAVE_WC_FUNCS", 0 }, +#endif +#ifdef ICONV_NONTRANS + { "ICONV_NONTRANS", 1 }, +#else + { "ICONV_NONTRANS", 0 }, +#endif ++#ifdef USE_COMPRESSED ++ { "USE_COMPRESSED", 1 }, ++#else ++ { "USE_COMPRESSED", 0 }, ++#endif +#ifdef USE_DOTLOCK + { "USE_DOTLOCK", 1 }, +#else + { "USE_DOTLOCK", 0 }, +#endif +#ifdef USE_FCNTL + { "USE_FCNTL", 1 }, +#else + { "USE_FCNTL", 0 }, +#endif +#ifdef USE_FLOCK + { "USE_FLOCK", 1 }, +#else + { "USE_FLOCK", 0 }, +#endif +#ifdef USE_GNU_REGEX + { "USE_GNU_REGEX", 1 }, +#else + { "USE_GNU_REGEX", 0 }, +#endif +#ifdef USE_GSS + { "USE_GSS", 1 }, +#else + { "USE_GSS", 0 }, +#endif +#ifdef USE_HCACHE + { "USE_HCACHE", 1 }, +#else + { "USE_HCACHE", 0 }, +#endif +#ifdef USE_IMAP + { "USE_IMAP", 1 }, +#else + { "USE_IMAP", 0 }, +#endif +#ifdef USE_NOTMUCH + { "USE_NOTMUCH", 1 }, +#else + { "USE_NOTMUCH", 0 }, +#endif +#ifdef USE_POP + { "USE_POP", 1 }, +#else + { "USE_POP", 0 }, +#endif +#ifdef USE_SASL + { "USE_SASL", 1 }, +#else + { "USE_SASL", 0 }, +#endif +#ifdef USE_SETGID + { "USE_SETGID", 1 }, +#else + { "USE_SETGID", 0 }, +#endif +#ifdef USE_SIDEBAR + { "USE_SIDEBAR", 1 }, +#else + { "USE_SIDEBAR", 0 }, +#endif +#ifdef USE_SMTP + { "USE_SMTP", 1 }, +#else + { "USE_SMTP", 0 }, +#endif +#ifdef USE_SSL_GNUTLS + { "USE_SSL_GNUTLS", 1 }, +#else + { "USE_SSL_GNUTLS", 0 }, +#endif +#ifdef USE_SSL_OPENSSL + { "USE_SSL_OPENSSL", 1 }, +#else + { "USE_SSL_OPENSSL", 0 }, +#endif + { NULL, 0 } +}; + +/** + * print_compile_options - Print a list of enabled/disabled features + * + * The configure script lets uses enable/disable features. + * This shows the Mutt user which features are/aren't available. + * + * The output is of the form: "+ENABLED_FEATURE -DISABLED_FEATURE" and is + * wrapped to SCREEN_WIDTH characters. + */ +static void +print_compile_options (void) +{ + int i; + char c; + int len; + int used = 0; + + for (i = 0; comp_opts[i].name; i++) { + len = strlen (comp_opts[i].name) + 2; /* +/- and a space */ + if ((used + len) > SCREEN_WIDTH) { + used = 0; + puts (""); + } + used += len; + c = comp_opts[i].enabled ? '+' : '-'; + printf ("%c%s ", c, comp_opts[i].name); + } + puts (""); +} + +/** + * rstrip_in_place - Strip a trailing carriage return + * @s: String to be modified + * + * The string has its last carriage return set to NUL. + * Returns: + * The modified string + */ +static char * +rstrip_in_place (char *s) +{ + if (!s) + return NULL; + + char *p; + + p = &s[strlen (s)]; + if (p == s) + return s; + p--; + while ((p >= s) && ((*p == '\n') || (*p == '\r'))) + *p-- = '\0'; + return s; +} + +/** + * print_version - Print system and compile info + * + * Print information about the current system Mutt is running on. + * Also print a list of all the compile-time information. + */ +void +print_version (void) +{ + struct utsname uts; + + puts (mutt_make_version()); + puts (_(Notice)); + + uname (&uts); + +#ifdef _AIX + printf ("System: %s %s.%s", uts.sysname, uts.version, uts.release); +#elif defined (SCO) + printf ("System: SCO %s", uts.release); +#else + printf ("System: %s %s", uts.sysname, uts.release); +#endif + + printf (" (%s)", uts.machine); + +#ifdef NCURSES_VERSION + printf ("\nncurses: %s (compiled with %s)", curses_version(), NCURSES_VERSION); +#elif defined (USE_SLANG_CURSES) + printf ("\nslang: %d", SLANG_VERSION); +#endif + +#ifdef _LIBICONV_VERSION + printf ("\nlibiconv: %d.%d", _LIBICONV_VERSION >> 8, + _LIBICONV_VERSION & 0xff); +#endif + +#ifdef HAVE_LIBIDN + printf ("\nlibidn: %s (compiled with %s)", stringprep_check_version (NULL), + STRINGPREP_VERSION); +#endif + +#ifdef USE_HCACHE + printf ("\nhcache backend: %s", mutt_hcache_backend()); +#endif + + puts ("\n\nCompiler:"); + rstrip_in_place ((char *) cc_version); + puts (cc_version); + + rstrip_in_place ((char *) configure_options); + printf ("\nConfigure options: %s\n", configure_options); + + rstrip_in_place ((char *) cc_cflags); + printf ("\nCompilation CFLAGS: %s\n", cc_cflags); + + puts (_("\nCompile options:")); + print_compile_options(); + +#ifdef DOMAIN + printf ("DOMAIN=\"%s\"\n", DOMAIN); +#else + puts ("-DOMAIN"); +#endif + +#ifdef MIXMASTER + printf ("MIXMASTER=\"%s\"\n", MIXMASTER); +#else + puts ("-MIXMASTER"); +#endif + +#ifdef ISPELL + printf ("ISPELL=\"%s\"\n", ISPELL); +#else + puts ("-ISPELL"); +#endif + + printf ("SENDMAIL=\"%s\"\n", SENDMAIL); + printf ("MAILPATH=\"%s\"\n", MAILPATH); + printf ("PKGDATADIR=\"%s\"\n", PKGDATADIR); + printf ("SYSCONFDIR=\"%s\"\n", SYSCONFDIR); + printf ("EXECSHELL=\"%s\"\n", EXECSHELL); + + puts (""); + mutt_print_patchlist(); + + puts (""); + puts (_(ReachingUs)); +} + +/** + * print_copyright - Print copyright message + * + * Print the authors' copyright messages, the GPL license and some contact + * information for the Mutt project. + */ +void +print_copyright (void) +{ + puts (mutt_make_version()); + puts (_(Copyright)); + puts (_(License)); + puts (_(Obtaining)); + puts (_(ReachingUs)); +} + +/** + * feature_enabled - Test is a compile-time feature is enabled + * @name: Compile-time symbol of the feature + * + * Many of the larger features of mutt can be disabled at compile time. + * They define a symbol and use #ifdef's around their code. + * The symbols are mirrored in "struct compile_options comp_opts[]" in this + * file. + * + * This function checks if one of these symbols is present in the code. + * + * These symbols are also seen in the output of "mutt -v". + * + * Returns: + * 1: Feature enables + * 0: Feature not enabled, or not compiled in + */ +int +feature_enabled (const char *name) +{ + if (!name) + return 0; + + int i; + for (i = 0; comp_opts[i].name; i++) { + if (mutt_strcmp (name, comp_opts[i].name) == 0) { + return 1; + } + } + return 0; +} +