Added Cyg-Win

This commit is contained in:
Frank Harris 2026-06-06 18:46:40 -04:00
parent 82cbc206eb
commit 413c315806
10586 changed files with 3806249 additions and 0 deletions

View file

@ -0,0 +1,35 @@
The following copyright notices apply to most of the program. Some
modules are under different licenses, or in the public domain.
Please note that this is by no means an exhaustive list of all the
persons who have been contributing to this program. Please see the
manual for a (probably still non complete) list of the persons who
have been helpful with the development of this program. Please also
see our source code repository at https://gitlab.com/muttmua/mutt for
the full history of commits.
Copyright (C) 1996-2016 Michael R. Elkins <me@cs.hmc.edu>
Copyright (C) 1996-2002 Brandon Long <blong@fiction.net>
Copyright (C) 1997-2009 Thomas Roessler <roessler@does-not-exist.org>
Copyright (C) 1998-2005 Werner Koch <wk@isil.d.shuttle.de>
Copyright (C) 1999-2017 Brendan Cully <brendan@kublai.com>
Copyright (C) 1999-2002 Tommi Komulainen <Tommi.Komulainen@iki.fi>
Copyright (C) 2000-2004 Edmund Grimley Evans <edmundo@rano.org>
Copyright (C) 2000-2019 David Champion <dgc.mutt@c13.us>
Copyright (C) 2006-2009 Rocco Rutte <pdmef@gmx.net>
Copyright (C) 2014-2026 Kevin J. McCarthy <kevin@8t8.us>
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.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View file

@ -0,0 +1,339 @@
Supported platforms
===================
Mutt has been reported to compile and run under the following Unix operating
systems:
AIX
BSDI
Convex
Data General Unix (DG/UX)
Digital Unix (OSF/1)
DYNIX/ptx
FreeBSD
HP-UX
IRIX
Linux
Mac OS X
Atari MiNT
MkLinux
NetBSD
OpenBSD
QNX
SCO Unix 3.2v4/5
Solaris
SunOS
Ultrix
UnixWare
- If you are building from Git, or if you are changing parts of mutt,
particularly the build system, do read doc/devel-notes.txt.
- A C99 compiler (such as GCC) is required.
- A C99 compliant libc is also required, starting with Mutt 2.1.0.
This means very old systems will likely not compile or work correctly.
- You must also have a SysV compatible curses library, or you must
install either
GNU ncurses, ftp://prep.ai.mit.edu/pub/gnu/
or
S-Lang, ftp://space.mit.edu/pub/davis/slang/
- Mutt needs an implementation of the iconv API for character set
conversions. A free one can be found under the following URL:
http://www.gnu.org/software/libiconv/
- For building the manual, mutt needs the DocBook XSL stylesheets
as well as the DocBook DTD as of version 4.2 installed locally.
For details, please see the section "Generating Mutt Documentation
From Source" in doc/devel-notes.txt.
Installation
============
Installing Mutt is rather painless through the use of the GNU
autoconf package. Simply untar the Mutt distribution, and run the
``configure'' script. If you have obtained the distribution from
the Git repository, run the ``prepare'' script with the same command
line parameters you would pass to configure. It will set up mutt's
build environment and add the files which are present in the tar
balls, but not in the Git repository.
In most cases, configure will automatically determine everything it
needs to know in order to compile. However, there are a few options
to ``configure'' to help it out, or change the default behavior.
To view them all, type ``configure --help''. Some of the important
options are:
--prefix=DIR
install Mutt in DIR instead of /usr/local
--enable-autocrypt
enable autocrypt 1.1 <https://autocrypt.org/> support.
Requires sqlite3 (via the --with-sqlite3 option).
--enable-gpgme
enable GPGME crypt backend support.
--enable-sidebar
Build with sidebar functionality. The sidebar can show a list of all
your mailboxes at... *drums roll* ...the side. Visibility of the
sidebar can be turned on and off as desired.
--enable-compressed
enable compressed folders support.
--enable-pop
enable POP3 support
--enable-imap
enable IMAP support
--enable-smtp
enable built in SMTP client support
--enable-debug
enable debug flag '-d' support.
--enable-flock
use flock() to lock files.
--disable-fcntl
by default, Mutt uses fcntl() to lock files. Over NFS this can
result in poor performance on read/write. Note that using this
option could be dangerous if dotlocking is also disabled.
--disable-filemonitor
disables inotify support for faster local mailbox monitoring.
The filemonitor option is only available on Linux.
--enable-nfs-fix
some implementations of NFS do not always write the
atime/mtime of small files. This means that Mutt's ``mailboxes''
feature does not always work properly, as it uses these
attributes to work out whether the file has new mail. This
option enables a workaround to this bug.
--enable-locales-fix
on some systems, the result of isprint() can't be used reliably
to decide which characters are printable, even if you set the
LANG environment variable. If you set this option, Mutt will
assume all characters in the ISO-8859-* range are printable. If
you leave it unset, Mutt will attempt to use isprint() if either
of the environment variables LANG, LC_ALL or LC_CTYPE is set,
and will revert to the ISO-8859-* range if they aren't.
If you need --enable-locales-fix then you will probably need
--without-wc-funcs too. However, on a correctly configured
modern system you shouldn't need either (try setting LANG,
LC_ALL or LC_CTYPE instead).
--enable-exact-address
By default, Mutt will rewrite all addresses in the form
Personal Name <user@host.domain>
regardless of the input. By enabling this option, Mutt will write
addresses in the same form they are parsed. NOTE: this requires
significantly more memory.
--enable-hcache
Enable header caching support. If no backend library is
specified via a --with option (e.g. --with-kyotocabinet), Mutt
will scan in the order: kyotocabinet, tokyocabinet, lmdb,
qdbm, gdbm, bdb. To skip scanning one or more of these
libraries, use the corresponding --without option.
--disable-nls
This switch disables mutt's native language support.
--disable-doc
Turns off building the Mutt manual. This can be helpful if you
don't have all the DocBook dependencies installed.
--with-curses=DIR
use the curses lib in DIR/lib. If you have ncurses, ``configure''
will automatically look in /usr/include/ncurses for the include
files.
--with-slang[=DIR]
use the S-Lang library instead of ncurses. This library seems to
work better for some people because it is less picky about proper
termcap entries than ncurses. It is recommended that you use at
*least* version 0.99-38 with Mutt.
--with-sqlite3[=DIR]
use the sqlite3 lib in DIR/lib. This is currently only needed
by the --enable-autocrypt option.
--with-mailpath=DIR
specify where the spool mailboxes are located on your system
--with-homespool[=FILE]
treat file in the user's home directory as the spool mailbox. Note
that this is *not* the full pathname, but relative to the user's
home directory. Defaults to "mailbox" if FILE is not specified.
--with-gss[=PFX]
Enable GSSAPI authentication to IMAP servers. This should work with
both MIT and Heimdal GSSAPI implementations - others haven't been
tested. Note that the Cyrus SASL library also supports GSSAPI,
and may be able to encrypt your session with it - you should use
SASL instead if you can.
--with-ssl[=PFX]
enable SSL support with IMAP and POP. SSL support requires you to
have OpenSSL headers and libraries properly installed before
compiling. If the OpenSSL headers and libraries are not in the
default system pats you can use the optional PFX argument to
define the root directory of your installation. The libraries
are then expected to be found in PFX/lib and headers in
PFX/include/openssl.
--with-sasl[=PFX]
Use the Cyrus SASL library for IMAP or POP authentication. This
library provides generic support for several authentication methods,
and more may be added by the system administrator without recompiling
mutt. SASL may also be able to encrypt your mail session even if
SSL is not available.
--with-bundled-regex
use bundled GNU regex instead of local regexp routines. Many systems
don't have the POSIX compliant regcomp/regexec/regfree
routines, so this provides a way to support them.
--without-wc-funcs
by default Mutt uses the functions mbrtowc(), wctomb() and
wcwidth() provided by the system, when they are available.
With this option Mutt will use its own version of those
functions, which should work with 8-bit display charsets, UTF-8,
euc-jp or shift_jis, even if the system doesn't normally support
those multibyte charsets.
If you find Mutt is displaying non-ascii characters as octal
escape sequences (e.g. \243), even though you have set LANG and
LC_CTYPE correctly, then you might find you can solve the problem
with either or both of --enable-locales-fix and --without-wc-funcs.
--with-exec-shell=SHELL
on some versions of unix, /bin/sh has a bug that makes using emacs
with mutt very difficult. If you have the problem that whenever
you press control-G in emacs, mutt and emacs become very confused,
you may want to try using a Bourne-derived shell other than
/bin/sh here. Some shells that may work are bash, zsh, and ksh.
C shells such as csh and tcsh will almost certainly not work right.
Note that this option is unrelated to what shell mutt gives you
when you press '!'. Only use this option to solve the above problem,
and only specify one of the above shells as its argument.
(If you encounter this problem with your platform's native
Bourne shell, please send a short report to mutt-dev@mutt.org,
so a short note on this topic can be added to the Platform notes
section below.)
Once ``configure'' has completed, simply type ``make install.''
Mutt should compile cleanly (without errors) and you should end up with a
binary called ``mutt.'' If you get errors about undefined symbols like
A_NORMAL or KEY_MIN, then you probably don't have a SysV compliant curses
library. You should install either ncurses or S-Lang (see above), and then
run the ``configure'' script again.
Please note that "VPATH" builds currently only work with GNU make (gmake).
Character set support
=====================
Mutt no longer contains functions for doing character set conversion.
Instead, it expects the iconv functions (iconv_open, iconv,
iconv_close) to be provided. Most up-to-date systems provide these
functions, often as part of the C library. If you are installing Mutt
on a system which does not have them, it is recommended that you
install Bruno Haible's portable libiconv library, which you can obtain
from:
ftp://ftp.ilog.fr/pub/Users/haible/gnu/
Even if your system does provide the iconv functions, you might want
to install libiconv, as some systems provide only a very limited
version of iconv.
If you decide to use your system's iconv implementation, you may
need to tell mutt about implementation-defined names for some
character sets. Sample configuration files for various systems can
be found in the directory contrib/iconv/ in this source
distribution, and will be installed in the samples/iconv directory
as part of mutt's documentation.
In order to use these sample configuration files, just put a line
like
source /usr/local/doc/mutt/samples/iconv/iconv.osf1-4.0d.rc
into your system's global Muttrc, which normally resides in /etc or
/usr/local/etc.
If you really want to, you can configure Mutt --disable-iconv, but
there will then be no character set conversion.
Platform Notes
==============
All platforms
There is a bug in most (if not all) S-Lang versions which
prevents the Meta key from working with mutt. A patch can
be found in the file contrib/patch.slang-1.2.2.keypad.1 in
this mutt distribution.
Solaris 2.4
The system regcomp() and regexec() routines are very badly
broken. This should be automatically detected by the
configure script. If not, use the --with-regex switch when
configuring mutt.
We are also hearing reports that Solaris 2.4's NLS libraries
dump core with mutt when using a locale different from "C".
Use the --with-included-gettext configuration switch if you
experience this problem.
Color does not work right with Solaris curses. You will
have to compile with either ncurses or slang to get working
color support.
Solaris 2.6
There are reports that mutt behaves strangely when linked with
the system regexp library. Please use the --with-regex switch
when configuring on this platform.
For the real fix, applying Sun patches # 105490-05 (linker
patch) and # 105210-17 (libc and malloc patch) from
sunsolve.sun.com has been reported to stop these problems
from occurring.
Linux
On recent Linux systems, flock() and fcntl() locks don't mix. If
you use the --enable-flock switch on such systems, be sure to
give the --disable-fcntl argument as well.
Sparc Linux
Redhat 4.2 Sparc users reported problems with some system
include files when building mutt. Configuring mutt with the
--disable-warnings switch is said to help against this problem.
Digital Unix (OSF/1)
The system curses library is said to be badly broken. Use GNU
ncurses or SLang instead.

View file

@ -0,0 +1,159 @@
Visible changes since Mutt 1.2
==============================
Folder formats and folder access
--------------------------------
- Better mh support: Mutt now supports .mh_sequences files.
Currently, the "unseen", "flagged", and "replied" sequences are
used to store mutt flags (the names are configurable using the
$mh_seq_unseen, $mh_seq_flagged, and $mh_seq_replied configuration
variables). As a side effect, messages in MH folders are no longer
rewritten upon status changes.
- The "trashed" flag is supported for maildir folders. See
$maildir_trash.
- POP folder support. You can now access a POP mailbox just like an
IMAP folder (with obvious restrictions due to the protocol).
- URL syntax for remote folders. You can pass things like
pop://account@host and imap://account@host/folder as arguments for
the -f command line flag.
- STARTTLS support. If $ssl_starttls is set (the default), mutt
will attempt to use STARTTLS on servers advertising that
capability.
- $preconnect. If set, a shell command to be executed if mutt fails
to establish a connection to the server. This is useful for
setting up secure connections; see the muttrc(5) for details.
- $tunnel. Use a pipe to a command instead of a raw socket. See
muttrc(5) for details. (Basically, it's another way for setting
up secure connections.)
- More new IMAP/POP-related variables (see muttrc(5) for details):
$connect_timeout, $imap_authenticators, $imap_delim_chars,
$imap_peek, $pop_authenticators, $pop_auth_try_all,
$pop_checkinterval, $pop_delete, $pop_reconnect, $use_ipv6.
- The following IMAP/POP-related variables are gone:
$imap_checkinterval, $imap_cramkey, $pop_port.
- There's a new imap-fetch-mail function, which forces a check for
new messages on an IMAP server.
- The new-mailbox function was renamed to create-mailbox, and is
bound to C instead of n by default.
Character set support
---------------------
- Mutt now uses the iconv interface for character set conversions.
This means that you need either a very modern libc, or Bruno
Haible's libiconv, which is available from
<http://www.gnu.org/software/libiconv/>.
- With sufficiently recent versions of ncurses and slang, mutt works
properly in utf-8 locales.
- On sufficiently modern systems, the $charset variable's value is
automatically derived from the locale you use. (Note, however,
that manually setting it to a value which is compatible with your
locale doesn't do any harm.)
- $send_charset is a colon-separated list of character sets now,
defaulting to us-ascii:iso-8859-1:utf-8.
- charset-hook defines aliases for character sets encountered in
messages (say, someone tags his messages with latin15 when he
means iso-8859-15), iconv-hook defines local names for character
sets (for systems which don't know about MIME names; see
contrib/iconv for sample configuration snippets).
- The change-charset function is gone. Use edit-type (C-e on the
compose menu) instead.
- The recode-attachment function is gone.
Other changes
-------------
- There's a new variable $compose_format for the compose screen's
status line. You can now include the message's approximate
on-the-wire size.
- The attachment menu knows about collapsing now: Using
collapse-parts (bound to "v" by default), you can collapse and
uncollapse parts of the attachment tree. This function is also
available from the pager when invoked from the attachment tree.
Normally, the recvattach menu will start uncollapsed. However,
with the new $digest_collapse option (which is set by default),
the individual messages contained in digests will be displayed
collapsed. (That is, there's one line per message.)
- Using $display_filter, you can specify a command which filters
messages before they are displayed.
- Using message-hook, you can execute mutt configuration commands
before a message is displayed (or formatted before replying).
- If you don't want that mutt moves flagged messages to your mbox,
set $keep_flagged.
- Setting the $pgp_ignore_subkeys variable will cause mutt to ignore
OpenPGP. This option is set by default, and it's suggested that
you leave it.
- $pgp_sign_micalg has gone. Mutt now automatically determines what
MIC algorithm was used for a particular signature.
- If $pgp_good_sign is set, then a PGP signature is only considered
verified if the output from $pgp_verify_command matches this
regular expression. It's suggested that you set this variable to
the typical text message output by PGP (or GPG, or whatever)
produces when it encounters a good signature.
- There's a new function, check-traditional-pgp, which is bound to
esc-P by default. It'll check whether a text parts of a message
contain PGP encrypted or signed material, and possibly adjust
content types.
- $print_split. If this option is set, $print_command run
separately for each message you print. Useful with enscript(1)'s
mail printing mode.
- $sig_on_top. Include the signature before any quoted or forwarded
text. WARNING: use of this option may provoke flames.
- $text_flowed. When set, mutt will generate text/plain attachments
with the format=flowed parameter. In order to properly produce
such messages, you'll need an appropriate editor mode. Note that
the $indent_string option is ignored with flowed text.
- $to_chars has grown: Mailing list messages are now tagged with an
L in the index. If you want the old behaviour back, add this to
your .muttrc: set to_chars=" +TCF "
- New emacs-like functions in the line editor: backward-word (M-b),
capitalize-word (M-c), downcase-word (M-l), upcase-word (M-u),
forward-word (M-f), kill-eow (M-d), tranpose-chars (unbound).
transpose-chars is unbound by default because external query
occupies C-t. Suggested alternative binding:
bind editor "\e\t" complete-query
bind editor "\Ct" transpose-chars
- mailto URL support: You can pass a mailto URL to mutt on the
command line.
- If $duplicate_threads is set, mutt's new threading code will
thread messages with the same message-id together. Duplication
will be indicated with an equals sign in the thread diagram.
You can also limit your view to the duplicates (or exclude
duplicates from view) by using the "~=" pattern.

View file

@ -0,0 +1,275 @@
$Id$
USING PGP FROM WITHIN MUTT
WARNING: The configuration interface has completely changed as of
0.96.3!
USERS' GUIDE
How do I use mutt with PGP, PGP5, or GnuPG?
-------------------------------------------
Go to the contrib subdirectory of the source tree. You'll find
three files there, pgp2.rc, pgp5.rc, and gpg.rc. These files
contain ready-to-use configurations for using mutt with pgp2, pgp5,
and gpg.
Include one of these files with your ~/.muttrc, and things should
work out fine.
You may wish to verify that all paths and the language parameters
given to the PGP binaries match your needs.
Frequently Asked Questions and Tips
-----------------------------------
Q: "People are sending PGP messages which mutt doesn't
recognize. What can I do?"
The new way is to leave headers alone and use mutt's
check-traditional-pgp function, which can detect PGP messages at
run-time, and adjust content-types.
The old way is to configure your mail filter so it fixes headers:
Add the following lines to your ~/.procmailrc (you are
using procmail, aren't you?):
------------------------------
##
## PGP
##
:0
* !^Content-Type: message/
* !^Content-Type: multipart/
* !^Content-Type: application/pgp
{
:0 fBw
* ^-----BEGIN PGP MESSAGE-----
* ^-----END PGP MESSAGE-----
| formail \
-i "Content-Type: application/pgp; format=text; x-action=encrypt"
:0 fBw
* ^-----BEGIN PGP SIGNED MESSAGE-----
* ^-----BEGIN PGP SIGNATURE-----
* ^-----END PGP SIGNATURE-----
| formail \
-i "Content-Type: application/pgp; format=text; x-action=sign"
}
------------------------------
For users of maildrop, "Mark Weinem"
<mark.weinem@unidui.uni-duisburg.de> suggests the following recipe:
------------------------------
BPGPM="-----BEGIN PGP MESSAGE-----"
EPGPM="-----END PGP MESSAGE-----"
BPGPS="-----BEGIN PGP SIGNATURE-----"
EPGPS="-----END PGP SIGNATURE-----"
if (!/^Content-Type: message/ && !/^Content-Type: multipart/ \
&& !/^Content-Type: application\/pgp/)
{
if (/^$BPGPM/:b && /^$EPGPM/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=encrypt'"
if (/^$BPGPS/:b && /^$EPGPS/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=sign'"
}
------------------------------
Q: "I don't like that PGP/MIME stuff, but want to use the
old way of PGP-signing my mails. Can't you include
that with mutt?"
The old answer to this question used to be this:
No. Application/pgp is not really suited to a world with MIME,
non-textual body parts and similar things. Anyway, if you really
want to generate these old-style attachments, include the
following macro in your ~/.muttrc (line breaks for readability,
this is actually one line):
macro compose S "Fpgp +verbose=0 -fast
+clearsig=on\ny^T^Uapplication/pgp; format=text;
x-action=sign\n"
There's a new answer, though: Set the $pgp_create_traditional
configuration variable (it's a quad-option) to something different
from "no" (that's the default). Mutt will then try to use
application/pgp wherever it makes sense. In particular, it does
not make any sense with multiparts, or non-ASCII or non-text bodies.
In all other cases, PGP/MIME is used unconditionally.
Note that application/pgp is still strongly deprecated.
Q: "I don't like all the ^Gs and various other verbosity
PGP is presenting me with."
Roland Rosenfeld <roland@spinnaker.rhein.de> has found a quite
elegant solution to this problem: PGP has some pretty good foreign
language support. So we just introduce a language called "mutt"
which contains empty strings for the messages we don't want to see.
To use this, copy either language.txt or language50.txt (depending
on what PGP version you are using) to your $PGPPATH. Make sure the
PGP command formats pass "+language=pgp" to all the PGP binaries
(but not to mutt_pgpring!).
For PGP 2.6, a German version called "muttde" is available
as well.
Q: "My PGP signatures are being invalidated. BTW, I'm using Courier
MTA."
The author of the Courier MTA believes that the standard specifying
multipart/signed is broken. For that reason, he has chosen to
implement his MTA in a way which does not assure that
multipart/signed body parts are left untouched.
We suggest that you abandon courier and change to sendmail, postfix,
or exim.
BACKGROUND
Auxiliary Programs
------------------
Mutt needs two auxiliary programs for its PGP support: pgpewrap and
mutt_pgpring.
1. mutt_pgpring
mutt_pgpring is a key ring dumper. It extracts information from PGP's
binary key ring and emits it in an (almost) readable output format
understood by mutt's key selection routines. This output format
mimics the one used by the GNU Privacy Guard (GPG).
You'll need this program with PGP 2 and PGP 5.
Command line options:
-k <key ring> Dump the contents of the key ring specified
as an argument to -k.
-2, -5 Use the default key ring for PGP 2 or 5,
respectively.
-s Dump the secret key ring.
-S Dump signatures.
-f Dump fingerprints.
2. pgpewrap
This is a little C program which does some command line munging: The
first argument is a command to be executed. When pgpewrap
encounters a "--" (dash-dash) argument, it will interpret the next
argument as a prefix which is put in front of all following
arguments.
Example:
pgpewrap pgpe file -- -r a b c
will execute:
pgpe file -r a -r b -r c
This script is needed with PGP 5 and with GPG, since their command
line interfaces can't be properly served by mutt's format mechanism.
The Configuration Interface
---------------------------
As usual within mutt, the configuration interface for the PGP
commands relies on printf-like formats. For all PGP commands, the
following %-sequences are defined.
%p The empty string when no passphrase is needed,
the string "PGPPASSFD=0" if one is needed.
This is mostly used in conditional % sequences.
%f Most PGP commands operate on a single file or a file
containing a message. %f expands to this file's name.
%s When verifying signatures, there is another temporary file
containing the detached signature. %s expands to this
file's name.
%a In "signing" contexts, this expands to the value of the
configuration variable $pgp_sign_as. You probably need to
use this within a conditional % sequence.
%r In many contexts, mutt passes key IDs to pgp. %r expands to
a list of key IDs.
The following command formats are defined:
$pgp_decode_command Decode application/pgp messages. This
command operates with and without pass phrases.
$pgp_verify_command Verify a PGP/MIME signature.
$pgp_decrypt_command Decrypt a PGP/MIME encrypted MIME body.
This command always gets a pass phrase.
$pgp_sign_command Sign a PGP/MIME body. This command always
gets a pass phrase.
$pgp_encrypt_sign_command Encrypt and sign a MIME body. This
command always gets a pass phrase.
$pgp_encrypt_only_command Encrypt a MIME body, but don't sign it.
$pgp_import_command Import PGP keys from a file.
$pgp_export_command Export PGP keys to a file. The output must
be ASCII armored.
$pgp_verify_key_command Check a public key. This is used from the
key selection menu.
$pgp_list_secring_command List the secret keys matching some hints
given in %r.
$pgp_list_pubring_command List the public keys matching some hints
given in %r.
The passphrase is always passed on stdin; all commands must send
their output to stdout and stderr.

View file

@ -0,0 +1,21 @@
When updating mutt from an earlier release or from Git, please
make sure to read the compatibility notes in ``UPDATING''.
Installation instructions are detailed in ``INSTALL''. The user manual
is in doc/manual.txt. GnuPG users should use the sample configuration in
contrib/gpg.rc.
Before you start hacking on mutt, read doc/devel-notes.txt. Before
applying patches to mutt, read doc/applying-patches.txt. Please,
read these files, as they will save you from asking FAQs.
For more information, see the Mutt home page:
http://www.mutt.org/
The primary distribution points for Mutt is:
ftp://ftp.mutt.org/pub/mutt
A list of mirror sites can be found under
<http://www.mutt.org/download.html>.

View file

@ -0,0 +1,60 @@
$Id$
Recently, there have been reports on security problems induced by
the interpretation of shell meta-characters embedded in MIME
parameters. These reports were referring to Pine, but the problem
also applied when using mutt.
More precisely, a mailcap entry like this one would lead to
problems:
> text/test-mailcap-bug; cat %s; copiousoutput; \
> test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" != iso-8859-1
When expanded with a charset parameter of ``touch${IFS}ME``, a file
named "ME" would be created in the current directory.
While we don't completely agree that this is an actual MUA problem
(see below), we have implemented a couple of fixes for this:
- Backticks are handled specially when preparing % expandos for
mailcap entries. This fix will keep the current problem from
occurring, but we are sure there are other possible mailcap entries
where this doesn't help.
- We have added a configuration variable named $mailcap_sanitize,
which is set by default. If set, mutt will restrict possible
characters in mailcap % expandos to a well-defined set of safe
characters. This is the safe setting, but we are not sure it
doesn't break some more advanced MIME stuff.
>>> DON'T UNSET THIS OPTION UNLESS YOU KNOW WHAT YOU ARE DOING.
Anyway, this problem is not necessarily a problem which should be
solved inside the MUA, as it's difficult (maybe impossible) to solve
there. Additionally, there is more than one program which parses
mailcap. So writing secure mailcap statements is generally a good
idea. We encourage you to do this.
The most basic rule is this one:
>>> KEEP THE %-EXPANDOS AWAY FROM SHELL QUOTING.
Don't quote them with single or double quotes. Mutt does this for
you, the right way, as should any other program which interprets
mailcap. Don't put them into backtick expansions - as you have seen
above, this is a recipe for disaster. Be highly careful with eval
statements, and avoid them if possible at all.
If you have to use the %-expandos' values in context where you need
quoting or backtick expansions, put that value into a shell variable
and reference the shell variable where necessary (possibly with the
proper quoting put around it, like in "$charset").
For example, a safe version of the mailcap statement above could
look like this:
> text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
> && test "`echo \"$charset\" | tr '[A-Z]' '[a-z]'`" != iso-8859-1

View file

@ -0,0 +1,110 @@
IMAP/SSL in mutt
================
Compilation
-----------
If you want to have SSL support in mutt, you need to install OpenSSL
(http://www.openssl.org) libraries and headers before compiling.
OpenSSL versions 0.9.3 through 0.9.6a have been tested.
For SSL support to be enabled, you need to run the ``configure''
script with ``--enable-imap --with-ssl[=PFX]'' parameters. If the
OpenSSL headers and libraries are not in the default system search
paths (usually /usr/include and /usr/lib) you can use the optional PFX
argument to define the root directory of your installation. The
libraries are then expected to be found in PFX/lib and headers in
PFX/include/openssl.
Usage
-----
IMAP/SSL folders can be accessed just like normal IMAP folders, but you
will also have to add '/ssl' before the closing curly brace. Or you can
use IMAP url notation, where the methods is called imaps.
For example:
mailboxes {localhost/ssl}inbox
mailboxes {localhost:994/ssl}inbox
or
mailboxes imaps://localhost/inbox
mailboxes imaps://localhost:994/inbox
If you get errors about lack of entropy, it means that Mutt was unable
to find a source of random data to initialize SSL library with. Should
this happen, you need to generate the data yourself and save it in a
file pointed by $entropy_file or $RANDFILE (environment) variables or
in ~/.rnd.
One way to generate random data would be to run a command which
generates unpredictable output, for example 'ps aluxww' in Linux, and
calculating the MD5-sum from the output and saving it in a file.
** Note: The contents of the file pointed by $RANDFILE environment
** variable (or ~/.rnd if unset) will be overwritten every time Mutt
** is run so don't put anything you can't afford to lose in that file.
The files Mutt will try to use to initialize SSL library with are files
pointed by $entropy_file and $RANDFILE (or ~/.rnd if unset.) If your
OpenSSL is version 0.9.5 or later, the previous files can also be EGD
sockets (see http://www.lothar.com/tech/crypto/ for more information
about Entropy Gathering Daemon) and in addition sockets in the following
places are tried: socket pointed by $EGDSOCKET environment variable,
~/.entropy and /tmp/entropy.
All the files and sockets mentioned above must be owned by the user and
have permissions of 600.
Certificates
------------
Each time a server is contacted, its certificate is checked against
known valid certificates. When an unknown certificate is encountered,
you are asked to verify it. If you reject the certificate, the
connection will be terminated immediately. If you accept the
certificate, the connection will be established. Accepted certificates
can also be saved so that further connections to the server are
automatically accepted.
If your organization has several equivalent IMAP-servers, each of them
should have a unique certificate which is signed with a common
certificate. If you want to use all of those servers, you don't need to
save each server certificate on the first connect. Instead, you can get
the signer certificate and save it instead. That way, mutt will
automatically accept all certificates signed with the saved certificate.
System-wide certificates are by default considered trusted when checking
certificates by signer. This allows system administrators to setup
trusted certificates for all users. How to install certificates
system-wide, depends on the OpenSSL installation. Use of system-wide
certificates can be disabled by unsetting $ssl_usesystemcerts variable.
Certificates will be saved in the file specified by $certificate_file
variable. It is empty as default, so if you don't want to verify
certificates each time you connect to a server, you have set this
variable to some reasonable value.
For example:
set certificate_file=~/.mutt/certificates
Troubleshooting
---------------
If after doing the above, you are unable to successfully connect, it
is likely that your IMAP server does not support one of the SSL protocols.
There exist three different protocols, TLSv1, SSLv2, and SSLv3. To check
each of these, you use the following:
openssl s_client -host <imap server> -port <port> -verify -debug -no_tls1
openssl s_client -host <imap server> -port <port> -verify -debug -no_ssl2
openssl s_client -host <imap server> -port <port> -verify -debug -no_ssl3
You can also combine the options until you get a successful connect. Once
you know which options do not work, you can set the variables for non-working
protocols to know. The variables for the protocols are ssl_use_tlsv1,
ssl_use_sslv2, and ssl_use_sslv3.
--
Tommi Komulainen
Tommi.Komulainen@iki.fi
Updated by Jeremy Katz
katzj@linuxpower.org

View file

@ -0,0 +1,59 @@
Problems are listed in approximate order of priority.
- When displaying MIME headers, rfc 2047 decoding is applied (which
should not happen), and rfc 2231 decoding is not applied (which
should happen).
- Help formatting could be revamped a bit.
- In the "attachment" menu, assume this:
1 [text/plain, 7bit, 1.1K] <no description>
2 [message/rfc822, 7bit, 6.1K] A test message
3 [text/plain, 7bit, 0.1K] |-><no description>
4 [message/rfc822, base64, 2.5K] |-><no description>
5 [message/rfc822, base64, 2.7K] `-><no description>
(please note the "message/rfc822" attachments encoded as
Base64; that's illegal, but Sun's Mailtool sends that
kind of messages); then go to, say, attachment "4",
delete it, and go to the main menu; you won't be able to
quit the mailbox (ok, 'x' works, but 'q' doesn't).
The problem here lies in the fact that mutt uses mailbox
handling functions to access message/rfc822 type
attachments. We'd need to perform an additional
decoding step before using these functions to fix this
bug.
Please note that mutt's just assuming RFC-compliant mail
here. Fixing this stuff may become a PITA.
- BODY struct should probably have a pointer to its
corresponding HEADER struct. this is needed for
mh/maildir mailboxes so the correct pathname can be
found. Or perhaps all we need is a .hdr member of the
STATE struct so that all of the MIME handlers can look
up the corresponding HEADERs if need be?
- handle message/external-body in some fashion
- handle message/partial reconstruction
- make patterns generic (I have patches for this -tlr), and
introduce generic menu limiting, menu pattern searching, and the
like.
Note: This still requires some thought, since we'd have to store
per-entry data in the menu structure. As an alternative, we could
extend the tag method to do something to more general flags. The
latter approach would make the implementation of proper
tag-prefix behaviour more simple: Functions should only be applied
when a message is tagged and visible. Additionally, we must not
access a menu's max field directly any more: Adding an entry to a
menu will require re-allocating and possibly updating the v2r
array. How do we handle "in-the-middle additions" properly? Do
they happen at all?

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,25 @@
Subject: Applying patches
From: Thomas Roessler <roessler@does-not-exist.org>
Date: Thu, 8 Oct 1998 14:32:53 +0200
When applying patches to mutt, you may encounter strange error
messages spit out by programs like aclocal, autoconf, automake.
This will happen if your machine has a partial build environment
(see devel-notes.txt for a description of what's needed for mutt
development): Mutt has detected changes to some of the "meta source
files" like configure.in and tries to rebuild other files such as
aclocal.m4 or Makefile.in based on these changes; this will fail if
your build environment is not complete.
If you encounter this kind of problem, touching the following files
after applying patches may help:
Makefile.in
config.h.in
configure
aclocal.m4
After doing so, simply type "make"; the dependencies should take
care of the necessary other re-building (this may quite well include
a re-running of ./configure).
$Id$

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,301 @@
Required tools
--------------
If you are planning to hack on mutt, please subscribe to the
mutt-dev mailing list (mutt-dev@mutt.org). To subscribe, send an
email with as subject "subscribe" to mutt-dev-request@mutt.org .
Announcements about recent development versions go to that mailing
list, as go technical discussions and patches.
Patches should, if possible, be made using Git against the latest
revision.
You'll need several GNU development utilities for working on mutt:
- autoconf (versions less than 2.59 are unsupported)
(this package includes autoheader and autoreconf)
If the build fails during any of the auto* stages, first of all try if
re-running the ./prepare script fixes things. Remember to give the
same options you passed to it or to the configure it generated the
last time, you can query them with:
./config.status --version
- automake (versions less than 1.9 are not officially supported)
(this package includes aclocal)
Note that you MUST re-run ./prepare (with the original arguments)
if you change the automake version between builds for the same source
directory.
- GNU make may be needed for the dependency tricks
- The internationalization (i18n) stuff requires GNU gettext.
See intl/VERSION for the version we are currently relying on.
Please note that using gettext-0.10 will most probably not work -
get the latest test release from alpha.gnu.org, it's the recommended
version of gettext anyway.
If you are experiencing problems with unknown "dcgettext" symbols,
the autoconf/automake macros from your gettext package are broken.
Apply the following patch to that macro file (usually found under
/usr/share/aclocal/gettext.m4):
--- gettext.m4.bak Thu Jul 2 18:46:08 1998
+++ gettext.m4 Mon Oct 5 23:32:54 1998
@@ -46,12 +46,13 @@
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
- [AC_CACHE_CHECK([for gettext in libintl],
- gt_cv_func_gettext_libintl,
- [AC_CHECK_LIB(intl, gettext,
- gt_cv_func_gettext_libintl=yes,
- gt_cv_func_gettext_libintl=no)],
+ [AC_CHECK_LIB(intl, gettext,
+ gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])
+ fi
+
+ if test "$gt_cv_func_gettext_libintl" = "yes" ; then
+ LIBS="-lintl $LIBS"
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
Generating Mutt Documentation From Source
-----------------------------------------
To translate Mutt's Docbook XML documentation into HTML (and then text),
you'll need one tool and two sets of data which you may need to download
and install. The tool is xsltproc (part of the libxslt package), and
it's a command-line program for performing XSL transformations on XML
documents. The data sets are the Docbook XML and Docbook XSL libraries.
Whenever your operating system provides packages or pkgsrc or ports of
these, you should install them. Some systems, for instance SUSE Linux
and FreeBSD's ports system, automatically set up a registry of installed
XML/XSL and SGML catalogs so that the user does not need to care about
what to install where, how to set environment variables, and so on.
If your system does not provide these libraries and data sets,
you can download them from:
. xsltproc
http://xmlsoft.org/
ftp://xmlsoft.org/libxslt/libxslt-1.1.17.tar.gz
. docbook-xml-4.2
http://www.docbook.org/
http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip
. docbook-xsl-1.70.1
http://docbook.sourceforge.net/
http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.70.1.zip
First, if you don't already have xsltproc, build and install libxslt,
which will provide xsltproc, too.
Next, obtain and unpack the two docbook archives. You can unpack these
anywhere that you want to have them installed -- there's no installation
procedure other than unarchival. On my Solaris system, I install
packages under /opt/pkgs/packagename-version, so I unpacked these ZIP
archives to /opt/pkgs/docbook-xml-4.2 and /opt/pkgs/docbook-xsl-1.70.1.
Now you need to create (and export) an environment variable to process
the manuals. The environment variable will contain a space-separated
list of "catalog" files for the two docbook archives, so substitute
the path where you unpacked them below:
sh$ XML_CATALOG_FILES="/path/to/docbook-xml-4.2/catalog.xml /path/to/docbook-xsl-1.70.1/catalog.xml"; export XML_CATALOG_FILES
or
csh$ setenv XML_CATALOG_FILES "/path/to/docbook-xml-4.2/catalog.xml /path/to/docbook-xsl-1.70.1/catalog.xml"
Once all these are installed and XML_CATALOG_FILES is set, you should be
able to generate manual.html with a simple "make" -- all as a part of
the mutt compilation.
The Makefile depends upon lynx (or any other text-mode web browser)
to turn the HTML into text, so if that fails you may need to install
something else.
Getting started from Git
------------------------
The official Git repository is located at:
https://gitlab.com/muttmua/mutt. You can get a fresh clone via:
$ git clone https://gitlab.com/muttmua/mutt.git mutt
Once you've checked out a copy of the source, or changed your
automake version, you'll need to run the script called './prepare' that
is in the root directory. The script does all the automake/autoconf
magic that needs to be done with a fresh checkout.
Contributing patches
--------------------
As Git is a distributed version control system, it's easy to
commit changes locally without impacting anybody else's work, starting
over again, or turn several commit and backouts into a new single patch
ready for submission.
These so-called "changesets" (a diff with a reasonable message
describing the change) can be exported using Git through the
"send-email" command (please see the git documentation for details)
which also is the preferred format for submission to the mutt-dev
mailing list for discussion and review.
In order to ease later bisecting in case of bugs and code history,
changes should be grouped logically, feature by feature or bugfix by
bugfix. Especially a single patch fixing several problems at once
should be avoided.
Before submitting patches, please make sure the check_sec.sh script
in the top-level source directory reports no errors/warnings.
Documentation changes should be validated by running 'make validate'
in the doc subdirectory.
String comparisons
------------------
A word of warning about string comparisons: Since mutt may run in a
huge variety of locales, case-insensitive string comparisons and
case conversions may be dangerous. For instance, in iso-8859-9,
tolower('I') is DIFFERENT from 'i' - it's indeed the Turkish dotless
lowercase i.
For this reason, always use the ascii_* functions defined in ascii.h
and implemented in ascii.c when comparing or handling strings which
are defined as us-ascii. This concerns lots of text-based
protocols, message header tags, character set names, domain names,
e-mail addresses, etc.
A word about warnings
---------------------
Mutt's default build process sets some pretty restrictive compiler
flags which may lead to lots of warnings. Generally, warnings are
something which should be eliminated.
Nevertheless, the code in intl/ is said to generate some warnings with
the compiler settings we usually rely upon. This code is not
maintained by the mutt developers, so please redirect any comments to
the GNU gettext library's developers.
Style Guide
-----------
- global functions should have the prefix "mutt_". All
other functions should be declared "static".
- avoid global variables where possible. If one is required,
try to contain it to a single source file and declare it
"static". Global variables should have the first letter of
each word capitalized, and no underscores should be used
(e.g., MailGid, LastFolder, MailDir).
- re-use code as much as possible. There are a lot of
"library" functions. One of the biggest causes of bloat
in ELM and PINE is the tremendous duplication of code...
Help keep Mutt small!
- when adding new options, make the old behavior the
default.
- try to keep mutt as portable as possible.
- special characters should be in utf-8. If you find remnants
from the times when this was an iso-8859-1 source code tree,
please feel free to fix them.
- prefix translator comments with L10N:
/* L10N: this is a translator comment */
puts(_("String to translate));
Documentation
-------------
Please document your changes. Note that there are several places
where you may have to add documentation:
- doc/manual.xml.{head,tail} contain The Manual.
- doc/muttrc.man.{head,tail} contain an abridged version of The
Manual in nroff format (see man(7)), which deals with
configuration file commands.
- UPDATING includes short documentation of user-visible
changes, i.e., any incompatibilities should go here.
Configuration _variables_ are documented directly in init.h. Note
that this includes documentation for possibly added format flags!
The parts of The Manual and the muttrc manual page dealing with
these variables, and the global Muttrc, are generated automatically
from that documentation. To start this process, type "make
update-doc" in the top-level source directory.
Note that you may have to update the makedoc utility (makedoc.pl)
when adding new data types to init.h.
More precisely, variable name, type, and default value are directly
extracted from the initializer for the MuttVars array. Documentation
is expected in special comments which _follow_ the initializer.
For a line to be included with the documentation, it must (after,
possibly, some white space) begin with either "/**" or "**".
Any following white space is ignored. The rest of the line is
expected to be plain text, with some formatting instructions roughly
similar to [ntg]roff:
- \fI switches to italics
- \fB switches to boldface
- \fT switches to monospace
- \fP switches to normal display after \fI, \fB or \fT
- \(as can be used to represent an asterisk (*). This is intended
to help avoiding character sequences such as /* or */ inside
comments.
- \(rs can be used to represent a backslash (\). This is intended
to help avoiding problems when trying to represent any of the \
sequences used by makedoc.
- .dl on a line starts a "definition list" environment (name taken
from HTML) where terms and definitions alternate.
- .dt marks a term in a definition list.
- .dd marks a definition in a definition list.
- .de on a line finishes a definition list environment.
- .ts on a line starts a "verbose tscreen" environment (name taken from
SGML). Please try to keep lines inside such an environment
short; a length of about 40 characters should be OK. This is
necessary to avoid a really bad-looking muttrc (5) manual page.
- .te on a line finishes this environment.
- .pp on a line starts a paragraph.
- $word will be converted to a reference to word, where appropriate.
Note that $$word is possible as well.
Use $$$ to get a literal $ without making a reference.
- '. ' in the beginning of a line expands to two space characters.
This is used to protect indentations in tables.
Do _not_ use any other SGML or nroff formatting instructions here!

View file

@ -0,0 +1,877 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 2. Getting Started</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="intro.html" title="Chapter 1. Introduction" /><link rel="next" href="configuration.html" title="Chapter 3. Configuration" /><style xmlns="" type="text/css">
body { margin-left:2%; margin-right:2%; font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
p { text-align:justify; }
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
.email, .email a { font-family:monospace; }
div.table-contents table, div.informaltable table { border-collapse:collapse; border:1px solid #c0c0c0; }
div.table-contents table td, div.informaltable td, div.table-contents table th, div.informaltable table th { padding:5px; text-align:left; }
div.table-contents table th, div.informaltable table th {
font-family:sans-serif;
background:#d0d0d0;
font-weight:normal;
vertical-align:top;
}
div.cmdsynopsis { border-left:1px solid #707070; padding-left:5px; }
li div.cmdsynopsis { border-left:none; padding-left:0px; }
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; margin-left:2%; margin-right:2%; }
div.example p.title { margin-left:2%; }
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
div.note h3:after { content: ":" }
div.note { margin-bottom: 5px; }
.command { font-family: monospace; font-weight: normal; }
.command strong { font-weight: normal; }
tr { vertical-align: top; }
.comment { color:#707070; }
</style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Getting Started</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="configuration.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="gettingstarted"></a>Chapter 2. Getting Started</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="gettingstarted.html#core-concepts">1. Core Concepts</a></span></dt><dt><span class="sect1"><a href="gettingstarted.html#concept-screens-and-menus">2. Screens and Menus</a></span></dt><dd><dl><dt><span class="sect2"><a href="gettingstarted.html#intro-index">2.1. Index</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-pager">2.2. Pager</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-browser">2.3. File Browser</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-sidebar">2.4. Sidebar</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-help">2.5. Help</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-compose">2.6. Compose Menu</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-alias">2.7. Alias Menu</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-attach">2.8. Attachment Menu</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#intro-list">2.9. List Menu</a></span></dt></dl></dd><dt><span class="sect1"><a href="gettingstarted.html#menus">3. Moving Around in Menus</a></span></dt><dt><span class="sect1"><a href="gettingstarted.html#editing">4. Editing Input Fields</a></span></dt><dd><dl><dt><span class="sect2"><a href="gettingstarted.html#editing-intro">4.1. Introduction</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#editing-buffy-cycle">4.2. Buffy Cycle</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#editing-history">4.3. History</a></span></dt></dl></dd><dt><span class="sect1"><a href="gettingstarted.html#reading">5. Reading Mail</a></span></dt><dd><dl><dt><span class="sect2"><a href="gettingstarted.html#index-menu">5.1. The Message Index</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#pager-menu">5.2. The Pager</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#threads">5.3. Threaded Mode</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#reading-misc">5.4. Miscellaneous Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="gettingstarted.html#sending">6. Sending Mail</a></span></dt><dd><dl><dt><span class="sect2"><a href="gettingstarted.html#sending-intro">6.1. Introduction</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#edit-header">6.2. Editing the Message Header</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#sending-crypto">6.3. Sending Cryptographically Signed/Encrypted Messages</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#ff">6.4. Sending Format=Flowed Messages</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#bgedit">6.5. Background Editing</a></span></dt></dl></dd><dt><span class="sect1"><a href="gettingstarted.html#forwarding-mail">7. Forwarding and Bouncing Mail</a></span></dt><dt><span class="sect1"><a href="gettingstarted.html#postponing-mail">8. Postponing Mail</a></span></dt><dt><span class="sect1"><a href="gettingstarted.html#encryption">9. Encryption and Signing</a></span></dt><dd><dl><dt><span class="sect2"><a href="gettingstarted.html#enc-pgp">9.1. OpenPGP Configuration</a></span></dt><dt><span class="sect2"><a href="gettingstarted.html#enc-smime">9.2. S/MIME Configuration</a></span></dt></dl></dd></dl></div><p>
This section is intended as a brief overview of how to use Mutt. There
are many other features which are described elsewhere in the manual.
There is even more information available in the Mutt FAQ and various web
pages. See the <a class="ulink" href="http://www.mutt.org/" target="_top">Mutt homepage</a>
for more details.
</p><p>
The keybindings described in this section are the defaults as
distributed. Your local system administrator may have altered the
defaults for your site. You can always type <span class="quote"><span class="quote">?</span></span> in any
menu to display the current bindings.
</p><p>
The first thing you need to do is invoke Mutt, simply by typing
<code class="literal">mutt</code> at the command line. There are various
command-line options, see either the Mutt man page or the <a class="link" href="reference.html#commandline" title="1. Command-Line Options">reference</a>.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="core-concepts"></a>1. Core Concepts</h2></div></div></div><p>
Mutt is a text-based application which interacts with users through
different menus which are mostly line-/entry-based or page-based. A
line-based menu is the so-called <span class="quote"><span class="quote">index</span></span> menu (listing all
messages of the currently opened folder) or the <span class="quote"><span class="quote">alias</span></span>
menu (allowing you to select recipients from a list). Examples for
page-based menus are the <span class="quote"><span class="quote">pager</span></span> (showing one message at a
time) or the <span class="quote"><span class="quote">help</span></span> menu listing all available key
bindings.
</p><p>
The user interface consists of a context sensitive help line at the top,
the menu's contents followed by a context sensitive status line and
finally the command line. The command line is used to display
informational and error messages as well as for prompts and for entering
interactive commands.
</p><p>
Mutt is configured through variables which, if the user wants to
permanently use a non-default value, are written to configuration
files. Mutt supports a rich config file syntax to make even complex
configuration files readable and commentable.
</p><p>
Because Mutt allows for customizing almost all key bindings, there are
so-called <span class="quote"><span class="quote">functions</span></span> which can be executed manually (using
the command line) or in macros. Macros allow the user to bind a sequence
of commands to a single key or a short key sequence instead of repeating
a sequence of actions over and over.
</p><p>
Many commands (such as saving or copying a message to another folder)
can be applied to a single message or a set of messages (so-called
<span class="quote"><span class="quote">tagged</span></span> messages). To help selecting messages, Mutt
provides a rich set of message patterns (such as recipients, sender,
body contents, date sent/received, etc.) which can be combined into
complex expressions using the boolean <span class="emphasis"><em>and</em></span> and
<span class="emphasis"><em>or</em></span> operations as well as negating. These patterns
can also be used to (for example) search for messages or to limit the
index to show only matching messages.
</p><p>
Mutt supports a <span class="quote"><span class="quote">hook</span></span> concept which allows the user to
execute arbitrary configuration commands and functions in certain
situations such as entering a folder, starting a new message or replying
to an existing one. These hooks can be used to highly customize Mutt's
behavior including managing multiple identities, customizing the
display for a folder or even implementing auto-archiving based on a
per-folder basis and much more.
</p><p>
Besides an interactive mode, Mutt can also be used as a command-line
tool to send messages. It also supports a
<code class="literal">mailx(1)</code>-compatible interface, see <a class="xref" href="reference.html#tab-commandline-options" title="Table 9.1. Command line options">Table 9.1, “Command line options”</a> for a complete list of command-line
options.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="concept-screens-and-menus"></a>2. Screens and Menus</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-index"></a>2.1. Index</h3></div></div></div><p>
The index is the screen that you usually see first when you start
Mutt. It gives an overview over your emails in the currently opened
mailbox. By default, this is your system mailbox. The information you
see in the index is a list of emails, each with its number on the left,
its flags (new email, important email, email that has been forwarded or
replied to, tagged email, ...), the date when email was sent, its
sender, the email size, and the subject. Additionally, the index also
shows thread hierarchies: when you reply to an email, and the other
person replies back, you can see the other person's email in a
"sub-tree" below. This is especially useful for personal email between
a group of people or when you've subscribed to mailing lists.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-pager"></a>2.2. Pager</h3></div></div></div><p>
The pager is responsible for showing the email content. On the top of
the pager you have an overview over the most important email headers
like the sender, the recipient, the subject, and much more
information. How much information you actually see depends on your
configuration, which we'll describe below.
</p><p>
Below the headers, you see the email body which usually contains the
message. If the email contains any attachments, you will see more
information about them below the email body, or, if the attachments are
text files, you can view them directly in the pager.
</p><p>
To give the user a good overview, it is possible to configure Mutt to
show different things in the pager with different colors. Virtually
everything that can be described with a regular expression can be
colored, e.g. URLs, email addresses or smileys.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-browser"></a>2.3. File Browser</h3></div></div></div><p>
The file browser is the interface to the local or remote file
system. When selecting a mailbox to open, the browser allows custom
sorting of items, limiting the items shown by a regular expression and a
freely adjustable format of what to display in which way. It also allows
for easy navigation through the file system when selecting file(s) to
attach to a message, select multiple files to attach and many more.
</p><p>
Some mail systems can nest mail folders inside other mail folders.
The normal open entry commands in mutt will open the mail folder and
you can't see the sub-folders. If you instead use the
<code class="literal">&lt;descend-directory&gt;</code> function it will go into
the directory and not open it as a mail directory.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-sidebar"></a>2.4. Sidebar</h3></div></div></div><p>
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.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-help"></a>2.5. Help</h3></div></div></div><p>
The help screen is meant to offer a quick help to the user. It lists the
current configuration of key bindings and their associated commands
including a short description, and currently unbound functions that
still need to be associated with a key binding (or alternatively, they
can be called via the Mutt command prompt).
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-compose"></a>2.6. Compose Menu</h3></div></div></div><p>
The compose menu features a split screen containing the information
which really matter before actually sending a message by mail: who gets
the message as what (recipients and who gets what kind of
copy). Additionally, users may set security options like deciding
whether to sign, encrypt or sign and encrypt a message with/for what
keys. Also, it's used to attach messages, to re-edit any attachment
including the message itself.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-alias"></a>2.7. Alias Menu</h3></div></div></div><p>
The alias menu is used to help users finding the recipients of
messages. For users who need to contact many people, there's no need to
remember addresses or names completely because it allows for searching,
too. The alias mechanism and thus the alias menu also features grouping
several addresses by a shorter nickname, the actual alias, so that users
don't have to select each single recipient manually.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-attach"></a>2.8. Attachment Menu</h3></div></div></div><p>
As will be later discussed in detail, Mutt features a good and stable
MIME implementation, that is, it supports sending and receiving messages
of arbitrary MIME types. The attachment menu displays a message's
structure in detail: what content parts are attached to which parent
part (which gives a true tree structure), which type is of what type and
what size. Single parts may saved, deleted or modified to offer great
and easy access to message's internals.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="intro-list"></a>2.9. List Menu</h3></div></div></div><p>
The list menu assists with operations on mailing lists. RFC 2369 defines
several interactions with mailing lists and list memberships that can
be specified within the email message: subscribe, unsubscribe, contact
the list owner, etc. When you invoke the list menu, these interactions
are made accessible as menu options.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="menus"></a>3. Moving Around in Menus</h2></div></div></div><p>
The most important navigation keys common to line- or entry-based menus
are shown in <a class="xref" href="gettingstarted.html#tab-keys-nav-line" title="Table 2.1. Most common navigation keys in entry-based menus">Table 2.1, “Most common navigation keys in entry-based menus”</a> and in <a class="xref" href="gettingstarted.html#tab-keys-nav-page" title="Table 2.2. Most common navigation keys in page-based menus">Table 2.2, “Most common navigation keys in page-based menus”</a> for page-based menus.
</p><div class="table"><a id="tab-keys-nav-line"></a><p class="title"><strong>Table 2.1. Most common navigation keys in entry-based menus</strong></p><div class="table-contents"><table class="table" summary="Most common navigation keys in entry-based menus" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key</th><th>Function</th><th>Description</th></tr></thead><tbody><tr><td>j or &lt;Down&gt;</td><td><code class="literal">&lt;next-entry&gt;</code></td><td>move to the next entry</td></tr><tr><td>k or &lt;Up&gt;</td><td><code class="literal">&lt;previous-entry&gt;</code></td><td>move to the previous entry</td></tr><tr><td>z or &lt;PageDn&gt;</td><td><code class="literal">&lt;page-down&gt;</code></td><td>go to the next page</td></tr><tr><td>Z or &lt;PageUp&gt;</td><td><code class="literal">&lt;page-up&gt;</code></td><td>go to the previous page</td></tr><tr><td>= or &lt;Home&gt;</td><td><code class="literal">&lt;first-entry&gt;</code></td><td>jump to the first entry</td></tr><tr><td>* or &lt;End&gt;</td><td><code class="literal">&lt;last-entry&gt;</code></td><td>jump to the last entry</td></tr><tr><td>q</td><td><code class="literal">&lt;quit&gt;</code></td><td>exit the current menu</td></tr><tr><td>?</td><td><code class="literal">&lt;help&gt;</code></td><td>list all keybindings for the current menu</td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="tab-keys-nav-page"></a><p class="title"><strong>Table 2.2. Most common navigation keys in page-based menus</strong></p><div class="table-contents"><table class="table" summary="Most common navigation keys in page-based menus" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key</th><th>Function</th><th>Description</th></tr></thead><tbody><tr><td>J or &lt;Return&gt;</td><td><code class="literal">&lt;next-line&gt;</code></td><td>scroll down one line</td></tr><tr><td>&lt;Backspace&gt;</td><td><code class="literal">&lt;previous-line&gt;</code></td><td>scroll up one line</td></tr><tr><td>K, &lt;Space&gt; or &lt;PageDn&gt;</td><td><code class="literal">&lt;next-page&gt;</code></td><td>move to the next page</td></tr><tr><td>- or &lt;PageUp&gt;</td><td><code class="literal">&lt;previous-page&gt;</code></td><td>move the previous page</td></tr><tr><td>&lt;Home&gt;</td><td><code class="literal">&lt;top&gt;</code></td><td>move to the top</td></tr><tr><td>&lt;End&gt;</td><td><code class="literal">&lt;bottom&gt;</code></td><td>move to the bottom</td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="editing"></a>4. Editing Input Fields</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="editing-intro"></a>4.1. Introduction</h3></div></div></div><p>
Mutt has a built-in line editor for inputting text, e.g. email addresses
or filenames. The keys used to manipulate text input are very similar to
those of Emacs. See <a class="xref" href="reference.html#editor-map" title="4.13. Editor Menu">Section 4.13, “Editor Menu”</a> for a full
reference of available functions, their default key bindings, and short
descriptions.
</p><div class="table"><a id="tab-keys-editor"></a><p class="title"><strong>Table 2.3. Most common line editor keys</strong></p><div class="table-contents"><table class="table" summary="Most common line editor keys" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key</th><th>Function</th><th>Description</th></tr></thead><tbody><tr><td>^A or &lt;Home&gt;</td><td><code class="literal">&lt;bol&gt;</code></td><td>move to the start of the line</td></tr><tr><td>^B or &lt;Left&gt;</td><td><code class="literal">&lt;backward-char&gt;</code></td><td>move back one char</td></tr><tr><td>Esc B</td><td><code class="literal">&lt;backward-word&gt;</code></td><td>move back one word</td></tr><tr><td>&lt;Space&gt;</td><td><code class="literal">&lt;buffy-cycle&gt;</code></td><td>cycle among incoming mailboxes</td></tr><tr><td>^D or &lt;Delete&gt;</td><td><code class="literal">&lt;delete-char&gt;</code></td><td>delete the char under the cursor</td></tr><tr><td>^E or &lt;End&gt;</td><td><code class="literal">&lt;eol&gt;</code></td><td>move to the end of the line</td></tr><tr><td>^F or &lt;Right&gt;</td><td><code class="literal">&lt;forward-char&gt;</code></td><td>move forward one char</td></tr><tr><td>Esc F</td><td><code class="literal">&lt;forward-word&gt;</code></td><td>move forward one word</td></tr><tr><td>&lt;Tab&gt;</td><td><code class="literal">&lt;complete&gt;</code></td><td>complete filename, alias, or label</td></tr><tr><td>^T</td><td><code class="literal">&lt;complete-query&gt;</code></td><td>complete address with query</td></tr><tr><td>^K</td><td><code class="literal">&lt;kill-eol&gt;</code></td><td>delete to the end of the line</td></tr><tr><td>Esc d</td><td><code class="literal">&lt;kill-eow&gt;</code></td><td>delete to the end of the word</td></tr><tr><td>^W</td><td><code class="literal">&lt;kill-word&gt;</code></td><td>kill the word in front of the cursor</td></tr><tr><td>^U</td><td><code class="literal">&lt;kill-line&gt;</code></td><td>delete entire line</td></tr><tr><td>^V</td><td><code class="literal">&lt;quote-char&gt;</code></td><td>quote the next typed key</td></tr><tr><td>&lt;Up&gt;</td><td><code class="literal">&lt;history-up&gt;</code></td><td>recall previous string from history</td></tr><tr><td>&lt;Down&gt;</td><td><code class="literal">&lt;history-down&gt;</code></td><td>recall next string from history</td></tr><tr><td>^R</td><td><code class="literal">&lt;history-search&gt;</code></td><td>use current input to search history</td></tr><tr><td>&lt;BackSpace&gt;</td><td><code class="literal">&lt;backspace&gt;</code></td><td>kill the char in front of the cursor</td></tr><tr><td>Esc u</td><td><code class="literal">&lt;upcase-word&gt;</code></td><td>convert word to upper case</td></tr><tr><td>Esc l</td><td><code class="literal">&lt;downcase-word&gt;</code></td><td>convert word to lower case</td></tr><tr><td>Esc c</td><td><code class="literal">&lt;capitalize-word&gt;</code></td><td>capitalize the word</td></tr><tr><td>^G</td><td>n/a</td><td>abort</td></tr><tr><td>&lt;Return&gt;</td><td>n/a</td><td>finish editing</td></tr></tbody></table></div></div><br class="table-break" /><p>
<code class="literal">^G</code> is the generic <span class="quote"><span class="quote">abort</span></span> key
in Mutt. In addition to the line editor, it can also be used
to abort prompts. Generally, typing <code class="literal">^G</code> at a
confirmation prompt or line editor should abort the entire action.
</p><p>
You can remap the <span class="emphasis"><em>editor</em></span> functions using the <a class="link" href="configuration.html#bind" title="6. Changing the Default Key Bindings"><span class="command"><strong>bind</strong></span></a> command. For example, to
make the &lt;Delete&gt; key delete the character in front of the cursor
rather than under, you could use:
</p><pre class="screen">
bind editor &lt;delete&gt; backspace
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="editing-buffy-cycle"></a>4.2. Buffy Cycle</h3></div></div></div><p>
The <code class="literal">&lt;buffy-cycle&gt;</code> function key binding is
enabled in the prompt for <code class="literal">&lt;change-folder&gt;</code> or
<code class="literal">&lt;change-folder-readonly&gt;</code>. Typing the key
will cycle through mailboxes with new mail.
</p><p>
In other prompts for a mailbox or a file (such as for saving an
attachment), the key binding instead invokes the
<code class="literal">&lt;complete&gt;</code> function.
</p><p>
In either case, if you need to type the key literally (e.g. you need
to enter a file name with a space in it), use the
<code class="literal">&lt;quote-char&gt;</code> function. For example, with the
default key bindings, by typing <span class="quote"><span class="quote"><code class="literal">^V</code></span></span>
and then <span class="quote"><span class="quote"><code class="literal">&lt;Space&gt;</code></span></span>.
</p><p>
In all other input fields, the <code class="literal">&lt;buffy-cycle&gt;</code>
key binding is ignored; typing the key simply adds it to the input
field text.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="editing-history"></a>4.3. History</h3></div></div></div><p>
Mutt maintains a history for the built-in editor. The number of items
is controlled by the <a class="link" href="reference.html#history" title="3.124. history">$history</a> variable
and can be made persistent using an external file specified using <a class="link" href="reference.html#history-file" title="3.125. history_file">$history_file</a> and <a class="link" href="reference.html#save-history" title="3.295. save_history">$save_history</a>. You may cycle through them
at an editor prompt by using the <code class="literal">&lt;history-up&gt;</code>
and/or <code class="literal">&lt;history-down&gt;</code> commands. Mutt will
remember the currently entered text as you cycle through history, and
will wrap around to the initial entry line.
</p><p>
Mutt maintains several distinct history lists, one for each of the
following categories:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="literal">.muttrc</code> commands</p></li><li class="listitem"><p>addresses and aliases</p></li><li class="listitem"><p>shell commands</p></li><li class="listitem"><p>filenames</p></li><li class="listitem"><p>mailboxes</p></li><li class="listitem"><p>patterns</p></li><li class="listitem"><p>everything else</p></li></ul></div><p>
Mutt automatically filters out consecutively repeated items from the
history. If <a class="link" href="reference.html#history-remove-dups" title="3.126. history_remove_dups">$history_remove_dups</a>
is set, all repeated items are removed from the history. It also mimics the
behavior of some shells by ignoring items starting with a space. The latter
feature can be useful in macros to not clobber the history's valuable entries
with unwanted entries.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="reading"></a>5. Reading Mail</h2></div></div></div><p>
Similar to many other mail clients, there are two modes in which mail is
read in Mutt. The first is a list of messages in the mailbox, which is
called the <span class="quote"><span class="quote">index</span></span> menu in Mutt. The second mode is the
display of the message contents. This is called the
<span class="quote"><span class="quote">pager.</span></span>
</p><p>
The next few sections describe the functions provided in each of these
modes.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="index-menu"></a>5.1. The Message Index</h3></div></div></div><p>
Common keys used to navigate through and manage messages in the index
are shown in <a class="xref" href="gettingstarted.html#tab-key-index" title="Table 2.4. Most common message index keys">Table 2.4, “Most common message index keys”</a>. How messages are presented
in the index menu can be customized using the <a class="link" href="reference.html#index-format" title="3.161. index_format">$index_format</a> variable.
</p><div class="table"><a id="tab-key-index"></a><p class="title"><strong>Table 2.4. Most common message index keys</strong></p><div class="table-contents"><table class="table" summary="Most common message index keys" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Key</th><th>Description</th></tr></thead><tbody><tr><td>c</td><td>change to a different mailbox</td></tr><tr><td>Esc c</td><td>change to a folder in read-only mode</td></tr><tr><td>C</td><td>copy the current message to another mailbox</td></tr><tr><td>Esc C</td><td>decode a message and copy it to a folder</td></tr><tr><td>Esc s</td><td>decode a message and save it to a folder</td></tr><tr><td>D</td><td>delete messages matching a pattern</td></tr><tr><td>d</td><td>delete the current message</td></tr><tr><td>F</td><td>mark as important</td></tr><tr><td>l</td><td>show messages matching a pattern</td></tr><tr><td>N</td><td>mark message as new</td></tr><tr><td>o</td><td>change the current sort method</td></tr><tr><td>O</td><td>reverse sort the mailbox</td></tr><tr><td>q</td><td>save changes and exit</td></tr><tr><td>s</td><td>save-message</td></tr><tr><td>T</td><td>tag messages matching a pattern</td></tr><tr><td>t</td><td>toggle the tag on a message</td></tr><tr><td>Esc t</td><td>toggle tag on entire message thread</td></tr><tr><td>U</td><td>undelete messages matching a pattern</td></tr><tr><td>u</td><td>undelete-message</td></tr><tr><td>v</td><td>view-attachments</td></tr><tr><td>x</td><td>abort changes and exit</td></tr><tr><td>&lt;Return&gt;</td><td>display-message</td></tr><tr><td>&lt;Tab&gt;</td><td>jump to the next new or unread message</td></tr><tr><td>@</td><td>show the author's full e-mail address</td></tr><tr><td>$</td><td>save changes to mailbox</td></tr><tr><td>/</td><td>search</td></tr><tr><td>Esc /</td><td>search-reverse</td></tr><tr><td>^L</td><td>clear and redraw the screen</td></tr><tr><td>^T</td><td>untag messages matching a pattern</td></tr></tbody></table></div></div><br class="table-break" /><p>
In addition to who sent the message and the subject, a short summary of
the disposition of each message is printed beside the message number.
Zero or more of the <span class="quote"><span class="quote">flags</span></span> in <a class="xref" href="gettingstarted.html#tab-msg-status-flags" title="Table 2.5. Message status flags">Table 2.5, “Message status flags”</a> may appear, some of which can be turned
on or off using these functions: <code class="literal">&lt;set-flag&gt;</code> and
<code class="literal">&lt;clear-flag&gt;</code> bound by default to
<span class="quote"><span class="quote">w</span></span> and <span class="quote"><span class="quote">W</span></span> respectively.
</p><p>
Furthermore, the flags in <a class="xref" href="gettingstarted.html#tab-msg-recip-flags" title="Table 2.6. Message recipient flags">Table 2.6, “Message recipient flags”</a> reflect
who the message is addressed to. They can be customized with the <a class="link" href="reference.html#to-chars" title="3.400. to_chars">$to_chars</a> variable.
</p><div class="table"><a id="tab-msg-status-flags"></a><p class="title"><strong>Table 2.5. Message status flags</strong></p><div class="table-contents"><table class="table" summary="Message status flags" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td>D</td><td>message is deleted (is marked for deletion)</td></tr><tr><td>d</td><td>message has attachments marked for deletion</td></tr><tr><td>K</td><td>contains a PGP public key</td></tr><tr><td>N</td><td>message is new</td></tr><tr><td>O</td><td>message is old</td></tr><tr><td>P</td><td>message is PGP encrypted</td></tr><tr><td>r</td><td>message has been replied to</td></tr><tr><td>S</td><td>message is signed, and the signature is successfully verified</td></tr><tr><td>s</td><td>message is signed</td></tr><tr><td>!</td><td>message is flagged</td></tr><tr><td>*</td><td>message is tagged</td></tr><tr><td>n</td><td>thread contains new messages (only if collapsed)</td></tr><tr><td>o</td><td>thread contains old messages (only if collapsed)</td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="tab-msg-recip-flags"></a><p class="title"><strong>Table 2.6. Message recipient flags</strong></p><div class="table-contents"><table class="table" summary="Message recipient flags" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td>+</td><td>message is to you and you only</td></tr><tr><td>T</td><td>message is to you, but also to or CC'ed to others</td></tr><tr><td>C</td><td>message is CC'ed to you</td></tr><tr><td>F</td><td>message is from you</td></tr><tr><td>L</td><td>message is sent to a subscribed mailing list</td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="pager-menu"></a>5.2. The Pager</h3></div></div></div><p>
By default, Mutt uses its built-in pager to display the contents of
messages (an external pager such as <code class="literal">less(1)</code> can be
configured, see <a class="link" href="reference.html#pager" title="3.205. pager">$pager</a> variable). The
pager is very similar to the Unix program <code class="literal">less(1)</code>
though not nearly as featureful.
</p><div class="table"><a id="tab-key-pager"></a><p class="title"><strong>Table 2.7. Most common pager keys</strong></p><div class="table-contents"><table class="table" summary="Most common pager keys" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Key</th><th>Description</th></tr></thead><tbody><tr><td>&lt;Return&gt;</td><td>go down one line</td></tr><tr><td>&lt;Space&gt;</td><td>display the next page (or next message if at the end of a message)</td></tr><tr><td>-</td><td>go back to the previous page</td></tr><tr><td>n</td><td>search for next match</td></tr><tr><td>S</td><td>skip beyond quoted text</td></tr><tr><td>T</td><td>toggle display of quoted text</td></tr><tr><td>?</td><td>show keybindings</td></tr><tr><td>/</td><td>regular expression search</td></tr><tr><td>Esc /</td><td>backward regular expression search</td></tr><tr><td>\</td><td>toggle highlighting of search matches</td></tr><tr><td>^</td><td>jump to the top of the message</td></tr></tbody></table></div></div><br class="table-break" /><p>
In addition to key bindings in <a class="xref" href="gettingstarted.html#tab-key-pager" title="Table 2.7. Most common pager keys">Table 2.7, “Most common pager keys”</a>, many of
the functions from the index menu are also available in the pager, such
as <code class="literal">&lt;delete-message&gt;</code> or
<code class="literal">&lt;copy-message&gt;</code> (this is one advantage over
using an external pager to view messages).
</p><p>
Also, the internal pager supports a couple other advanced features. For
one, it will accept and translate the <span class="quote"><span class="quote">standard</span></span> nroff
sequences for bold and underline. These sequences are a series of either
the letter, backspace (<span class="quote"><span class="quote">^H</span></span>), the letter again for bold or
the letter, backspace, <span class="quote"><span class="quote">_</span></span> for denoting underline. Mutt
will attempt to display these in bold and underline respectively if your
terminal supports them. If not, you can use the bold and underline <a class="link" href="configuration.html#color" title="11. Using Color and Mono Video Attributes">color</a> objects to specify a
<span class="command"><strong>color</strong></span> or mono attribute for them.
</p><p>
Additionally, the internal pager supports the ANSI escape sequences for
character attributes. Mutt translates them into the correct color and
character settings. The sequences Mutt supports are:
</p><pre class="screen">
\e[<span class="emphasis"><em>Ps</em></span>;<span class="emphasis"><em>Ps</em></span>;..<span class="emphasis"><em>Ps</em></span>;m
</pre><p>
where <span class="emphasis"><em>Ps</em></span> can be one of the codes shown in <a class="xref" href="gettingstarted.html#tab-ansi-esc" title="Table 2.8. ANSI escape sequences">Table 2.8, “ANSI escape sequences”</a>.
</p><div class="table"><a id="tab-ansi-esc"></a><p class="title"><strong>Table 2.8. ANSI escape sequences</strong></p><div class="table-contents"><table class="table" summary="ANSI escape sequences" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Escape code</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>All attributes off</td></tr><tr><td>1</td><td>Bold on</td></tr><tr><td>4</td><td>Underline on</td></tr><tr><td>5</td><td>Blink on</td></tr><tr><td>7</td><td>Reverse video on</td></tr><tr><td>3<span class="emphasis"><em>&lt;color&gt;</em></span></td><td>Foreground color is <span class="emphasis"><em>&lt;color&gt;</em></span> (see <a class="xref" href="gettingstarted.html#tab-color" title="Table 2.9. Color sequences">Table 2.9, “Color sequences”</a>)</td></tr><tr><td>4<span class="emphasis"><em>&lt;color&gt;</em></span></td><td>Background color is <span class="emphasis"><em>&lt;color&gt;</em></span> (see <a class="xref" href="gettingstarted.html#tab-color" title="Table 2.9. Color sequences">Table 2.9, “Color sequences”</a>)</td></tr><tr><td>38;5;<span class="emphasis"><em>&lt;color&gt;</em></span></td><td>Foreground color is an 8-bit <span class="emphasis"><em>&lt;color&gt;</em></span></td></tr><tr><td>48;5;<span class="emphasis"><em>&lt;color&gt;</em></span></td><td>Background color is an 8-bit <span class="emphasis"><em>&lt;color&gt;</em></span></td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="tab-color"></a><p class="title"><strong>Table 2.9. Color sequences</strong></p><div class="table-contents"><table class="table" summary="Color sequences" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Color code</th><th>Color</th></tr></thead><tbody><tr><td>0</td><td>Black</td></tr><tr><td>1</td><td>Red</td></tr><tr><td>2</td><td>Green</td></tr><tr><td>3</td><td>Yellow</td></tr><tr><td>4</td><td>Blue</td></tr><tr><td>5</td><td>Magenta</td></tr><tr><td>6</td><td>Cyan</td></tr><tr><td>7</td><td>White</td></tr></tbody></table></div></div><br class="table-break" /><p>
Mutt uses these attributes for handling <code class="literal">text/enriched</code>
messages, and they can also be used by an external <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">autoview</a> script for highlighting purposes.
</p><div class="note"><h3 class="title">Note</h3><p>
If you change the colors for your display, for example by changing the
color associated with color2 for your xterm, then that color will be
used instead of green.
</p></div><div class="note"><h3 class="title">Note</h3><p>
Note that the search commands in the pager take regular expressions,
which are not quite the same as the more complex <a class="link" href="advancedusage.html#patterns" title="3. Patterns: Searching, Limiting and Tagging">patterns</a> used by the search command in the
index. This is because patterns are used to select messages by criteria
whereas the pager already displays a selected message.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="threads"></a>5.3. Threaded Mode</h3></div></div></div><p>
So-called <span class="quote"><span class="quote">threads</span></span> provide a hierarchy of messages where
replies are linked to their parent message(s). This organizational form
is extremely useful in mailing lists where different parts of the
discussion diverge. Mutt displays threads as a tree structure.
</p><p>
In Mutt, when a mailbox is <a class="link" href="reference.html#sort" title="3.362. sort">sorted</a>
by <span class="emphasis"><em>threads</em></span>, there are a few additional functions
available in the <span class="emphasis"><em>index</em></span>
and <span class="emphasis"><em>pager</em></span> modes as shown in
<a class="xref" href="gettingstarted.html#tab-key-threads" title="Table 2.10. Most common thread mode keys">Table 2.10, “Most common thread mode keys”</a>.
</p><div class="table"><a id="tab-key-threads"></a><p class="title"><strong>Table 2.10. Most common thread mode keys</strong></p><div class="table-contents"><table class="table" summary="Most common thread mode keys" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key</th><th>Function</th><th>Description</th></tr></thead><tbody><tr><td>^D</td><td><code class="literal">&lt;delete-thread&gt;</code></td><td>delete all messages in the current thread</td></tr><tr><td>^U</td><td><code class="literal">&lt;undelete-thread&gt;</code></td><td>undelete all messages in the current thread</td></tr><tr><td>^N</td><td><code class="literal">&lt;next-thread&gt;</code></td><td>jump to the start of the next thread</td></tr><tr><td>^P</td><td><code class="literal">&lt;previous-thread&gt;</code></td><td>jump to the start of the previous thread</td></tr><tr><td>^R</td><td><code class="literal">&lt;read-thread&gt;</code></td><td>mark the current thread as read</td></tr><tr><td>Esc d</td><td><code class="literal">&lt;delete-subthread&gt;</code></td><td>delete all messages in the current subthread</td></tr><tr><td>Esc u</td><td><code class="literal">&lt;undelete-subthread&gt;</code></td><td>undelete all messages in the current subthread</td></tr><tr><td>Esc n</td><td><code class="literal">&lt;next-subthread&gt;</code></td><td>jump to the start of the next subthread</td></tr><tr><td>Esc p</td><td><code class="literal">&lt;previous-subthread&gt;</code></td><td>jump to the start of the previous subthread</td></tr><tr><td>Esc r</td><td><code class="literal">&lt;read-subthread&gt;</code></td><td>mark the current subthread as read</td></tr><tr><td>Esc t</td><td><code class="literal">&lt;tag-thread&gt;</code></td><td>toggle the tag on the current thread</td></tr><tr><td>Esc v</td><td><code class="literal">&lt;collapse-thread&gt;</code></td><td>toggle collapse for the current thread</td></tr><tr><td>Esc V</td><td><code class="literal">&lt;collapse-all&gt;</code></td><td>toggle collapse for all threads</td></tr><tr><td>P</td><td><code class="literal">&lt;parent-message&gt;</code></td><td>jump to parent message in thread</td></tr></tbody></table></div></div><br class="table-break" /><p>
In the <span class="emphasis"><em>index</em></span>, the subject of threaded children
messages will be prepended with thread tree characters. By default,
the subject itself will not be duplicated unless <a class="link" href="reference.html#hide-thread-subject" title="3.121. hide_thread_subject">$hide_thread_subject</a> is unset.
Special characters will be added to the thread tree as detailed in
<a class="xref" href="gettingstarted.html#tab-thread-chars" title="Table 2.11. Special Thread Characters">Table 2.11, “Special Thread Characters”</a>.
</p><div class="table"><a id="tab-thread-chars"></a><p class="title"><strong>Table 2.11. Special Thread Characters</strong></p><div class="table-contents"><table class="table" summary="Special Thread Characters" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Character</th><th>Description</th><th>Notes</th></tr></thead><tbody><tr><td>&amp;</td><td>hidden message</td><td>see <a class="link" href="reference.html#hide-limited" title="3.119. hide_limited">$hide_limited</a> and
<a class="link" href="reference.html#hide-top-limited" title="3.122. hide_top_limited">$hide_top_limited</a></td></tr><tr><td>?</td><td>missing message</td><td>see <a class="link" href="reference.html#hide-missing" title="3.120. hide_missing">$hide_missing</a> and
<a class="link" href="reference.html#hide-top-missing" title="3.123. hide_top_missing">$hide_top_missing</a></td></tr><tr><td>*</td><td>pseudo thread</td><td>see <a class="link" href="reference.html#strict-threads" title="3.391. strict_threads">$strict_threads</a>;
not displayed when
<a class="link" href="reference.html#narrow-tree" title="3.202. narrow_tree">$narrow_tree</a> is set</td></tr><tr><td>=</td><td>duplicate thread</td><td>see <a class="link" href="reference.html#duplicate-threads" title="3.83. duplicate_threads">$duplicate_threads</a>;
not displayed when
<a class="link" href="reference.html#narrow-tree" title="3.202. narrow_tree">$narrow_tree</a> is set</td></tr></tbody></table></div></div><br class="table-break" /><p>
Collapsing a thread displays only the first message in the thread and
hides the others. This is useful when threads contain so many messages
that you can only see a handful of threads on the screen. See %M in
<a class="link" href="reference.html#index-format" title="3.161. index_format">$index_format</a>. For example, you
could use <span class="quote"><span class="quote">%?M?(#%03M)&amp;(%4l)?</span></span> in <a class="link" href="reference.html#index-format" title="3.161. index_format">$index_format</a> to optionally display the
number of hidden messages if the thread is collapsed. The
<code class="literal">%?&lt;char&gt;?&lt;if-part&gt;&amp;&lt;else-part&gt;?</code>
syntax is explained in detail in <a class="link" href="configuration.html#formatstrings-conditionals" title="32.2. Conditionals">format string conditionals</a>.
</p><p>
Technically, every reply should contain a list of its parent messages in
the thread tree, but not all do. In these cases, Mutt groups them by
subject which can be controlled using the <a class="link" href="reference.html#strict-threads" title="3.391. strict_threads">$strict_threads</a> variable.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="reading-misc"></a>5.4. Miscellaneous Functions</h3></div></div></div><p>
In addition, the <span class="emphasis"><em>index</em></span> and
<span class="emphasis"><em>pager</em></span> menus have these interesting functions:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<code class="literal">&lt;check-stats&gt;</code><a id="check-stats"></a>
</span></dt><dd><p>
Calculate statistics for all monitored mailboxes declared using the
<span class="command"><strong>mailboxes</strong></span> command.
It will calculate statistics despite
<a class="link" href="reference.html#mail-check-stats" title="3.167. mail_check_stats">$mail_check_stats</a> being unset.
</p></dd><dt><span class="term">
<code class="literal">&lt;create-alias&gt;</code><a id="create-alias"></a>
(default: a)
</span></dt><dd><p>
Creates a new alias based upon the current message (or prompts for a new
one). Once editing is complete, an <a class="link" href="configuration.html#alias" title="5. Defining/Using Aliases"><span class="command"><strong>alias</strong></span></a> command is added to the
file specified by the <a class="link" href="reference.html#alias-file" title="3.5. alias_file">$alias_file</a>
variable for future use
</p><div class="note"><h3 class="title">Note</h3><p>
Mutt does not read the <a class="link" href="reference.html#alias-file" title="3.5. alias_file">$alias_file</a>
upon startup so you must explicitly <a class="link" href="configuration.html#source" title="30. Reading Initialization Commands From Another File"><span class="command"><strong>source</strong></span></a> the file.
</p></div></dd><dt><span class="term">
<code class="literal">&lt;check-traditional-pgp&gt;</code><a id="check-traditional-pgp"></a> (default: Esc P)
</span></dt><dd><p>
This function will search the current message for content signed or
encrypted with PGP the <span class="quote"><span class="quote">traditional</span></span> way, that is, without
proper MIME tagging. Technically, this function will temporarily change
the MIME content types of the body parts containing PGP data; this is
similar to the <a class="link" href="gettingstarted.html#edit-type"><code class="literal">&lt;edit-type&gt;</code></a>
function's effect.
</p></dd><dt><span class="term">
<code class="literal">&lt;edit&gt;</code><a id="edit"></a> (default: e)
</span></dt><dd><p>
This command (available in the index and pager) allows you to edit the
raw current message as it's present in the mail folder. After you have
finished editing, the changed message will be appended to the current
folder, and the original message will be marked for deletion; if the
message is unchanged it won't be replaced.
</p></dd><dt><span class="term">
<code class="literal">&lt;edit-type&gt;</code><a id="edit-type"></a> (default:
^E on the attachment menu, and in the pager and index menus; ^T on the
compose menu)
</span></dt><dd><p>
This command is used to temporarily edit an attachment's content type to
fix, for instance, bogus character set parameters. When invoked from
the index or from the pager, you'll have the opportunity to edit the
top-level attachment's content type. On the <a class="link" href="mimesupport.html#attach-menu" title="1.3. The Attachment Menu">attachment menu</a>, you can change any
attachment's content type. These changes are not persistent, and get
lost upon changing folders.
</p><p>
Note that this command is also available on the <a class="link" href="mimesupport.html#compose-menu" title="1.4. The Compose Menu">compose menu</a>. There, it's used to
fine-tune the properties of attachments you are going to send.
</p></dd><dt><span class="term">
<code class="literal">&lt;enter-command&gt;</code><a id="enter-command"></a>
(default: <span class="quote"><span class="quote">:</span></span>)
</span></dt><dd><p>
This command is used to execute any command you would normally put in a
configuration file. A common use is to check the settings of variables,
or in conjunction with <a class="link" href="configuration.html#macro" title="10. Keyboard Macros">macros</a> to change
settings on the fly.
</p></dd><dt><span class="term">
<code class="literal">&lt;extract-keys&gt;</code><a id="extract-keys"></a>
(default: ^K)
</span></dt><dd><p>
This command extracts PGP public keys from the current or tagged
message(s) and adds them to your PGP public key ring.
</p></dd><dt><span class="term">
<code class="literal">&lt;forget-passphrase&gt;</code><a id="forget-passphrase"></a> (default: ^F)
</span></dt><dd><p>
This command wipes the passphrase(s) from memory. It is useful, if you
misspelled the passphrase.
</p></dd><dt><span class="term">
<code class="literal">&lt;list-reply&gt;</code><a id="list-reply"></a> (default:
L)
</span></dt><dd><p>
Reply to the current or tagged message(s) by extracting any addresses
which match the regular expressions given by the <a class="link" href="configuration.html#lists" title="14. Mailing Lists"><span class="command"><strong>lists</strong></span> or
<span class="command"><strong>subscribe</strong></span></a> commands, but also honor any
<code class="literal">Mail-Followup-To</code> header(s) if the <a class="link" href="reference.html#honor-followup-to" title="3.128. honor_followup_to">$honor_followup_to</a> configuration
variable is set. In addition, the <code class="literal">List-Post</code> header field is
examined for <code class="literal">mailto:</code> URLs specifying a mailing list address.
Using this when replying to messages posted to mailing lists helps avoid
duplicate copies being sent to the author of the message you are replying to.
</p></dd><dt><span class="term">
<code class="literal">&lt;pipe-message&gt;</code><a id="pipe-message"></a>
(default: |)
</span></dt><dd><p>
Asks for an external Unix command and pipes the current or tagged
message(s) to it. The variables <a class="link" href="reference.html#pipe-decode" title="3.245. pipe_decode">$pipe_decode</a>, <a class="link" href="reference.html#pipe-decode-weed" title="3.246. pipe_decode_weed">$pipe_decode_weed</a>, <a class="link" href="reference.html#pipe-split" title="3.248. pipe_split">$pipe_split</a>, <a class="link" href="reference.html#pipe-sep" title="3.247. pipe_sep">$pipe_sep</a> and <a class="link" href="reference.html#wait-key" title="3.416. wait_key">$wait_key</a> control the exact behavior of this
function.
</p></dd><dt><span class="term">
<code class="literal">&lt;resend-message&gt;</code><a id="resend-message"></a>
(default: Esc e)
</span></dt><dd><p>
Mutt takes the current message as a template for a new message. This
function is best described as "recall from arbitrary folders". It can
conveniently be used to forward MIME messages while preserving the
original mail structure. Note that the amount of headers included here
depends on the value of the <a class="link" href="reference.html#weed" title="3.417. weed">$weed</a> variable.
</p><p>
This function is also available from the attachment menu. You can use
this to easily resend a message which was included with a bounce message
as a <code class="literal">message/rfc822</code> body part.
</p></dd><dt><span class="term">
<code class="literal">&lt;shell-escape&gt;</code><a id="shell-escape"></a>
(default: !)
</span></dt><dd><p>
Asks for an external Unix command and executes it. The <a class="link" href="reference.html#wait-key" title="3.416. wait_key">$wait_key</a> can be used to control whether Mutt
will wait for a key to be pressed when the command returns (presumably
to let the user read the output of the command), based on the return
status of the named command. If no command is given, an interactive
shell is executed.
</p></dd><dt><span class="term">
<code class="literal">&lt;skip-headers&gt;</code><a id="skip-headers"></a>
(default: H)
</span></dt><dd><p>
This function will skip past the headers of the current message.
</p></dd><dt><span class="term">
<code class="literal">&lt;skip-quoted&gt;</code><a id="skip-quoted"></a>
(default: S)
</span></dt><dd><p>
This function will go to the next line of non-quoted text which comes
after a line of quoted text in the internal pager.
</p></dd><dt><span class="term">
<code class="literal">&lt;toggle-quoted&gt;</code><a id="toggle-quoted"></a>
(default: T)
</span></dt><dd><p>
The pager uses the <a class="link" href="reference.html#quote-regexp" title="3.274. quote_regexp">$quote_regexp</a>
variable to detect quoted text when displaying the body of the message.
This function toggles the display of the quoted material in the message.
It is particularly useful when being interested in just the response and
there is a large amount of quoted text in the way.
</p></dd></dl></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sending"></a>6. Sending Mail</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="sending-intro"></a>6.1. Introduction</h3></div></div></div><p>
The bindings shown in <a class="xref" href="gettingstarted.html#tab-key-send" title="Table 2.12. Most common mail sending keys">Table 2.12, “Most common mail sending keys”</a> are available in
the <span class="emphasis"><em>index</em></span> and <span class="emphasis"><em>pager</em></span> to start a
new message.
</p><div class="table"><a id="tab-key-send"></a><p class="title"><strong>Table 2.12. Most common mail sending keys</strong></p><div class="table-contents"><table class="table" summary="Most common mail sending keys" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key</th><th>Function</th><th>Description</th></tr></thead><tbody><tr><td>m</td><td><code class="literal">&lt;mail&gt;</code></td><td>compose a new message</td></tr><tr><td>r</td><td><code class="literal">&lt;reply&gt;</code></td><td>reply to sender</td></tr><tr><td>g</td><td><code class="literal">&lt;group-reply&gt;</code></td><td>reply to all recipients</td></tr><tr><td> </td><td><code class="literal">&lt;group-chat-reply&gt;</code></td><td>reply to all recipients preserving To/Cc</td></tr><tr><td>L</td><td><code class="literal">&lt;list-reply&gt;</code></td><td>reply to mailing list address</td></tr><tr><td>f</td><td><code class="literal">&lt;forward&gt;</code></td><td>forward message</td></tr><tr><td>b</td><td><code class="literal">&lt;bounce&gt;</code></td><td>bounce (remail) message</td></tr><tr><td>Esc k</td><td><code class="literal">&lt;mail-key&gt;</code></td><td>mail a PGP public key to someone</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="emphasis"><em>Bouncing</em></span> a message sends the message as-is to the
recipient you specify. <span class="emphasis"><em>Forwarding</em></span> a message allows
you to add comments or modify the message you are forwarding. These
items are discussed in greater detail in the next section <span class="quote"><span class="quote"><a class="link" href="gettingstarted.html#forwarding-mail" title="7. Forwarding and Bouncing Mail">Forwarding and Bouncing Mail</a>.</span></span>
</p><p>
Mutt will then enter the <span class="emphasis"><em>compose</em></span> menu and prompt
you for the recipients to place on the <span class="quote"><span class="quote">To:</span></span> header field
when you hit <code class="literal">m</code> to start a new message. Next, it will
ask you for the <span class="quote"><span class="quote">Subject:</span></span> field for the message, providing
a default if you are replying to or forwarding a message. You again have
the chance to adjust recipients, subject, and security settings right
before actually sending the message. See also <a class="link" href="reference.html#askcc" title="3.12. askcc">$askcc</a>, <a class="link" href="reference.html#askbcc" title="3.11. askbcc">$askbcc</a>,
<a class="link" href="reference.html#autoedit" title="3.28. autoedit">$autoedit</a>, <a class="link" href="reference.html#bounce" title="3.34. bounce">$bounce</a>, <a class="link" href="reference.html#fast-reply" title="3.91. fast_reply">$fast_reply</a>, and <a class="link" href="reference.html#include" title="3.157. include">$include</a> for changing how and if Mutt asks
these questions.
</p><p>
When replying, Mutt fills these fields with proper values depending on
the reply type. The types of replying supported are:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Simple reply</span></dt><dd><p>
Reply to the author directly.
</p></dd><dt><span class="term">Group reply</span></dt><dd><p>
Reply to the author; cc all other recipients; consults
<a class="link" href="configuration.html#alternates" title="13. Alternative Addresses"><span class="command"><strong>alternates</strong></span></a>
and excludes you.
</p></dd><dt><span class="term">Group Chat reply</span></dt><dd><p>
Reply to the author and other recipients in the To list;
cc other recipients in the Cc list; consults
<a class="link" href="configuration.html#alternates" title="13. Alternative Addresses"><span class="command"><strong>alternates</strong></span></a>
and excludes you.
</p></dd><dt><span class="term">List reply</span></dt><dd><p>
Reply to all mailing list addresses found, either specified via
configuration or auto-detected. See <a class="xref" href="configuration.html#lists" title="14. Mailing Lists">Section 14, “Mailing Lists”</a> for
details.
</p></dd></dl></div><p>
After getting recipients for new messages, forwards or replies, Mutt
will then automatically start your <a class="link" href="reference.html#editor" title="3.85. editor">$editor</a>
on the message body. If the <a class="link" href="reference.html#edit-headers" title="3.84. edit_headers">$edit_headers</a> variable is set, the headers
will be at the top of the message in your editor; the message body
should start on a new line after the existing blank line at the end of
headers. Any messages you are replying to will be added in sort order
to the message, with appropriate
<a class="link" href="reference.html#attribution" title="3.20. attribution">$attribution</a>, <a class="link" href="reference.html#indent-string" title="3.160. indent_string">$indent_string</a> and <a class="link" href="reference.html#post-indent-string" title="3.259. post_indent_string">$post_indent_string</a>. When
forwarding a message, if the <a class="link" href="reference.html#mime-forward" title="3.193. mime_forward">$mime_forward</a> variable is unset, a copy of
the forwarded message will be included. If you have specified a <a class="link" href="reference.html#signature" title="3.323. signature">$signature</a>, it will be appended to the
message.
</p><p>
Once you have finished editing the body of your mail message, you are
returned to the <span class="emphasis"><em>compose</em></span> menu providing the
functions shown in <a class="xref" href="gettingstarted.html#tab-func-compose" title="Table 2.13. Most common compose menu keys">Table 2.13, “Most common compose menu keys”</a> to modify, send or
postpone the message.
</p><div class="table"><a id="tab-func-compose"></a><p class="title"><strong>Table 2.13. Most common compose menu keys</strong></p><div class="table-contents"><table class="table" summary="Most common compose menu keys" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key</th><th>Function</th><th>Description</th></tr></thead><tbody><tr><td>a</td><td><code class="literal">&lt;attach-file&gt;</code></td><td>attach a file</td></tr><tr><td>A</td><td><code class="literal">&lt;attach-message&gt;</code></td><td>attach message(s) to the message</td></tr><tr><td>Esc k</td><td><code class="literal">&lt;attach-key&gt;</code></td><td>attach a PGP public key</td></tr><tr><td>d</td><td><code class="literal">&lt;edit-description&gt;</code></td><td>edit description on attachment</td></tr><tr><td>D</td><td><code class="literal">&lt;detach-file&gt;</code></td><td>detach a file</td></tr><tr><td>t</td><td><code class="literal">&lt;edit-to&gt;</code></td><td>edit the To field</td></tr><tr><td>Esc f</td><td><code class="literal">&lt;edit-from&gt;</code></td><td>edit the From field</td></tr><tr><td>r</td><td><code class="literal">&lt;edit-reply-to&gt;</code></td><td>edit the Reply-To field</td></tr><tr><td>c</td><td><code class="literal">&lt;edit-cc&gt;</code></td><td>edit the Cc field</td></tr><tr><td>b</td><td><code class="literal">&lt;edit-bcc&gt;</code></td><td>edit the Bcc field</td></tr><tr><td>y</td><td><code class="literal">&lt;send-message&gt;</code></td><td>send the message</td></tr><tr><td>s</td><td><code class="literal">&lt;edit-subject&gt;</code></td><td>edit the Subject</td></tr><tr><td>S</td><td><code class="literal">&lt;smime-menu&gt;</code></td><td>select S/MIME options</td></tr><tr><td>f</td><td><code class="literal">&lt;edit-fcc&gt;</code></td><td>specify an <span class="quote"><span class="quote">Fcc</span></span> mailbox</td></tr><tr><td>p</td><td><code class="literal">&lt;pgp-menu&gt;</code></td><td>select PGP options</td></tr><tr><td>P</td><td><code class="literal">&lt;postpone-message&gt;</code></td><td>postpone this message until later</td></tr><tr><td>q</td><td><code class="literal">&lt;quit&gt;</code></td><td>quit (abort) sending the message</td></tr><tr><td>w</td><td><code class="literal">&lt;write-fcc&gt;</code></td><td>write the message to a folder</td></tr><tr><td>i</td><td><code class="literal">&lt;ispell&gt;</code></td><td>check spelling (if available on your system)</td></tr><tr><td>^F</td><td><code class="literal">&lt;forget-passphrase&gt;</code></td><td>wipe passphrase(s) from memory</td></tr></tbody></table></div></div><br class="table-break" /><p>
The compose menu is also used to edit the attachments for a message
which can be either files or other messages. The
<code class="literal">&lt;attach-message&gt;</code> function to will prompt you
for a folder to attach messages from. You can now tag messages in that
folder and they will be attached to the message you are sending.
</p><div class="note"><h3 class="title">Note</h3><p>
Note that certain operations like composing a new mail, replying,
forwarding, etc. are not permitted when you are in that folder. The %r
in <a class="link" href="reference.html#status-format" title="3.389. status_format">$status_format</a> will change to a
<span class="quote"><span class="quote">A</span></span> to indicate that you are in attach-message mode.
</p></div><p>
After exiting the compose menu via <code class="literal">&lt;send-message&gt;</code>,
the message will be sent. If configured and enabled, this can happen via
<a class="link" href="optionalfeatures.html#sending-mixmaster" title="10. Sending Anonymous Messages via Mixmaster">mixmaster</a> or
<a class="link" href="optionalfeatures.html#smtp" title="5. SMTP Support">$smtp_url</a>. Otherwise
<a class="link" href="reference.html#sendmail" title="3.305. sendmail">$sendmail</a> will be invoked. Prior to
version 1.13, Mutt enabled <a class="link" href="reference.html#write-bcc" title="3.422. write_bcc">$write_bcc</a> by
default, assuming the MTA would automatically remove a
<code class="literal">Bcc:</code> header as part of delivery. Starting with 1.13, the
option is unset by default, but no longer affects the fcc copy of the message.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="edit-header"></a>6.2. Editing the Message Header</h3></div></div></div><p>
When editing the header because of <a class="link" href="reference.html#edit-headers" title="3.84. edit_headers">$edit_headers</a> being set, there are a
several pseudo headers available which will not be included in sent
messages but trigger special Mutt behavior.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="fcc-header"></a>6.2.1. Fcc: Pseudo Header</h4></div></div></div><p>
If you specify
</p><p>
<code class="literal">Fcc:</code> <span class="emphasis"><em>filename</em></span>
</p><p>
as a header, Mutt will pick up <span class="emphasis"><em>filename</em></span> just as if
you had used the <code class="literal">&lt;edit-fcc&gt;</code> function in the
<span class="emphasis"><em>compose</em></span> menu. It can later be changed from the
compose menu.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="attach-header"></a>6.2.2. Attach: Pseudo Header</h4></div></div></div><p>
You can also attach files to your message by specifying
</p><p>
<code class="literal">Attach:</code> <span class="emphasis"><em>filename</em></span>
[ <span class="emphasis"><em>description</em></span> ]
</p><p>
where <span class="emphasis"><em>filename</em></span> is the file to attach and
<span class="emphasis"><em>description</em></span> is an optional string to use as the
description of the attached file. Spaces in filenames have to be escaped
using backslash (<span class="quote"><span class="quote">\</span></span>). The file can be removed as well as
more added from the compose menu.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="pgp-header"></a>6.2.3. Pgp: Pseudo Header</h4></div></div></div><p>
If you want to use PGP, you can specify
</p><p>
<code class="literal">Pgp:</code> [ <code class="literal">E</code> | <code class="literal">S</code> | <code class="literal">S</code><span class="emphasis"><em>&lt;id&gt;</em></span> ]
</p><p>
<span class="quote"><span class="quote">E</span></span> selects encryption, <span class="quote"><span class="quote">S</span></span> selects signing
and <span class="quote"><span class="quote">S&lt;id&gt;</span></span> selects signing with the given key,
setting <a class="link" href="reference.html#pgp-sign-as" title="3.237. pgp_sign_as">$pgp_sign_as</a> for the
duration of the message composition session. The selection can later
be changed in the compose menu.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="in-reply-to-header"></a>6.2.4. In-Reply-To: Header</h4></div></div></div><p>
When replying to messages, the <span class="emphasis"><em>In-Reply-To:</em></span> header
contains the Message-Id of the message(s) you reply to. If you remove or
modify its value, Mutt will not generate a
<span class="emphasis"><em>References:</em></span> field, which allows you to create a new
message thread, for example to create a new message to a mailing list
without having to enter the mailing list's address.
</p><p>
If you intend to start a new thread by replying, please make really sure
you remove the <span class="emphasis"><em>In-Reply-To:</em></span> header in your
editor. Otherwise, though you'll produce a technically valid reply, some
netiquette guardians will be annoyed by this so-called <span class="quote"><span class="quote">thread
hijacking</span></span>.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="sending-crypto"></a>6.3. Sending Cryptographically Signed/Encrypted Messages</h3></div></div></div><p>
If you have told Mutt to PGP or S/MIME encrypt a message, it will guide
you through a key selection process when you try to send the message.
Mutt will not ask you any questions about keys which have a certified
user ID matching one of the message recipients' mail addresses.
However, there may be situations in which there are several keys, weakly
certified user ID fields, or where no matching keys can be found.
</p><p>
In these cases, you are dropped into a menu with a list of keys from
which you can select one. When you quit this menu, or Mutt can't find
any matching keys, you are prompted for a user ID. You can, as usually,
abort this prompt using <code class="literal">^G</code>. When you do so, Mutt
will return to the compose screen.
</p><p>
Once you have successfully finished the key selection, the message will
be encrypted using the selected public keys when sent out.
</p><p>
To ensure you can view encrypted messages you have sent, you
may wish to set <a class="link" href="reference.html#pgp-self-encrypt" title="3.235. pgp_self_encrypt">$pgp_self_encrypt</a>
and <a class="link" href="reference.html#pgp-default-key" title="3.220. pgp_default_key">$pgp_default_key</a> for PGP, or
<a class="link" href="reference.html#smime-self-encrypt" title="3.348. smime_self_encrypt">$smime_self_encrypt</a>
and <a class="link" href="reference.html#smime-default-key" title="3.337. smime_default_key">$smime_default_key</a> for S/MIME.
</p><p>
Most fields of the entries in the key selection menu (see also <a class="link" href="reference.html#pgp-entry-format" title="3.223. pgp_entry_format">$pgp_entry_format</a>) have obvious
meanings. But some explanations on the capabilities, flags, and
validity fields are in order.
</p><p>
The flags sequence (<span class="quote"><span class="quote">%f</span></span>) will expand to one of the flags
in <a class="xref" href="gettingstarted.html#tab-pgp-menuflags" title="Table 2.14. PGP key menu flags">Table 2.14, “PGP key menu flags”</a>.
</p><div class="table"><a id="tab-pgp-menuflags"></a><p class="title"><strong>Table 2.14. PGP key menu flags</strong></p><div class="table-contents"><table class="table" summary="PGP key menu flags" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td>R</td><td>The key has been revoked and can't be used.</td></tr><tr><td>X</td><td>The key is expired and can't be used.</td></tr><tr><td>d</td><td>You have marked the key as disabled.</td></tr><tr><td>c</td><td>There are unknown critical self-signature packets.</td></tr></tbody></table></div></div><br class="table-break" /><p>
The capabilities field (<span class="quote"><span class="quote">%c</span></span>) expands to a two-character
sequence representing a key's capabilities. The first character gives
the key's encryption capabilities: A minus sign (<span class="quote"><span class="quote">-</span></span>) means
that the key cannot be used for encryption. A dot (<span class="quote"><span class="quote">.</span></span>)
means that it's marked as a signature key in one of the user IDs, but
may also be used for encryption. The letter <span class="quote"><span class="quote">e</span></span> indicates
that this key can be used for encryption.
</p><p>
The second character indicates the key's signing capabilities. Once
again, a <span class="quote"><span class="quote">-</span></span> implies <span class="quote"><span class="quote">not for signing</span></span>,
<span class="quote"><span class="quote">.</span></span> implies that the key is marked as an encryption key in
one of the user-ids, and <span class="quote"><span class="quote">s</span></span> denotes a key which can be
used for signing.
</p><p>
Finally, the validity field (<span class="quote"><span class="quote">%t</span></span>) indicates how
well-certified a user-id is. A question mark (<span class="quote"><span class="quote">?</span></span>)
indicates undefined validity, a minus character (<span class="quote"><span class="quote">-</span></span>) marks
an untrusted association, a space character means a partially trusted
association, and a plus character (<span class="quote"><span class="quote">+</span></span>) indicates complete
validity.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="ff"></a>6.4. Sending Format=Flowed Messages</h3></div></div></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="ff-concept"></a>6.4.1. Concept</h4></div></div></div><p>
<code class="literal">format=flowed</code>-style messages (or
<code class="literal">f=f</code> for short) are <code class="literal">text/plain</code>
messages that consist of paragraphs which a receiver's mail client may
reformat to its own needs which mostly means to customize line lengths
regardless of what the sender sent. Technically this is achieved by
letting lines of a <span class="quote"><span class="quote">flowable</span></span> paragraph end in spaces
except for the last line.
</p><p>
While for text-mode clients like Mutt it's the best way to assume only a
standard 80x25 character cell terminal, it may be desired to let the
receiver decide completely how to view a message.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="ff-support"></a>6.4.2. Mutt Support</h4></div></div></div><p>
Mutt only supports setting the required <code class="literal">format=flowed</code>
MIME parameter on outgoing messages if the <a class="link" href="reference.html#text-flowed" title="3.393. text_flowed">$text_flowed</a> variable is set, specifically
it does not add the trailing spaces.
</p><p>
After editing, Mutt properly space-stuffs the message.
<span class="emphasis"><em>Space-stuffing</em></span> is required by RfC3676 defining
<code class="literal">format=flowed</code> and means to prepend a space to:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>all lines starting with a space</p></li><li class="listitem"><p>lines starting with the word
<span class="quote"><span class="quote"><code class="literal">From</code></span></span> followed by
space</p></li><li class="listitem"><p>all lines starting with
<span class="quote"><span class="quote"><code class="literal">&gt;</code></span></span> which is not intended to be a
quote character</p></li></ul></div><div class="note"><h3 class="title">Note</h3><p>
Mutt only supports space-stuffing for the first two types of lines but
not for the third: It is impossible to safely detect whether a leading
<code class="literal">&gt;</code> character starts a quote or not.
</p></div><p>
All leading spaces are to be removed by receiving clients to restore the
original message prior to further processing.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="ff-editor"></a>6.4.3. Editor Considerations</h4></div></div></div><p>
As Mutt provides no additional features to compose
<code class="literal">f=f</code> messages, it's completely up to the user and his
editor to produce proper messages. Please consider your editor's
documentation if you intend to send <code class="literal">f=f</code> messages.
</p><p>
For example, <span class="emphasis"><em>vim</em></span> provides the <code class="literal">w</code>
flag for its <code class="literal">formatoptions</code> setting to assist in
creating <code class="literal">f=f</code> messages, see <code class="literal">:help
fo-table</code> for details.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="ff-pager"></a>6.4.4. Reformatting</h4></div></div></div><p>
Mutt has some support for reformatting when viewing and replying to
<code class="literal">format=flowed</code> messages. In order to take advantage of these,
<a class="link" href="reference.html#reflow-text" title="3.281. reflow_text">$reflow_text</a> must be set.
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Paragraphs are automatically reflowed and wrapped at a width specified
by <a class="link" href="reference.html#reflow-wrap" title="3.282. reflow_wrap">$reflow_wrap</a>.
</p></li><li class="listitem"><p>
In its original format, the quoting style of <code class="literal">format=flowed</code>
messages can be difficult to read, and doesn't intermix well with
non-flowed replies.
Setting <a class="link" href="reference.html#reflow-space-quotes" title="3.280. reflow_space_quotes">$reflow_space_quotes</a>
adds spaces after each level of quoting when in the pager and
replying in a non-flowed format
(i.e. with <a class="link" href="reference.html#text-flowed" title="3.393. text_flowed">$text_flowed</a> unset).
</p></li><li class="listitem"><p>
If <a class="link" href="reference.html#reflow-space-quotes" title="3.280. reflow_space_quotes">$reflow_space_quotes</a>
is unset, mutt will still add one trailing space after all the
quotes in the pager (but not when replying).
</p></li></ul></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="bgedit"></a>6.5. Background Editing</h3></div></div></div><p>
If <a class="link" href="reference.html#editor" title="3.85. editor">$editor</a> is set to a graphical
editor, or a script such as <a class="ulink" href="https://gitlab.com/muttmua/mutt/tree/master/contrib/bgedit-screen-tmux.sh" target="_top">contrib/bgedit-screen-tmux.sh</a> if running inside GNU Screen or
tmux, you can run the editor in the background by setting <a class="link" href="reference.html#background-edit" title="3.29. background_edit">$background_edit</a>.
</p><p>
If set, Mutt will display a landing page while the editor runs.
When the editor exits, message composition will resume
automatically. Alternatively, you can
<code class="literal">&lt;exit&gt;</code> from the landing page, which will
return you to the message index. This allows viewing other
messages, changing mailboxes, even starting a new message
composition session - all while the first editor session is still
running.
</p><p>
Backgrounded message composition sessions can be viewed via
<code class="literal">&lt;background-compose-menu&gt;</code> in the index and
pager, by default bound to <span class="quote"><span class="quote"><code class="literal">B</code></span></span>. If
there is only a single backgrounded session, which has already
exited, that session will automatically resume. Otherwise the list
will be displayed, and a particular session can be selected. <a class="link" href="reference.html#background-format" title="3.31. background_format">$background_format</a> controls the
format string used for the menu.
</p><p>
In case the open mailbox is changed while a reply is backgrounded,
Mutt keeps track of the original mailbox. After sending, Mutt will
attempt to reopen the original mailbox, if needed, and set reply
flags appropriately. This won't affect your currently open mailbox,
but may make setting flags a bit slower due to the need to reopen
the original mailbox behind the scenes.
</p><p>
One complication with backgrounded compose sessions is the config
changes caused by <a class="link" href="advancedusage.html#hooks" title="6. Using Hooks">send, reply, and folder
hooks</a>. These can get triggered by a new message composition
session, or by changing folders during a backgrounded session. To
help lessen these problems, Mutt takes a snapshot of certain
configuration variables and stores them with each editing session
when it is backgrounded. When the session is resumed, those stored
settings will temporarily be restored, and removed again when the
session finishes (or is backgrounded again).
</p><p>
Mutt will save all <code class="literal">boolean</code> and
<code class="literal">quadoption</code> configuration variables,
the current folder (which will be used for <code class="literal">^</code>
mailbox shortcut expansion), along with:
<a class="link" href="reference.html#folder" title="3.97. folder">$folder</a>,
<a class="link" href="reference.html#record" title="3.279. record">$record</a>,
<a class="link" href="reference.html#postponed" title="3.261. postponed">$postponed</a>,
<a class="link" href="reference.html#envelope-from-address" title="3.88. envelope_from_address">$envelope_from_address</a>,
<a class="link" href="reference.html#from" title="3.109. from">$from</a>,
<a class="link" href="reference.html#sendmail" title="3.305. sendmail">$sendmail</a>,
<a class="link" href="reference.html#smtp-url" title="3.359. smtp_url">$smtp_url</a>,
<a class="link" href="reference.html#pgp-sign-as" title="3.237. pgp_sign_as">$pgp_sign_as</a>,
<a class="link" href="reference.html#smime-sign-as" title="3.349. smime_sign_as">$smime_sign_as</a>, and
<a class="link" href="reference.html#smime-encrypt-with" title="3.339. smime_encrypt_with">$smime_encrypt_with</a>.
It's not feasible to backup all variables, but if you believe
we've missed an important setting, please let the developers know.
</p><p>
To help prevent forgetting about backgrounded sessions, <a class="link" href="reference.html#background-confirm-quit" title="3.30. background_confirm_quit">$background_confirm_quit</a>
will prompt before exiting, in addition to <a class="link" href="reference.html#quit" title="3.273. quit">$quit</a>. Additionally, the <code class="literal">%B</code>
expando in <a class="link" href="reference.html#status-format" title="3.389. status_format">$status_format</a>
displays the number of backgrounded compose sessions.
</p><p>
Background editing is available for most, but not all, message
composition in Mutt. Sending from the command line disables
background editing, because there is no index to return to.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="forwarding-mail"></a>7. Forwarding and Bouncing Mail</h2></div></div></div><p>
Bouncing and forwarding let you send an existing message to recipients
that you specify. Bouncing a message sends a verbatim copy of a message
to alternative addresses as if they were the message's original
recipients specified in the Bcc header. Forwarding a message, on the
other hand, allows you to modify the message before it is resent (for
example, by adding your own comments). Bouncing is done using the
<code class="literal">&lt;bounce&gt;</code> function and forwarding using the
<code class="literal">&lt;forward&gt;</code> function bound to <span class="quote"><span class="quote">b</span></span>
and <span class="quote"><span class="quote">f</span></span> respectively.
</p><p>
Forwarding can be done by including the original message in the new
message's body (surrounded by indicating lines: see <a class="link" href="reference.html#forward-attribution-intro" title="3.102. forward_attribution_intro">$forward_attribution_intro</a>
and <a class="link" href="reference.html#forward-attribution-trailer" title="3.103. forward_attribution_trailer">$forward_attribution_trailer</a>)
or including it as a MIME attachment, depending on the value of the
<a class="link" href="reference.html#mime-forward" title="3.193. mime_forward">$mime_forward</a> variable. Decoding
of attachments, like in the pager, can be controlled by the <a class="link" href="reference.html#forward-decode" title="3.104. forward_decode">$forward_decode</a> and <a class="link" href="reference.html#mime-forward-decode" title="3.194. mime_forward_decode">$mime_forward_decode</a> variables,
respectively. The desired forwarding format may depend on the content,
therefore <a class="link" href="reference.html#mime-forward" title="3.193. mime_forward">$mime_forward</a> is a
quadoption which, for example, can be set to <span class="quote"><span class="quote">ask-no</span></span>.
</p><p>
Mutt's default (<a class="link" href="reference.html#mime-forward" title="3.193. mime_forward">$mime_forward</a>=<span class="quote"><span class="quote">no</span></span> and
<a class="link" href="reference.html#forward-decode" title="3.104. forward_decode">$forward_decode</a>=<span class="quote"><span class="quote">yes</span></span>) is
to use standard inline forwarding. In that mode all text-decodable
parts are included in the new message body. Other attachments from
the original email can also be attached to the new message, based on the
quadoption <a class="link" href="reference.html#forward-attachments" title="3.101. forward_attachments">$forward_attachments</a>.
</p><p>
The inclusion of headers is controlled by the current setting of the
<a class="link" href="reference.html#weed" title="3.417. weed">$weed</a> variable, unless <a class="link" href="reference.html#mime-forward" title="3.193. mime_forward">$mime_forward</a> is set. The subject of
the email is controlled by <a class="link" href="reference.html#forward-format" title="3.107. forward_format">$forward_format</a>.
</p><p>
Editing the message to forward follows the same procedure as sending or
replying to a message does, but can be disabled via the quadoption
<a class="link" href="reference.html#forward-edit" title="3.106. forward_edit">$forward_edit</a>.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="postponing-mail"></a>8. Postponing Mail</h2></div></div></div><p>
At times it is desirable to delay sending a message that you have
already begun to compose. When the
<code class="literal">&lt;postpone-message&gt;</code> function is used in the
<span class="emphasis"><em>compose</em></span> menu, the body of your message and
attachments are stored in the mailbox specified by the <a class="link" href="reference.html#postponed" title="3.261. postponed">$postponed</a> variable. This means that you can
recall the message even if you exit Mutt and then restart it at a later
time.
</p><p>
Once a message is postponed, there are several ways to resume it. From
the command line you can use the <span class="quote"><span class="quote">-p</span></span> option, or if you
compose a new message from the <span class="emphasis"><em>index</em></span> or
<span class="emphasis"><em>pager</em></span> you will be prompted if postponed messages
exist. If multiple messages are currently postponed, the
<span class="emphasis"><em>postponed</em></span> menu will pop up and you can select which
message you would like to resume.
</p><div class="note"><h3 class="title">Note</h3><p>
If you postpone a reply to a message, the reply setting of the message
is only updated when you actually finish the message and send it. Also,
you must be in the same folder with the message you replied to for the
status of the message to be updated.
</p></div><p>
See also the <a class="link" href="reference.html#postpone" title="3.260. postpone">$postpone</a> quad-option.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="encryption"></a>9. Encryption and Signing</h2></div></div></div><p>
Mutt supports encrypting and signing emails when used interactively.
In batch mode, cryptographic operations are disabled, so these options
can't be used to sign an email sent via a cron job, for instance.
</p><p>
OpenPGP and S/MIME are enabled in one of two ways: <span class="quote"><span class="quote">classic
mode</span></span> or GPGME. The former invokes external programs to
perform the various operations; it is better tested and more
flexible, but requires some configuration. The latter uses the
GnuPG project's GPGME library.
</p><p>
To enable <span class="quote"><span class="quote">classic mode</span></span>, ensure GPGME is disabled and
use the <code class="literal">gpg.rc</code> or <code class="literal">smime.rc</code> files
that come with mutt. These are typically installed under
<code class="literal">/usr/local/share/doc/mutt/samples/</code>. Source them, either
directly or by copying them to your .mutt directory and sourcing them.
Sourcing them directly from
<code class="literal">/usr/local/share/doc/mutt/samples/</code> has the benefit of
automatically using fixes and security improvements to the command
invocations, and is recommended.
</p><pre class="screen">
unset crypt_use_gpgme
source /usr/local/share/doc/mutt/samples/gpg.rc
source /usr/local/share/doc/mutt/samples/smime.rc
</pre><p>
To use GPGME instead, simply ensure the option is enabled in your .muttrc:
</p><pre class="screen">
set crypt_use_gpgme
</pre><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="enc-pgp"></a>9.1. OpenPGP Configuration</h3></div></div></div><p>
The two most important settings are <a class="link" href="reference.html#pgp-default-key" title="3.220. pgp_default_key">$pgp_default_key</a> and <a class="link" href="reference.html#pgp-sign-as" title="3.237. pgp_sign_as">$pgp_sign_as</a>. To perform encryption, you
must set the first variable. If you have a separate signing key, or
only have a signing key, then set the second. Most people will only
need to set <a class="link" href="reference.html#pgp-default-key" title="3.220. pgp_default_key">$pgp_default_key</a>.
</p><p>
Starting with version 2.1.0, GnuPG automatically uses an
<code class="literal">agent</code> to prompt for your passphrase. If you are
using a version older than that, you'll need to ensure an agent is
running (alternatively, you can unset <a class="link" href="reference.html#pgp-use-gpg-agent" title="3.242. pgp_use_gpg_agent">$pgp_use_gpg_agent</a> and Mutt will
prompt you for your passphrase). The agent in turn uses a
<code class="literal">pinentry</code> program to display the prompt. There are
many different kinds of pinentry programs that can be used: qt, gtk2,
gnome3, fltk, and curses. However, Mutt does <span class="emphasis"><em>not</em></span>
work properly with the tty pinentry program. Please ensure you have
one of the GUI or curses pinentry programs installed and configured to
be the default for your system.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="enc-smime"></a>9.2. S/MIME Configuration</h3></div></div></div><p>
As with OpenPGP, the two most important settings are <a class="link" href="reference.html#smime-default-key" title="3.337. smime_default_key">$smime_default_key</a> and <a class="link" href="reference.html#smime-sign-as" title="3.349. smime_sign_as">$smime_sign_as</a>. To perform encryption
and decryption, you must set the first variable. If you have a
separate signing key, or only have a signing key, then set the second.
Most people will only need to set <a class="link" href="reference.html#smime-default-key" title="3.337. smime_default_key">$smime_default_key</a>.
</p><p>
In <span class="quote"><span class="quote">classic mode</span></span>, keys and certificates are managed by
the <code class="literal">smime_keys</code> program that comes with Mutt. By
default they are stored under <code class="literal">~/.smime/</code>. (This is
set by the <code class="literal">smime.rc</code> file with <a class="link" href="reference.html#smime-certificates" title="3.334. smime_certificates">$smime_certificates</a> and <a class="link" href="reference.html#smime-keys" title="3.345. smime_keys">$smime_keys</a>.) To initialize this
directory, use the command <span class="quote"><span class="quote"><code class="literal">smime_keys
init</code></span></span> from a shell prompt. The program can be then
be used to import and list certificates. You may also want to
periodically run <span class="quote"><span class="quote"><code class="literal">smime_keys refresh</code></span></span>
to update status flags for your certificates.
</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="configuration.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Configuration</td></tr></table></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 1. Introduction</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="index.html" title="The Mutt E-Mail Client" /><link rel="next" href="gettingstarted.html" title="Chapter 2. Getting Started" /><style xmlns="" type="text/css">
body { margin-left:2%; margin-right:2%; font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
p { text-align:justify; }
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
.email, .email a { font-family:monospace; }
div.table-contents table, div.informaltable table { border-collapse:collapse; border:1px solid #c0c0c0; }
div.table-contents table td, div.informaltable td, div.table-contents table th, div.informaltable table th { padding:5px; text-align:left; }
div.table-contents table th, div.informaltable table th {
font-family:sans-serif;
background:#d0d0d0;
font-weight:normal;
vertical-align:top;
}
div.cmdsynopsis { border-left:1px solid #707070; padding-left:5px; }
li div.cmdsynopsis { border-left:none; padding-left:0px; }
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; margin-left:2%; margin-right:2%; }
div.example p.title { margin-left:2%; }
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
div.note h3:after { content: ":" }
div.note { margin-bottom: 5px; }
.command { font-family: monospace; font-weight: normal; }
.command strong { font-weight: normal; }
tr { vertical-align: top; }
.comment { color:#707070; }
</style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="gettingstarted.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="intro"></a>Chapter 1. Introduction</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="intro.html#homepage">1. Mutt Home Page</a></span></dt><dt><span class="sect1"><a href="intro.html#muttlists">2. Mailing Lists</a></span></dt><dt><span class="sect1"><a href="intro.html#distribution">3. Getting Mutt</a></span></dt><dt><span class="sect1"><a href="intro.html#irc">4. Mutt Online Resources</a></span></dt><dt><span class="sect1"><a href="intro.html#contrib">5. Contributing to Mutt</a></span></dt><dt><span class="sect1"><a href="intro.html#typo">6. Typographical Conventions</a></span></dt><dt><span class="sect1"><a href="intro.html#copyright">7. Copyright</a></span></dt></dl></div><p>
<span class="bold"><strong>Mutt</strong></span> is a small but very powerful
text-based MIME mail client. Mutt is highly configurable, and is well
suited to the mail power user with advanced features like key bindings,
keyboard macros, mail threading, regular expression searches and a
powerful pattern matching language for selecting groups of messages.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="homepage"></a>1. Mutt Home Page</h2></div></div></div><p>
The official homepage can be found at
<a class="ulink" href="http://www.mutt.org/" target="_top">http://www.mutt.org/</a>.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="muttlists"></a>2. Mailing Lists</h2></div></div></div><p>
To subscribe to one of the following mailing lists, send a message with
the word <span class="emphasis"><em>subscribe</em></span> in the body to
<span class="emphasis"><em>list-name</em></span><code class="literal">-request@mutt.org</code>.
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
<code class="email">&lt;<a class="email" href="mailto:mutt-announce-request@mutt.org">mutt-announce-request@mutt.org</a>&gt;</code> — low traffic list for
announcements
</p></li><li class="listitem"><p>
<code class="email">&lt;<a class="email" href="mailto:mutt-users-request@mutt.org">mutt-users-request@mutt.org</a>&gt;</code> — users help users
</p></li><li class="listitem"><p>
<code class="email">&lt;<a class="email" href="mailto:mutt-dev-request@mutt.org">mutt-dev-request@mutt.org</a>&gt;</code> — patches, bug reports, feature requests
</p></li></ul></div><p>
All messages posted to <span class="emphasis"><em>mutt-announce</em></span> are
automatically forwarded to <span class="emphasis"><em>mutt-users</em></span>, so you do
not need to be subscribed to both lists.
</p><p>
NOTE: You MUST be subscribed to a list in order to post to it.
This is not to make your life harder,
but to reduce SPAM and/or UCE.
The mailing list software being used is GNU Mailman,
with its implied deficiencies.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="distribution"></a>3. Getting Mutt</h2></div></div></div><p>
Mutt releases can be downloaded from <a class="ulink" href="ftp://ftp.mutt.org/pub/mutt/" target="_top">ftp://ftp.mutt.org/pub/mutt/</a>. For a
list of mirror sites, please refer to <a class="ulink" href="http://www.mutt.org/download.html" target="_top">http://www.mutt.org/download.html</a>.
</p><p>
For version control access, please refer to the
<a class="ulink" href="https://gitlab.com/muttmua/mutt" target="_top">Mutt development site</a>.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="irc"></a>4. Mutt Online Resources</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">Bug Tracking System</span></dt><dd><p>
The official Mutt bug tracking system (not for feature requests) can be found at
<a class="ulink" href="https://gitlab.com/muttmua/mutt/issues" target="_top">https://gitlab.com/muttmua/mutt/issues</a>
</p></dd><dt><span class="term">Wiki</span></dt><dd><p>
An (unofficial) wiki can be found
at <a class="ulink" href="https://gitlab.com/muttmua/mutt/wikis/home" target="_top">https://gitlab.com/muttmua/mutt/wikis/home</a>.
</p></dd><dt><span class="term">IRC</span></dt><dd><p>
For the IRC user community, visit channel <span class="emphasis"><em>#mutt</em></span> on
<a class="ulink" href="https://libera.chat/" target="_top">irc.libera.chat</a>.
</p></dd><dt><span class="term">USENET</span></dt><dd><p>
For USENET, see the newsgroup <a class="ulink" href="news:comp.mail.mutt" target="_top">comp.mail.mutt</a>.
</p></dd></dl></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib"></a>5. Contributing to Mutt</h2></div></div></div><p>
There are various ways to contribute to the Mutt project.
</p><p>
Especially for new users it may be helpful to meet other new and
experienced users to chat about Mutt, talk about problems and share
tricks.
</p><p>
Since translations of Mutt into other languages are highly appreciated,
the Mutt developers always look for skilled translators that help
improve and continue to maintain stale translations.
</p><p>
For contributing code patches for new features and bug fixes, please
refer to the developer pages at
<a class="ulink" href="https://gitlab.com/muttmua/mutt" target="_top">https://gitlab.com/muttmua/mutt</a> for more details.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="typo"></a>6. Typographical Conventions</h2></div></div></div><p>
This section lists typographical conventions followed throughout this
manual. See table <a class="xref" href="intro.html#tab-typo" title="Table 1.1. Typographical conventions for special terms">Table 1.1, “Typographical conventions for special terms”</a> for typographical
conventions for special terms.
</p><div class="table"><a id="tab-typo"></a><p class="title"><strong>Table 1.1. Typographical conventions for special terms</strong></p><div class="table-contents"><table class="table" summary="Typographical conventions for special terms" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Item</th><th>Refers to...</th></tr></thead><tbody><tr><td><code class="literal">printf(3)</code></td><td>UNIX manual pages, execute <code class="literal">man 3 printf</code></td></tr><tr><td><code class="literal">&lt;PageUp&gt;</code></td><td>named keys</td></tr><tr><td><code class="literal">&lt;create-alias&gt;</code></td><td>named Mutt function</td></tr><tr><td><code class="literal">^G</code></td><td>Control+G key combination</td></tr><tr><td>$mail_check</td><td>Mutt configuration option</td></tr><tr><td><code class="literal">$HOME</code></td><td>environment variable</td></tr></tbody></table></div></div><br class="table-break" /><p>
Examples are presented as:
</p><pre class="screen">
mutt -v
</pre><p>
Within command synopsis, curly brackets (<span class="quote"><span class="quote">{}</span></span>) denote a set
of options of which one is mandatory, square brackets
(<span class="quote"><span class="quote">[]</span></span>) denote optional arguments, three dots
denote that the argument may be repeated arbitrary times.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="copyright"></a>7. Copyright</h2></div></div></div><p>
Mutt is Copyright © 1996-2026 Michael R. Elkins
<code class="email">&lt;<a class="email" href="mailto:me@mutt.org">me@mutt.org</a>&gt;</code> and others.
</p><p>
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.
</p><p>
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.
</p><p>
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.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="gettingstarted.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The Mutt E-Mail Client </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Getting Started</td></tr></table></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,821 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 5. Mutt's MIME Support</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="advancedusage.html" title="Chapter 4. Advanced Usage" /><link rel="next" href="optionalfeatures.html" title="Chapter 6. Optional Features" /><style xmlns="" type="text/css">
body { margin-left:2%; margin-right:2%; font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
p { text-align:justify; }
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
.email, .email a { font-family:monospace; }
div.table-contents table, div.informaltable table { border-collapse:collapse; border:1px solid #c0c0c0; }
div.table-contents table td, div.informaltable td, div.table-contents table th, div.informaltable table th { padding:5px; text-align:left; }
div.table-contents table th, div.informaltable table th {
font-family:sans-serif;
background:#d0d0d0;
font-weight:normal;
vertical-align:top;
}
div.cmdsynopsis { border-left:1px solid #707070; padding-left:5px; }
li div.cmdsynopsis { border-left:none; padding-left:0px; }
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; margin-left:2%; margin-right:2%; }
div.example p.title { margin-left:2%; }
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
div.note h3:after { content: ":" }
div.note { margin-bottom: 5px; }
.command { font-family: monospace; font-weight: normal; }
.command strong { font-weight: normal; }
tr { vertical-align: top; }
.comment { color:#707070; }
</style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Mutt's MIME Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="advancedusage.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="optionalfeatures.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="mimesupport"></a>Chapter 5. Mutt's MIME Support</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="mimesupport.html#using-mime">1. Using MIME in Mutt</a></span></dt><dd><dl><dt><span class="sect2"><a href="mimesupport.html#mime-overview">1.1. MIME Overview</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#mime-pager">1.2. Viewing MIME Messages in the Pager</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#attach-menu">1.3. The Attachment Menu</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#compose-menu">1.4. The Compose Menu</a></span></dt></dl></dd><dt><span class="sect1"><a href="mimesupport.html#mime-types">2. MIME Type Configuration with <code class="literal">mime.types</code></a></span></dt><dt><span class="sect1"><a href="mimesupport.html#mailcap">3. MIME Viewer Configuration with Mailcap</a></span></dt><dd><dl><dt><span class="sect2"><a href="mimesupport.html#mailcap-basics">3.1. The Basics of the Mailcap File</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#secure-mailcap">3.2. Secure Use of Mailcap</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#advanced-mailcap">3.3. Advanced Mailcap Usage</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#mailcap-example">3.4. Example Mailcap Files</a></span></dt></dl></dd><dt><span class="sect1"><a href="mimesupport.html#auto-view">4. MIME Autoview</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#alternative-order">5. MIME Multipart/Alternative</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#attachments">6. Attachment Searching and Counting</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#mime-lookup">7. MIME Lookup</a></span></dt></dl></div><p>
Quite a bit of effort has been made to make Mutt the premier text-mode
MIME MUA. Every effort has been made to provide the functionality that
the discerning MIME user requires, and the conformance to the standards
wherever possible. When configuring Mutt for MIME, there are two extra
types of configuration files which Mutt uses. One is the
<code class="literal">mime.types</code> file, which contains the mapping of file
extensions to IANA MIME types. The other is the
<code class="literal">mailcap</code> file, which specifies the external commands
to use for handling specific MIME types.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="using-mime"></a>1. Using MIME in Mutt</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="mime-overview"></a>1.1. MIME Overview</h3></div></div></div><p>
MIME is short for <span class="quote"><span class="quote">Multipurpose Internet Mail Extension</span></span>
and describes mechanisms to internationalize and structure mail
messages. Before the introduction of MIME, messages had a single text
part and were limited to us-ascii header and content. With MIME,
messages can have attachments (and even attachments which itself have
attachments and thus form a tree structure), nearly arbitrary characters
can be used for sender names, recipients and subjects.
</p><p>
Besides the handling of non-ascii characters in message headers, to Mutt
the most important aspect of MIME are so-called MIME types. These are
constructed using a <span class="emphasis"><em>major</em></span> and
<span class="emphasis"><em>minor</em></span> type separated by a forward slash. These
specify details about the content that follows. Based upon these, Mutt
decides how to handle this part. The most popular major type is
<span class="quote"><span class="quote"><code class="literal">text</code></span></span> with minor types for plain text,
HTML and various other formats. Major types also exist for images,
audio, video and of course general application data (e.g. to separate
cryptographically signed data with a signature, send office documents,
and in general arbitrary binary data). There's also the
<code class="literal">multipart</code> major type which represents the root of a
subtree of MIME parts. A list of supported MIME types can be found in
<a class="xref" href="mimesupport.html#supported-mime-types" title="Table 5.1. Supported MIME types">Table 5.1, “Supported MIME types”</a>.
</p><p>
MIME also defines a set of encoding schemes for transporting MIME
content over the network: <code class="literal">7bit</code>,
<code class="literal">8bit</code>, <code class="literal">quoted-printable</code>,
<code class="literal">base64</code> and <code class="literal">binary</code>. There're some
rules when to choose what for encoding headers and/or body (if needed),
and Mutt will in general make a good choice.
</p><p>
Mutt does most of MIME encoding/decoding behind the scenes to form
messages conforming to MIME on the sending side. On reception, it can be
flexibly configured as to how what MIME structure is displayed (and if
it's displayed): these decisions are based on the content's MIME type.
There are three areas/menus in dealing with MIME: the pager (while
viewing a message), the attachment menu and the compose menu.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="mime-pager"></a>1.2. Viewing MIME Messages in the Pager</h3></div></div></div><p>
When you select a message from the index and view it in the pager, Mutt
decodes as much of a message as possible to a text representation. Mutt
internally supports a number of MIME types, including the
<code class="literal">text</code> major type (with all minor types), the
<code class="literal">message/rfc822</code> (mail messages) type and some
<code class="literal">multipart</code> types. In addition, it recognizes a variety
of PGP MIME types, including PGP/MIME and
<code class="literal">application/pgp</code>.
</p><p>
Mutt will denote attachments with a couple lines describing them.
These lines are of the form:
</p><pre class="screen">
[-- Attachment #1: Description --]
[-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
</pre><p>
Where the <span class="emphasis"><em>Description</em></span> is the description or
filename given for the attachment, and the <span class="emphasis"><em>Encoding</em></span>
is one of the already mentioned content encodings.
</p><p>
If Mutt cannot deal with a MIME type, it will display a message like:
</p><pre class="screen">
[-- image/gif is unsupported (use 'v' to view this part) --]
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="attach-menu"></a>1.3. The Attachment Menu</h3></div></div></div><p>
The default binding for <code class="literal">&lt;view-attachments&gt;</code> is
<span class="quote"><span class="quote">v</span></span>, which displays the attachment menu for a message. The
attachment menu displays a list of the attachments in a message. From
the attachment menu, you can save, print, pipe, delete, and view
attachments. You can apply these operations to a group of attachments
at once, by tagging the attachments and by using the
<code class="literal">&lt;tag-prefix&gt;</code> operator. You can also reply to
the current message from this menu, and only the current attachment (or
the attachments tagged) will be quoted in your reply. You can view
attachments as text, or view them using the mailcap viewer definition
(the mailcap mechanism is explained later in detail).
</p><p>
Finally, you can apply the usual message-related functions (like <a class="link" href="gettingstarted.html#resend-message"><code class="literal">&lt;resend-message&gt;</code></a>,
and the <code class="literal">&lt;reply&gt;</code> and
<code class="literal">&lt;forward&gt;</code> functions) to attachments of type
<code class="literal">message/rfc822</code>.
</p><p>
See table <a class="xref" href="reference.html#tab-attachment-bindings" title="Table 9.7. Default Attachment Menu Bindings">Table 9.7, “Default Attachment Menu Bindings”</a> for all available
functions.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="attach-viewers"></a>1.3.1. Viewing Attachments</h4></div></div></div><p>
There are four(!) ways of viewing attachments, so the functions
deserve some extra explanation.
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<code class="literal">&lt;view-mailcap&gt;</code>
(default keybinding: m)
</span></dt><dd><p>
This will use the first matching mailcap entry.
</p><p>
If no matching mailcap entries are found, it will abort with an
error message.
</p></dd><dt><span class="term">
<code class="literal">&lt;view-attach&gt;</code>
(default keybinding: &lt;Enter&gt;)
</span></dt><dd><p>
Mutt will display internally supported MIME types (see <a class="xref" href="mimesupport.html#mime-pager" title="1.2. Viewing MIME Messages in the Pager">Section 1.2, “Viewing MIME Messages in the Pager”</a>) in the pager. This will respect
<a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a> settings, to determine
whether to use a <code class="literal">copiousoutput</code> mailcap entry or
just directly display the attachment.
</p><p>
Other MIME types will use the first matching mailcap entry.
</p><p>
If no matching mailcap entries are found, the attachment will
be displayed in the pager as raw text.
</p></dd><dt><span class="term">
<code class="literal">&lt;view-pager&gt;</code>
</span></dt><dd><p>
Mutt will use the first matching
<code class="literal">copiousoutput</code> mailcap entry to display the
attachment in the pager (regardless of <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a> settings).
</p><p>
If no matching mailcap entries are found, the attachment will
be displayed in the pager as raw text.
</p></dd><dt><span class="term">
<code class="literal">&lt;view-text&gt;</code>
(default keybinding: T)
</span></dt><dd><p>
The attachment will always be displayed in the pager as raw
text.
</p></dd></dl></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="compose-menu"></a>1.4. The Compose Menu</h3></div></div></div><p>
The compose menu is the menu you see before you send a message. It
allows you to edit the recipient list, the subject, and other aspects of
your message. It also contains a list of the attachments of your
message, including the main body. From this menu, you can print, copy,
filter, pipe, edit, compose, review, and rename an attachment or a list
of tagged attachments. You can also modifying the attachment
information, notably the type, encoding and description.
</p><p>
Attachments appear as follows by default:
</p><pre class="screen">
- 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0 &lt;no description&gt;
2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz &lt;no description&gt;
</pre><p>
The <span class="quote"><span class="quote">-</span></span> denotes that Mutt will delete the file after
sending (or postponing, or canceling) the message. It can be toggled
with the <code class="literal">&lt;toggle-unlink&gt;</code> command (default: u).
The next field is the MIME content-type, and can be changed with the
<code class="literal">&lt;edit-type&gt;</code> command (default: ^T). The next
field is the encoding for the attachment, which allows a binary message
to be encoded for transmission on 7bit links. It can be changed with
the <code class="literal">&lt;edit-encoding&gt;</code> command (default: ^E). The
next field is the size of the attachment, rounded to kilobytes or
megabytes. The next field is the filename, which can be changed with
the <code class="literal">&lt;rename-file&gt;</code> command (default: R). The
final field is the description of the attachment, and can be changed
with the <code class="literal">&lt;edit-description&gt;</code> command (default:
d). See <a class="link" href="reference.html#attach-format" title="3.15. attach_format">$attach_format</a> for a full
list of available expandos to format this display to your needs.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mime-types"></a>2. MIME Type Configuration with <code class="literal">mime.types</code></h2></div></div></div><p>
To get most out of MIME, it's important that a MIME part's content type
matches the content as closely as possible so that the recipient's
client can automatically select the right viewer for the
content. However, there's no reliable way for Mutt to know how to detect
every possible file type. Instead, it uses a simple plain text mapping
file that specifies what file extension corresponds to what MIME
type. This file is called <code class="literal">mime.types</code>.
</p><p>
When you add an attachment to your mail message, Mutt searches your
personal <code class="literal">mime.types</code> file at
<code class="literal">$HOME/.mime.types</code>, and then the system
<code class="literal">mime.types</code> file at
<code class="literal">/usr/local/share/mutt/mime.types</code> or
<code class="literal">/etc/mime.types</code>
</p><p>
Each line starts with the full MIME type, followed by a space and
space-separated list of file extensions. For example you could use:
</p><div class="example"><a id="ex-mime-types"></a><p class="title"><strong>Example 5.1. <code class="literal">mime.types</code></strong></p><div class="example-contents"><pre class="screen">
application/postscript ps eps
application/pgp pgp
audio/x-aiff aif aifc aiff
</pre></div></div><br class="example-break" /><p>
A sample <code class="literal">mime.types</code> file comes with the Mutt
distribution, and should contain most of the MIME types you are likely
to use.
</p><p>
If Mutt can not determine the MIME type by the extension of the file you
attach, it will run the command specified in
<a class="link" href="reference.html#mime-type-query-command" title="3.196. mime_type_query_command">$mime_type_query_command</a>.
If that command is not specified, Mutt will look at the file. If the file
is free of binary information, Mutt will assume that the file is plain text,
and mark it as <code class="literal">text/plain</code>. If the file contains binary
information, then Mutt will mark it as
<code class="literal">application/octet-stream</code>. You can change the MIME
type that Mutt assigns to an attachment by using the
<code class="literal">&lt;edit-type&gt;</code> command from the compose menu
(default: ^T), see <a class="xref" href="mimesupport.html#supported-mime-types" title="Table 5.1. Supported MIME types">Table 5.1, “Supported MIME types”</a> for supported
major types. Mutt recognizes all of these if the appropriate entry is
found in the <code class="literal">mime.types</code> file. Non-recognized mime
types should only be used if the recipient of the message is likely to
be expecting such attachments.
</p><div class="table"><a id="supported-mime-types"></a><p class="title"><strong>Table 5.1. Supported MIME types</strong></p><div class="table-contents"><table class="table" summary="Supported MIME types" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>MIME major type</th><th>Standard</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">application</code></td><td>yes</td><td>General application data</td></tr><tr><td><code class="literal">audio</code></td><td>yes</td><td>Audio data</td></tr><tr><td><code class="literal">image</code></td><td>yes</td><td>Image data</td></tr><tr><td><code class="literal">message</code></td><td>yes</td><td>Mail messages, message status information</td></tr><tr><td><code class="literal">model</code></td><td>yes</td><td>VRML and other modeling data</td></tr><tr><td><code class="literal">multipart</code></td><td>yes</td><td>Container for other MIME parts</td></tr><tr><td><code class="literal">text</code></td><td>yes</td><td>Text data</td></tr><tr><td><code class="literal">video</code></td><td>yes</td><td>Video data</td></tr><tr><td><code class="literal">chemical</code></td><td>no</td><td>Mostly molecular data</td></tr></tbody></table></div></div><br class="table-break" /><p>
MIME types are not arbitrary, they need to be assigned by <a class="ulink" href="http://www.iana.org/assignments/media-types/" target="_top">IANA</a>.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mailcap"></a>3. MIME Viewer Configuration with Mailcap</h2></div></div></div><p>
Mutt supports RFC 1524 MIME Configuration, in particular the Unix
specific format specified in Appendix A of RFC 1524. This file format
is commonly referred to as the <span class="quote"><span class="quote">mailcap</span></span> format. Many MIME
compliant programs utilize the mailcap format, allowing you to specify
handling for all MIME types in one place for all programs. Programs
known to use this format include Firefox, lynx and metamail.
</p><p>
In order to handle various MIME types that Mutt doesn't have built-in
support for, it parses a series of external configuration files to find
an external handler. The default search string for these files is a
colon delimited list containing the following files:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><code class="literal">$HOME/.mailcap</code></p></li><li class="listitem"><p><code class="literal">$PKGDATADIR/mailcap</code></p></li><li class="listitem"><p><code class="literal">$SYSCONFDIR/mailcap</code></p></li><li class="listitem"><p><code class="literal">/etc/mailcap</code></p></li><li class="listitem"><p><code class="literal">/usr/etc/mailcap</code></p></li><li class="listitem"><p><code class="literal">/usr/local/etc/mailcap</code></p></li></ol></div><p>
where <code class="literal">$HOME</code> is your home directory. The
<code class="literal">$PKGDATADIR</code> and the <code class="literal">$SYSCONFDIR</code>
directories depend on where Mutt is installed: the former is the default
for shared data, the latter for system configuration files.
</p><p>
The default search path can be obtained by running the following
command:
</p><pre class="screen">
mutt -nF /dev/null -Q mailcap_path
</pre><p>
In particular, the metamail distribution will install a mailcap file,
usually as <code class="literal">/usr/local/etc/mailcap</code>, which contains
some baseline entries.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="mailcap-basics"></a>3.1. The Basics of the Mailcap File</h3></div></div></div><p>
A mailcap file consists of a series of lines which are comments, blank,
or definitions.
</p><p>
A comment line consists of a # character followed by anything you want.
</p><p>
A blank line is blank.
</p><p>
A definition line consists of a content type, a view command, and any
number of optional fields. Each field of a definition line is divided
by a semicolon <span class="quote"><span class="quote">;</span></span> character.
</p><p>
The content type is specified in the MIME standard
<span class="quote"><span class="quote">type/subtype</span></span> notation. For example,
<code class="literal">text/plain</code>, <code class="literal">text/html</code>,
<code class="literal">image/gif</code>, etc. In addition, the mailcap format
includes two formats for wildcards, one using the special
<span class="quote"><span class="quote">*</span></span> subtype, the other is the implicit wild, where you only
include the major type. For example, <code class="literal">image/*</code>, or
<code class="literal">video</code> will match all image types and video types,
respectively.
</p><p>
The view command is a Unix command for viewing the type specified. There
are two different types of commands supported. The default is to send
the body of the MIME message to the command on stdin. You can change
this behavior by using <code class="literal">%s</code> as a parameter to your view
command. This will cause Mutt to save the body of the MIME message to a
temporary file, and then call the view command with the
<code class="literal">%s</code> replaced by the name of the temporary file. In
both cases, Mutt will turn over the terminal to the view program until
the program quits, at which time Mutt will remove the temporary file if
it exists. This means that mailcap does <span class="emphasis"><em>not</em></span> work
out of the box with programs which detach themselves from the terminal
right after starting, like <code class="literal">open</code> on Mac OS X. In order
to nevertheless use these programs with mailcap, you probably need
custom shell scripts.
</p><p>
So, in the simplest form, you can send a <code class="literal">text/plain</code>
message to the external pager more on standard input:
</p><pre class="screen">
text/plain; more
</pre><p>
Or, you could send the message as a file:
</p><pre class="screen">
text/plain; more %s
</pre><p>
Perhaps you would like to use lynx to interactively view a
<code class="literal">text/html</code> message:
</p><pre class="screen">
text/html; lynx %s
</pre><p>
In this case, lynx does not support viewing a file from standard input,
so you must use the <code class="literal">%s</code> syntax.
</p><div class="note"><h3 class="title">Note</h3><p>
<span class="emphasis"><em>Some older versions of lynx contain a bug where they will
check the mailcap file for a viewer for <code class="literal">text/html</code>.
They will find the line which calls lynx, and run it. This causes lynx
to continuously spawn itself to view the object.</em></span>
</p></div><p>
On the other hand, maybe you don't want to use lynx interactively, you
just want to have it convert the <code class="literal">text/html</code> to
<code class="literal">text/plain</code>, then you can use:
</p><pre class="screen">
text/html; lynx -dump %s | more
</pre><p>
Perhaps you wish to use lynx to view <code class="literal">text/html</code> files,
and a pager on all other text formats, then you would use the following:
</p><pre class="screen">
text/html; lynx %s
text/*; more
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="secure-mailcap"></a>3.2. Secure Use of Mailcap</h3></div></div></div><p>
The interpretation of shell meta-characters embedded in MIME parameters
can lead to security problems in general. Mutt tries to quote
parameters in expansion of <code class="literal">%s</code> syntaxes properly, and
avoids risky characters by substituting them, see the <a class="link" href="reference.html#mailcap-sanitize" title="3.170. mailcap_sanitize">$mailcap_sanitize</a> variable.
</p><p>
Although Mutt's procedures to invoke programs with mailcap seem to be
safe, there are other applications parsing mailcap, maybe taking less
care of it. Therefore you should pay attention to the following rules:
</p><p>
<span class="emphasis"><em>Keep the %-expandos away from shell quoting.</em></span> Don't
quote them with single or double quotes. Mutt does this for you, the
right way, as should any other program which interprets mailcap. Don't
put them into backtick expansions. Be highly careful with evil
statements, and avoid them if possible at all. Trying to fix broken
behavior with quotes introduces new leaks — there is no
alternative to correct quoting in the first place.
</p><p>
If you have to use the %-expandos' values in context where you need
quoting or backtick expansions, put that value into a shell variable and
reference the shell variable where necessary, as in the following
example (using <code class="literal">$charset</code> inside the backtick expansion
is safe, since it is not itself subject to any further expansion):
</p><pre class="screen">
text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
&amp;&amp; test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="advanced-mailcap"></a>3.3. Advanced Mailcap Usage</h3></div></div></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="optional-mailcap-fields"></a>3.3.1. Optional Fields</h4></div></div></div><p>
In addition to the required content-type and view command fields, you
can add semi-colon <span class="quote"><span class="quote">;</span></span> separated fields to set flags and
other options. Mutt recognizes the following optional fields:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">copiousoutput</span></dt><dd><p>
This flag tells Mutt that the command passes possibly large amounts of
text on standard output. This causes Mutt to invoke a pager (either
the internal pager or the external pager defined by the pager variable)
on the output of the view command. Without this flag, Mutt assumes that
the command is interactive. One could use this to replace the pipe to
<code class="literal">more</code> in the <code class="literal">lynx -dump</code> example in
the Basic section:
</p><pre class="screen">
text/html; lynx -dump %s ; copiousoutput
</pre><p>
This will cause lynx to format the <code class="literal">text/html</code> output
as <code class="literal">text/plain</code> and Mutt will use your standard pager
to display the results.
</p><p>
Mutt will set the <code class="literal">COLUMNS</code> environment variable to
the width of the pager. Some programs make use of this environment
variable automatically. Others provide a command line argument that
can use this to set the output width:
</p><pre class="screen">
text/html; lynx -dump -width ${COLUMNS:-80} %s; copiousoutput
</pre><p>
Note that when using the built-in pager, <span class="emphasis"><em>only</em></span>
entries with this flag will be considered a handler for a MIME type
— all other entries will be ignored.
</p></dd><dt><span class="term">needsterminal</span></dt><dd><p>
Mutt uses this flag when viewing attachments with <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview"><span class="command"><strong>auto_view</strong></span></a>, in order to
decide whether it should honor the setting of the <a class="link" href="reference.html#wait-key" title="3.416. wait_key">$wait_key</a> variable or not. When an attachment
is viewed using an interactive program, and the corresponding mailcap
entry has a <span class="emphasis"><em>needsterminal</em></span> flag, Mutt will use <a class="link" href="reference.html#wait-key" title="3.416. wait_key">$wait_key</a> and the exit status of the program
to decide if it will ask you to press a key after the external program
has exited. In all other situations it will not prompt you for a key.
</p></dd><dt><span class="term">compose=&lt;command&gt;</span></dt><dd><p>
This flag specifies the command to use to create a new attachment of a
specific MIME type. Mutt supports this from the compose menu.
</p></dd><dt><span class="term">composetyped=&lt;command&gt;</span></dt><dd><p>
This flag specifies the command to use to create a new attachment of a
specific MIME type. This command differs from the compose command in
that Mutt will expect standard MIME headers on the data. This can be
used to specify parameters, filename, description, etc. for a new
attachment. Mutt supports this from the compose menu.
</p></dd><dt><span class="term">print=&lt;command&gt;</span></dt><dd><p>
This flag specifies the command to use to print a specific MIME type.
Mutt supports this from the attachment and compose menus.
</p></dd><dt><span class="term">edit=&lt;command&gt;</span></dt><dd><p>
This flag specifies the command to use to edit a specific MIME type.
Mutt supports this from the compose menu, and also uses it to compose
new attachments. Mutt will default to the defined <a class="link" href="reference.html#editor" title="3.85. editor">$editor</a> for text attachments.
</p></dd><dt><span class="term">nametemplate=&lt;template&gt;</span></dt><dd><p>
This field specifies the format for the file denoted by
<code class="literal">%s</code> in the command fields. Certain programs will
require a certain file extension, for instance, to correctly view a
file. For instance, lynx will only interpret a file as
<code class="literal">text/html</code> if the file ends in
<code class="literal">.html</code>. So, you would specify lynx as a
<code class="literal">text/html</code> viewer with a line in the mailcap file
like:
</p><pre class="screen">
text/html; lynx %s; nametemplate=%s.html
</pre></dd><dt><span class="term">test=&lt;command&gt;</span></dt><dd><p>
This field specifies a command to run to test whether this mailcap entry
should be used. The command is defined with the command expansion rules
defined in the next section. If the command returns 0, then the test
passed, and Mutt uses this entry. If the command returns non-zero, then
the test failed, and Mutt continues searching for the right entry. Note
that the content-type must match before Mutt performs the test. For
example:
</p><pre class="screen">
text/html; firefox -remote 'openURL(%s)' ; test=RunningX
text/html; lynx %s
</pre><p>
In this example, Mutt will run the program <code class="literal">RunningX</code>
which will return 0 if the X Window manager is running, and non-zero if
it isn't. If <code class="literal">RunningX</code> returns 0, then Mutt will run
firefox to display the <code class="literal">text/html</code> object. If RunningX
doesn't return 0, then Mutt will go on to the next entry and use lynx to
display the <code class="literal">text/html</code> object.
</p></dd></dl></div></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="mailcap-search-order"></a>3.3.2. Search Order</h4></div></div></div><p>
When searching for an entry in the mailcap file, Mutt will search for
the most useful entry for its purpose. For instance, if you are
attempting to print an <code class="literal">image/gif</code>, and you have the
following entries in your mailcap file, Mutt will search for an entry
with the print command:
</p><pre class="screen">
image/*; xv %s
image/gif; ; print= anytopnm %s | pnmtops | lpr; \
nametemplate=%s.gif
</pre><p>
Mutt will skip the <code class="literal">image/*</code> entry and use the
<code class="literal">image/gif</code> entry with the print command.
</p><p>
In addition, you can use this with <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview"><span class="command"><strong>auto_view</strong></span></a> to denote two
commands for viewing an attachment, one to be viewed automatically, the
other to be viewed interactively from the attachment menu using the
<code class="literal">&lt;view-mailcap&gt;</code> function (bound to
<span class="quote"><span class="quote">m</span></span> by default). In addition, you can then use the test
feature to determine which viewer to use interactively depending on your
environment.
</p><pre class="screen">
text/html; firefox -remote 'openURL(%s)' ; test=RunningX
text/html; lynx %s; nametemplate=%s.html
text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput
</pre><p>
For <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview"><span class="command"><strong>auto_view</strong></span></a>, Mutt
will choose the third entry because of the
<code class="literal">copiousoutput</code> tag. For interactive viewing, Mutt
will run the program <code class="literal">RunningX</code> to determine if it
should use the first entry. If the program returns non-zero, Mutt will
use the second entry for interactive viewing. The last entry is for
inline display in the pager and the
<code class="literal">&lt;view-attach&gt;</code> function in the attachment menu.
</p><p>
Entries with the <code class="literal">copiousoutput</code> tag should always be
specified as the last one per type. For non-interactive use, the last
entry will then actually be the first matching one with the tag set.
For non-interactive use, only <code class="literal">copiousoutput</code>-tagged
entries are considered. For interactive use, Mutt ignores this tag and
treats all entries equally. Therefore, if not specified last, all
following entries without this tag would never be considered for
<code class="literal">&lt;view-attach&gt;</code> because the
<code class="literal">copiousoutput</code> before them matched already.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="mailcap-command-expansion"></a>3.3.3. Command Expansion</h4></div></div></div><p>
The various commands defined in the mailcap files are passed to the
<code class="literal">/bin/sh</code> shell using the <code class="literal">system(3)</code>
function. Before the command is passed to <code class="literal">/bin/sh
-c</code>, it is parsed to expand various special parameters with
information from Mutt. The keywords Mutt expands are:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">%s</span></dt><dd><p>
As seen in the basic mailcap section, this variable is expanded to a
filename specified by the calling program. This file contains the body
of the message to view/print/edit or where the composing program should
place the results of composition. In addition, the use of this keyword
causes Mutt to not pass the body of the message to the view/print/edit
program on stdin.
</p></dd><dt><span class="term">%t</span></dt><dd><p>
Mutt will expand <code class="literal">%t</code> to the text representation of the
content type of the message in the same form as the first parameter of
the mailcap definition line, i.e. <code class="literal">text/html</code> or
<code class="literal">image/gif</code>.
</p></dd><dt><span class="term">%{&lt;parameter&gt;}</span></dt><dd><p>
Mutt will expand this to the value of the specified parameter from the
Content-Type: line of the mail message. For instance, if your mail
message contains:
</p><pre class="screen">
Content-Type: text/plain; charset=iso-8859-1
</pre><p>
then Mutt will expand <code class="literal">%{charset}</code> to
<span class="quote"><span class="quote">iso-8859-1</span></span>. The default metamail mailcap file uses this
feature to test the charset to spawn an xterm using the right charset to
view the message.
</p></dd><dt><span class="term">\%</span></dt><dd><p>
This will be replaced by a literal <code class="literal">%</code>.
</p></dd></dl></div><p>
Mutt does not currently support the <code class="literal">%F</code> and
<code class="literal">%n</code> keywords specified in RFC 1524. The main purpose
of these parameters is for multipart messages, which is handled
internally by Mutt.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="mailcap-example"></a>3.4. Example Mailcap Files</h3></div></div></div><p>
This mailcap file is fairly simple and standard:
</p><pre class="screen">
<span class="comment"># I'm always running X :)</span>
video/*; xanim %s &gt; /dev/null
image/*; xv %s &gt; /dev/null
<span class="comment"># I'm always running firefox (if my computer had more memory, maybe)</span>
text/html; firefox -remote 'openURL(%s)'
</pre><p>
This mailcap file shows quite a number of examples:
</p><pre class="screen">
<span class="comment"># Use xanim to view all videos Xanim produces a header on startup,
# send that to /dev/null so I don't see it</span>
video/*; xanim %s &gt; /dev/null
<span class="comment"># Send html to a running firefox by remote</span>
text/html; firefox -remote 'openURL(%s)'; test=RunningFirefox
<span class="comment"># If I'm not running firefox but I am running X, start firefox on the
# object</span>
text/html; firefox %s; test=RunningX
<span class="comment"># Else use lynx to view it as text</span>
text/html; lynx %s
<span class="comment"># This version would convert the text/html to text/plain</span>
text/html; lynx -dump %s; copiousoutput
<span class="comment"># I use enscript to print text in two columns to a page</span>
text/*; more %s; print=enscript -2Gr %s
<span class="comment"># Firefox adds a flag to tell itself to view jpegs internally</span>
image/jpeg;xv %s; x-mozilla-flags=internal
<span class="comment"># Use xv to view images if I'm running X</span>
<span class="comment"># In addition, this uses the \ to extend the line and set my editor</span>
<span class="comment"># for images</span>
image/*;xv %s; test=RunningX; \
edit=xpaint %s
<span class="comment"># Convert images to text using the netpbm tools</span>
image/*; (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
pbmtoascii -1x2 ) 2&gt;&amp;1 ; copiousoutput
<span class="comment"># Send excel spreadsheets to my NT box</span>
application/ms-excel; open.pl %s
</pre></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="auto-view"></a>4. MIME Autoview</h2></div></div></div><p>
Usage:
</p><div class="cmdsynopsis"><p><code class="command">auto_view</code>
<em class="replaceable"><code>mimetype</code></em>
[
<em class="replaceable"><code>mimetype</code></em>
...]<br /><code class="command">unauto_view</code> {
<em class="replaceable"><code>*</code></em>
|
<em class="replaceable"><code>mimetype</code></em>
... }</p></div><p>
In addition to explicitly telling Mutt to view an attachment with the
MIME viewer defined in the mailcap file from the attachments menu, Mutt
has support for automatically viewing MIME attachments while in the
pager.
</p><p>
For this to work, you must define a viewer in the mailcap file which
uses the <code class="literal">copiousoutput</code> option to denote that it is
non-interactive. Usually, you also use the entry to convert the
attachment to a text representation which you can view in the pager.
</p><p>
You then use the <span class="command"><strong>auto_view</strong></span> configuration command to
list the content-types that you wish to view automatically. For
instance, if you set it to:
</p><pre class="screen">
auto_view text/html application/x-gunzip \
application/postscript image/gif application/x-tar-gz
</pre><p>
...Mutt would try to find corresponding entries for rendering
attachments of these types as text. A corresponding mailcap could look
like:
</p><pre class="screen">
text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
image/*; anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | \
pgmtopbm | pbmtoascii ; copiousoutput
application/x-gunzip; gzcat; copiousoutput
application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
application/postscript; ps2ascii %s; copiousoutput
</pre><p>
<span class="command"><strong>unauto_view</strong></span> can be used to remove previous entries
from the <span class="command"><strong>auto_view</strong></span> list. This can be used with <a class="link" href="configuration.html#message-hook" title="22. Change Settings Before Formatting a Message"><span class="command"><strong>message-hook</strong></span></a> to
autoview messages based on size, etc.
<span class="quote"><span class="quote"><span class="command"><strong>unauto_view</strong></span> *</span></span> will remove all previous
entries.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alternative-order"></a>5. MIME Multipart/Alternative</h2></div></div></div><p>
The <code class="literal">multipart/alternative</code> container type only has
child MIME parts which represent the same content in an alternative
way. This is often used to send HTML messages which contain an
alternative plain text representation.
</p><p>
Mutt has some heuristics for determining which attachment of a
<code class="literal">multipart/alternative</code> type to display:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
First, Mutt will check the <span class="command"><strong>alternative_order</strong></span> list to
determine if one of the available types is preferred. It consists of a
number of MIME types in order, including support for implicit and
explicit wildcards. For example:
</p><pre class="screen">
alternative_order text/enriched text/plain text \
application/postscript image/*
</pre></li><li class="listitem"><p>
Next, Mutt will check if any of the types have a defined <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview"><span class="command"><strong>auto_view</strong></span></a>, and use that.
</p></li><li class="listitem"><p>
Failing that, Mutt will look first for
<code class="literal">text/enriched</code>, followed by
<code class="literal">text/plain</code>, and finally
<code class="literal">text/html</code>.
</p></li><li class="listitem"><p>
As a last attempt, Mutt will look for any type it knows how to handle.
</p></li></ol></div><p>
To remove a MIME type from the <span class="command"><strong>alternative_order</strong></span>
list, use the <span class="command"><strong>unalternative_order</strong></span> command.
</p><p>
Generating <code class="literal">multipart/alternative</code> content is supported
via the
<a class="link" href="reference.html#send-multipart-alternative" title="3.303. send_multipart_alternative">$send_multipart_alternative</a>
quadoption and
<a class="link" href="reference.html#send-multipart-alternative-filter" title="3.304. send_multipart_alternative_filter">$send_multipart_alternative_filter</a>
filter script. The composed <code class="literal">text/plain</code> content
will be piped to the filter script's stdin. The output from the
filter script should be the generated mime type of the content, a
blank line, and the content. For example:
</p><pre class="screen">
text/html
&lt;html&gt;
&lt;body&gt;
Content in html format
&lt;/body&gt;
&lt;/html&gt;
</pre><p>
A preview of the alternative can be viewed in the compose menu using
the functions <code class="literal">&lt;view-alt&gt;</code> (bound to
"v"), <code class="literal">&lt;view-alt-text&gt;</code> (bound to
"Esc v"), <code class="literal">&lt;view-alt-mailcap&gt;</code> (bound
to "V"), and <code class="literal">&lt;view-alt-pager&gt;</code>
(unbound). See <a class="xref" href="mimesupport.html#attach-viewers" title="1.3.1. Viewing Attachments">Section 1.3.1, “Viewing Attachments”</a> for a discussion of
the differences between these viewing functions.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="attachments"></a>6. Attachment Searching and Counting</h2></div></div></div><p>
If you ever lose track of attachments in your mailboxes, Mutt's
attachment-counting and -searching support might be for you. You can
make your message index display the number of qualifying attachments in
each message, or search for messages by attachment count. You also can
configure what kinds of attachments qualify for this feature with the
<span class="command"><strong>attachments</strong></span> and <span class="command"><strong>unattachments</strong></span>
commands.
</p><p>
In order to provide this information, Mutt needs to fully MIME-parse all
messages affected first. This can slow down operation especially for
remote mail folders such as IMAP because all messages have to be
downloaded first regardless whether the user really wants to view them
or not though using <a class="xref" href="optionalfeatures.html#body-caching" title="8.2. Body Caching">Section 8.2, “Body Caching”</a> usually means to
download the message just once.
</p><p>
By default, Mutt will not search inside
<code class="literal">multipart/alternative</code> containers. This can be
changed via the <a class="link" href="reference.html#count-alternatives" title="3.54. count_alternatives">$count_alternatives</a> configuration
variable.
</p><p>
The syntax is:
</p><div class="cmdsynopsis"><p><code class="command">attachments</code>
<em class="replaceable"><code>{ + | - }disposition</code></em>
<em class="replaceable"><code>mime-type</code></em>
<br /><code class="command">unattachments</code>
<em class="replaceable"><code>{ + | - }disposition</code></em>
<em class="replaceable"><code>mime-type</code></em>
<br /><code class="command">attachments</code>
<code class="option">?</code>
<br /><code class="command">unattachments</code>
<code class="option">*</code>
</p></div><p>
<span class="emphasis"><em>disposition</em></span> is the attachment's Content-Disposition
type — either <code class="literal">inline</code> or
<code class="literal">attachment</code>. You can abbreviate this to
<code class="literal">I</code> or <code class="literal">A</code>.
</p><p>
The first part of a message or multipart group, if inline, is counted
separately than other inline parts. Specify <code class="literal">root</code>
or <code class="literal">R</code> for <span class="emphasis"><em>disposition</em></span> to count
these as attachments. If this first part is of type
multipart/alternative, note that its top-level inline parts are also
counted via <code class="literal">root</code> <span class="emphasis"><em>disposition</em></span>
(if <a class="link" href="reference.html#count-alternatives" title="3.54. count_alternatives">$count_alternatives</a> is
set).
</p><p>
Disposition is prefixed by either a <span class="quote"><span class="quote">+</span></span> symbol or a
<span class="quote"><span class="quote">-</span></span> symbol. If it's a <span class="quote"><span class="quote">+</span></span>, you're saying that
you want to allow this disposition and MIME type to qualify. If it's a
<span class="quote"><span class="quote">-</span></span>, you're saying that this disposition and MIME type is
an exception to previous <span class="quote"><span class="quote">+</span></span> rules. There are examples
below of how this is useful.
</p><p>
<span class="emphasis"><em>mime-type</em></span> is the MIME type of the attachment you
want the command to affect. A MIME type is always of the format
<code class="literal">major/minor</code>, where <code class="literal">major</code> describes
the broad category of document you're looking at, and
<code class="literal">minor</code> describes the specific type within that
category. The major part of mime-type must be literal text (or the
special token <span class="quote"><span class="quote"><code class="literal">*</code></span></span>), but the minor part
may be a regular expression. (Therefore,
<span class="quote"><span class="quote"><code class="literal">*/.*</code></span></span> matches any MIME type.)
</p><p>
The MIME types you give to the <span class="command"><strong>attachments</strong></span> directive
are a kind of pattern. When you use the <span class="command"><strong>attachments</strong></span>
directive, the patterns you specify are added to a list. When you use
<span class="command"><strong>unattachments</strong></span>, the pattern is removed from the list.
The patterns are not expanded and matched to specific MIME types at this
time — they're just text in a list. They're only matched when
actually evaluating a message.
</p><p>
Some examples might help to illustrate. The examples that are not
commented out define the default configuration of the lists.
</p><div class="example"><a id="ex-attach-count"></a><p class="title"><strong>Example 5.2. Attachment counting</strong></p><div class="example-contents"><pre class="screen">
<span class="comment">
# Removing a pattern from a list removes that pattern literally. It
# does not remove any type matching the pattern.
#
# attachments +A */.*
# attachments +A image/jpeg
# unattachments +A */.*
#
# This leaves "attached" image/jpeg files on the allowed attachments
# list. It does not remove all items, as you might expect, because the
# second */.* is not a matching expression at this time.
#
# Remember: "unattachments" only undoes what "attachments" has done!
# It does not trigger any matching on actual messages.
# Qualify any MIME part with an "attachment" disposition, EXCEPT for
# text/x-vcard and application/pgp parts. (PGP parts are already known
# to mutt, and can be searched for with ~g, ~G, and ~k.)
#
# I've added x-pkcs7 to this, since it functions (for S/MIME)
# analogously to PGP signature attachments. S/MIME isn't supported
# in a stock mutt build, but we can still treat it specially here.
#
</span>
attachments +A */.*
attachments -A text/x-vcard application/pgp.*
attachments -A application/x-pkcs7-.*
<span class="comment">
# Discount all MIME parts with an "inline" disposition, unless they're
# text/plain. (Why inline a text/plain part unless it's external to the
# message flow?)
</span>
attachments +I text/plain
<span class="comment">
# These two lines make Mutt qualify MIME containers. (So, for example,
# a message/rfc822 forward will count as an attachment.) The first
# line is unnecessary if you already have "attach-allow */.*", of
# course. These are off by default! The MIME elements contained
# within a message/* or multipart/* are still examined, even if the
# containers themselves don't qualify.
#attachments +A message/.* multipart/.*
#attachments +I message/.* multipart/.*
</span>
<span class="comment">## You probably don't really care to know about deleted attachments.</span>
attachments -A message/external-body
attachments -I message/external-body
</pre></div></div><br class="example-break" /><p>
Entering the command <span class="quote"><span class="quote"><span class="command"><strong>attachments</strong></span> ?</span></span> as
a command will list your current settings in Muttrc format, so that it
can be pasted elsewhere.
</p><p>
Entering the command <span class="quote"><span class="quote"><span class="command"><strong>unattachments</strong></span> *</span></span> as
a command will Clear all attachment settings.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mime-lookup"></a>7. MIME Lookup</h2></div></div></div><p>
Usage:
</p><div class="cmdsynopsis"><p><code class="command">mime_lookup</code>
<em class="replaceable"><code>mimetype</code></em>
[
<em class="replaceable"><code>mimetype</code></em>
...]<br /><code class="command">unmime_lookup</code> {
<em class="replaceable"><code>*</code></em>
|
<em class="replaceable"><code>mimetype</code></em>
... }</p></div><p>
Mutt's <span class="command"><strong>mime_lookup</strong></span> list specifies a list of MIME
types that should <span class="emphasis"><em>not</em></span> be treated according to their
mailcap entry. This option is designed to deal with binary types such
as <code class="literal">application/octet-stream</code>. When an attachment's
MIME type is listed in <span class="command"><strong>mime_lookup</strong></span>, then the
extension of the filename will be compared to the list of extensions in
the <code class="literal">mime.types</code> file. The MIME type associated with
this extension will then be used to process the attachment according to
the rules in the mailcap file and according to any other configuration
options (such as <span class="command"><strong>auto_view</strong></span>) specified. Common usage
would be:
</p><pre class="screen">
mime_lookup application/octet-stream application/X-Lotus-Manuscript
</pre><p>
In addition, the <code class="literal">unmime_lookup</code> command may be used to
disable this feature for any particular MIME type if it had been set,
for example, in a global <code class="literal">.muttrc</code>.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="advancedusage.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="optionalfeatures.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Advanced Usage </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. Optional Features</td></tr></table></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,46 @@
From roessler@does-not-exist.org Wed Nov 7 11:49:56 2001
Date: Wed, 7 Nov 2001 11:49:56 +0100
From: Thomas Roessler <roessler@does-not-exist.org>
To: mutt-dev@mutt.org
Subject: To those shipping patches (v2)
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
Status: RO
Content-Length: 1273
Lines: 34
You folks have convinced me that the old patchlist was almost the
right way to go for mutt identifying what patches have been applied.
Thus, I've implemented this scheme (and will commit it to the CVS
in a moment): There's a new file called PATCHES in the source tree,
which will be empty in the official distribution.
This file's format is one patch ID per line. Patch IDs should be
the same as the file names used for distributing patches. The
format for these file names should be this:
patch-<version>.<initials>.<patch-description>.<patchlevel>
That is, Vsevolod's NNTP patch for mutt-1.3.42 could be named like
this:
patch-1.3.42.vvv.nntp.1
From PATCHES, patchlist.c will be automatically generated. In
order to properly construct PATCHES, please include the following
chunk with your patch, replacing <your-id-here> by your patch ID.
------------------------------snip------------------------------
--- PATCHES~ Tue Nov 6 19:59:33 2001
+++ PATCHES Tue Nov 6 19:59:42 2001
@@ -1,0 +1 @@
+<your-id-here>
------------------------------snip------------------------------
The patch IDs will be displayed when mutt is run with the 'v'
command line switch.
--
Thomas Roessler http://log.does-not-exist.org/

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,20 @@
#
# Key bindings similar to those of MUSH
#
# $Id$
bind index . display-message
bind index t display-message
macro index n "<next-entry><display-message>"
bind index + next-entry
bind index j next-entry
bind index J next-entry
bind index - previous-entry
bind index k previous-entry
bind index K previous-entry
bind index { top-page
bind index } bottom-page
bind index f change-folder
bind index \cu sync-mailbox
bind index * flag-message

View file

@ -0,0 +1,44 @@
#
# This file contains commands to change the keybindings in Mutt to be
# similar to those of PINE 3.95.
#
#
# $Id$
#
bind index v display-message
bind index p previous-undeleted
bind index n next-undeleted
bind index ' ' next-page
bind index c mail
bind index g change-folder
bind index w search
bind index y print-message
bind index x sync-mailbox
bind index $ sort-mailbox
bind index a tag-prefix
bind index \; tag-entry
# Not possible to simulate zoom-out...
macro index z "<limit>~T<Enter>"
bind pager p previous-undeleted
bind pager n next-undeleted
bind pager ' ' next-page
bind pager g change-folder
bind pager c mail
bind pager w search
bind pager y print-message
bind pager \n noop # PINE prints "No default action for this menu."
bind pager <up> previous-line
bind pager <down> next-line
bind compose \cx send-message
# PINE has different defaults for this variables
set folder=~/mail
set record=+sent-mail
set nosave_name
set postponed=~/postponed-msgs
set hdr_format="%Z %3C %{%b %d} %-19.19L (%5c) %s"

View file

@ -0,0 +1,22 @@
# From: Tom Gilbert <gilbertt@tomgilbert.freeserve.co.uk>
# To: mutt-users@mutt.org
# Subject: Re: Lynx-like movements
# Date: Sat, 4 Sep 1999 21:09:00 +0000
#
# These key bindings may be nice for notorious lynx or tin users.
#
bind pager <up> previous-line
bind pager <down> next-line
bind pager <left> exit
bind pager <right> view-attachments
bind attach <left> exit
bind attach <right> view-attach
bind index <right> display-message
macro index <left> "<change-folder>?"
bind browser <right> select-entry
macro browser <left> "<exit><change-folder>!<Enter>"

View file

@ -0,0 +1,34 @@
#!/bin/sh
#
# Copyright (C) 2020 Eike Rathke <erack@erack.de>
#
# 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.
#
# To conveniently switch between graphics and terminal editor I have the
# following in my muttrc:
# source '~/.mutt/bgedit-detectgui.sh|'
#
# So exporting MUTT_USE_GVIM=yes (or anything) in the shell invoking mutt
# switches to the background editing feature.
#
if [ -n "$MUTT_USE_GVIM" ] && [ -n "$DISPLAY" ]; then
# Foreground gvim, window 80 cols by 40 rows at X 400 and Y 0.
echo 'set editor="gvim -f -geometry 80x40+400+0"'
echo 'set background_edit=yes'
else
echo 'set editor=vim'
fi

View file

@ -0,0 +1,66 @@
#!/bin/sh
#
# Copyright (C) 2020 Kevin J. McCarthy <kevin@8t8.us>
#
# 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.
#
# Invoke a background edit session in a new GNU Screen or tmux window.
#
# This script is derived from Aaron Schrab's tmuxwait script, posted to
# mutt-dev at
# <http://lists.mutt.org/pipermail/mutt-dev/Week-of-Mon-20200406/000591.html>.
#
# If you run mutt inside screen or tmux, add to your muttrc:
# set background_edit
# set editor = '/path/to/bgedit-screen-tmux.sh [youreditor]'
#
# It may also be useful to modify something like contrib/bgedit-detectgui.sh
# to look for the $STY or $TMUX environment variables and set those
# configuration variables appropriately.
#
set -e
if [ "$#" -lt 2 ]; then
echo "Usage: $0 editor tempfile" >&2
exit 1
fi
editor=$1
shift
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT INT QUIT
mkfifo "$tmpdir/status"
cat >"$tmpdir/run" <<END_SCRIPT
exitval=1
trap 'echo \$exitval > "$tmpdir/status"' EXIT INT QUIT
$editor "\$@"
exitval=\$?
END_SCRIPT
if test x$STY != x; then
screen -X screen /bin/sh "$tmpdir/run" "$@"
elif test x$TMUX != x; then
tmux neww /bin/sh "$tmpdir/run" "$@"
else
echo "Not running inside a terminal emulator" >&2
exit 1
fi
read exitval <"$tmpdir/status"
exit "$exitval"

View file

@ -0,0 +1,24 @@
# -*-muttrc-*-
# Colors for use with xterm and the like, white background.
color hdrdefault blue white
color quoted blue white
color signature red white
color attachment red white
color prompt brightmagenta white
color message brightred white
color error brightred white
color indicator brightyellow red
color status brightgreen blue
color tree black white
color normal black white
color markers red white
color search white black
color tilde brightmagenta white
color index blue white ~F
color index red white "~N|~O"
# color body brightblack white '\*+[^*]+\*+'
# color body brightblack white '_+[^_]+_+'

View file

@ -0,0 +1,23 @@
# -*-muttrc-*-
# Palette for use with the Linux console. Black background.
color hdrdefault blue black
color quoted blue black
color signature blue black
color attachment red black
color prompt brightmagenta black
color message brightred black
color error brightred black
color indicator black red
color status brightgreen blue
color tree white black
color normal white black
color markers red black
color search white black
color tilde brightmagenta black
color index blue black ~F
color index red black "~N|~O"
# color body brightwhite black '\*+[^*]+\*+'
# color body brightwhite black '_+[^_]+_+'

View file

@ -0,0 +1,114 @@
# -*-muttrc-*-
#
# Command formats for gpg.
#
# Some of the older commented-out versions of the commands use gpg-2comp from:
# http://70t.de/download/gpg-2comp.tar.gz
#
# %p The empty string when no passphrase is needed,
# the string "PGPPASSFD=0" if one is needed.
#
# This is mostly used in conditional % sequences.
#
# %f Most PGP commands operate on a single file or a file
# containing a message. %f expands to this file's name.
#
# %s When verifying signatures, there is another temporary file
# containing the detached signature. %s expands to this
# file's name.
#
# %a In "signing" contexts, this expands to the value of the
# configuration variable $pgp_sign_as, if set, otherwise
# $pgp_default_key. You probably need to
# use this within a conditional % sequence.
#
# %r In many contexts, mutt passes key IDs to pgp. %r expands to
# a list of key IDs.
# Section A: Key Management
# The default key for encryption (used by $pgp_self_encrypt and
# $postpone_encrypt).
#
# It will also be used for signing unless $pgp_sign_as is set to a
# key.
#
# Unless your key does not have encryption capability, uncomment this
# line and replace the keyid with your own.
#
# set pgp_default_key="0x12345678"
# If you have a separate signing key, or your key _only_ has signing
# capability, uncomment this line and replace the keyid with your
# signing keyid.
#
# set pgp_sign_as="0x87654321"
# Section B: Commands
# Note that we explicitly set the comment armor header since GnuPG, when used
# in some localiaztion environments, generates 8bit data in that header, thereby
# breaking PGP/MIME.
# decode application/pgp
set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
# verify a pgp/mime signature
set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"
# decrypt a pgp/mime attachment
set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
# create a pgp/mime signed attachment
# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
# create a application/pgp signed (old-style) message
# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
# create a pgp/mime encrypted attachment
# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
# create a pgp/mime encrypted and signed attachment
# set pgp_encrypt_sign_command="pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
# import a key into the public key ring
set pgp_import_command="gpg --no-verbose --import %f"
# export a key from the public key ring
set pgp_export_command="gpg --no-verbose --export --armor %r"
# verify a key
set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
# read in the public key ring
# note: the second --with-fingerprint adds fingerprints to subkeys
set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r"
# read in the secret key ring
# note: the second --with-fingerprint adds fingerprints to subkeys
set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r"
# fetch keys
# set pgp_getkeys_command="pkspxycwrap %r"
# pattern for good signature - may need to be adapted to locale!
# set pgp_good_sign="^gpgv?: Good signature from "
# OK, here's a version which uses gnupg's message catalog:
# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`"
# This version uses --status-fd messages
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
# pattern to verify a decryption occurred
# This is now deprecated by pgp_check_gpg_decrypt_status_fd:
# set pgp_decryption_okay="^\\[GNUPG:\\] DECRYPTION_OKAY"
set pgp_check_gpg_decrypt_status_fd

View file

@ -0,0 +1,2 @@
iconv-hook CP850 IBM-850
iconv-hook ISO-8859-1 ISO8859-1

View file

@ -0,0 +1,13 @@
iconv-hook CP1046 IBM-1046
iconv-hook CP850 IBM-850
iconv-hook CP856 IBM-856
iconv-hook CP932 IBM-932
iconv-hook EUC-CN IBM-eucCN
iconv-hook EUC-JP IBM-eucJP
iconv-hook EUC-KR IBM-eucKR
iconv-hook EUC-TW IBM-eucTW
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-6 ISO8859-6
iconv-hook ISO-8859-8 ISO8859-8

View file

@ -0,0 +1,18 @@
iconv-hook BIG5 big5
iconv-hook CP1046 IBM-1046
iconv-hook CP850 IBM-850
iconv-hook CP856 IBM-856
iconv-hook CP922 IBM-922
iconv-hook CP932 IBM-932
iconv-hook EUC-CN IBM-eucCN
iconv-hook EUC-JP IBM-eucJP
iconv-hook EUC-KR IBM-eucKR
iconv-hook EUC-TW IBM-eucTW
iconv-hook ISO-8859-13 IBM-921
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-6 ISO8859-6
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-8 ISO8859-8
iconv-hook ISO-8859-9 ISO8859-9

View file

@ -0,0 +1,23 @@
iconv-hook BIG5 big5
iconv-hook CP1046 IBM-1046
iconv-hook CP1124 IBM-1124
iconv-hook CP1129 IBM-1129
iconv-hook CP1252 IBM-1252
iconv-hook CP850 IBM-850
iconv-hook CP856 IBM-856
iconv-hook CP922 IBM-922
iconv-hook CP932 IBM-932
iconv-hook CP943 IBM-943
iconv-hook EUC-CN IBM-eucCN
iconv-hook EUC-JP IBM-eucJP
iconv-hook EUC-KR IBM-eucKR
iconv-hook EUC-TW IBM-eucTW
iconv-hook ISO-8859-13 IBM-921
iconv-hook ISO-8859-15 ISO8859-15
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-6 ISO8859-6
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-8 ISO8859-8
iconv-hook ISO-8859-9 ISO8859-9

View file

@ -0,0 +1,6 @@
iconv-hook ASCII <error>
iconv-hook CP866 <error>
iconv-hook ISO-8859-15 <error>
iconv-hook ISO-8859-1 <error>
iconv-hook ISO-8859-2 <error>
iconv-hook KOI8-R <error>

View file

@ -0,0 +1 @@
iconv-hook ISO-8859-1 ANSI_X3.4-1968

View file

@ -0,0 +1 @@
iconv-hook ASCII ANSI_X3.4-1968

View file

@ -0,0 +1,15 @@
iconv-hook EUC-CN hp15CN
iconv-hook EUC-TW eucTW
iconv-hook HP-ARABIC8 arabic8
iconv-hook HP-GREEK8 greek8
iconv-hook HP-HEBREW8 hebrew8
iconv-hook HP-ROMAN8 roman8
iconv-hook HP-TURKISH8 turkish8
iconv-hook ISO-8859-1 iso88591
iconv-hook ISO-8859-2 iso88592
iconv-hook ISO-8859-5 iso88595
iconv-hook ISO-8859-6 iso88596
iconv-hook ISO-8859-7 iso88597
iconv-hook ISO-8859-8 iso88598
iconv-hook ISO-8859-9 iso88599
iconv-hook TIS-620 tis620

View file

@ -0,0 +1,15 @@
iconv-hook HP-ARABIC8 arabic8
iconv-hook HP-GREEK8 greek8
iconv-hook HP-HEBREW8 hebrew8
iconv-hook HP-ROMAN8 roman8
iconv-hook HP-TURKISH8 turkish8
iconv-hook ISO-8859-15 iso885915
iconv-hook ISO-8859-1 iso88591
iconv-hook ISO-8859-2 iso88592
iconv-hook ISO-8859-5 iso88595
iconv-hook ISO-8859-6 iso88596
iconv-hook ISO-8859-7 iso88597
iconv-hook ISO-8859-8 iso88598
iconv-hook ISO-8859-9 iso88599
iconv-hook TIS-620 tis620
iconv-hook UTF-8 utf8

View file

@ -0,0 +1,21 @@
iconv-hook BIG5 big5
iconv-hook EUC-CN hp15CN
iconv-hook EUC-JP eucJP
iconv-hook EUC-KR eucKR
iconv-hook EUC-TW eucTW
iconv-hook HP-ARABIC8 arabic8
iconv-hook HP-GREEK8 greek8
iconv-hook HP-HEBREW8 hebrew8
iconv-hook HP-KANA8 kana8
iconv-hook HP-ROMAN8 roman8
iconv-hook HP-TURKISH8 turkish8
iconv-hook ISO-8859-15 iso885915
iconv-hook ISO-8859-1 iso88591
iconv-hook ISO-8859-2 iso88592
iconv-hook ISO-8859-5 iso88595
iconv-hook ISO-8859-6 iso88596
iconv-hook ISO-8859-7 iso88597
iconv-hook ISO-8859-8 iso88598
iconv-hook ISO-8859-9 iso88599
iconv-hook TIS-620 tis620
iconv-hook UTF-8 utf8

View file

@ -0,0 +1,9 @@
iconv-hook EUC-CN eucCN
iconv-hook EUC-JP eucJP
iconv-hook EUC-KR eucKR
iconv-hook EUC-TW eucTW
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-9 ISO8859-9

View file

@ -0,0 +1,3 @@
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-9 ISO8859-9

View file

@ -0,0 +1,4 @@
iconv-hook CP850 cp850
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-9 ISO8859-9

View file

@ -0,0 +1 @@
iconv-hook bug

View file

@ -0,0 +1 @@
iconv-hook ISO-8859-1 ISO8859-1

View file

@ -0,0 +1,11 @@
iconv-hook EUC-CN gb2312
iconv-hook EUC-JP eucJP
iconv-hook EUC-KR 5601
iconv-hook EUC-TW cns11643
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-4 ISO8859-4
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-9 ISO8859-9
iconv-hook Shift_JIS PCK

View file

@ -0,0 +1,6 @@
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-4 ISO8859-4
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-9 ISO8859-9

View file

@ -0,0 +1,12 @@
iconv-hook ASCII 646
iconv-hook ISO-8859-15 ISO8859-15
iconv-hook ISO-8859-1 ISO8859-1
iconv-hook ISO-8859-2 ISO8859-2
iconv-hook ISO-8859-4 ISO8859-4
iconv-hook ISO-8859-5 ISO8859-5
iconv-hook ISO-8859-6 ISO8859-6
iconv-hook ISO-8859-7 ISO8859-7
iconv-hook ISO-8859-8 ISO8859-8
iconv-hook ISO-8859-9 ISO8859-9
iconv-hook KOI8-R koi8-r
iconv-hook TIS-620 TIS620.2533

View file

@ -0,0 +1,309 @@
#!/usr/bin/python3
#
# markdown2html.py — simple Markdown-to-HTML converter for use with Mutt
#
# Mutt recently learnt [how to compose `multipart/alternative`
# emails][1]. This script assumes a message has been composed using Markdown
# (with a lot of pandoc extensions enabled), and translates it to `text/html`
# for Mutt to tie into such a `multipart/alternative` message.
#
# [1]: https://gitlab.com/muttmua/mutt/commit/0e566a03725b4ad789aa6ac1d17cdf7bf4e7e354)
#
# Configuration:
# muttrc:
# set send_multipart_alternative=yes
# set send_multipart_alternative_filter=/path/to/markdown2html.py
#
# Optionally, Custom CSS styles will be read from `~/.mutt/markdown2html.css`,
# if present.
#
# Requirements:
# - python3
# - PyPandoc (and pandoc installed, or downloaded)
# - Pynliner
#
# Optional:
# - Pygments, if installed, then syntax highlighting is enabled
#
# Latest version:
# https://git.madduck.net/etc/mutt.git/blob_plain/HEAD:/.mutt/markdown2html
#
# Copyright © 2019 martin f. krafft <madduck@madduck.net>
# Released under the GPL-2+ licence, just like Mutt itself.
#
import pypandoc
import pynliner
import re
import os
import sys
try:
from pygments.formatters import get_formatter_by_name
formatter = get_formatter_by_name('html', style='default')
DEFAULT_CSS = formatter.get_style_defs('.sourceCode')
except ImportError:
DEFAULT_CSS = ""
DEFAULT_CSS += '''
.quote {
padding: 0 0.5em;
margin: 0;
font-style: italic;
border-left: 2px solid #ccc;
color: #999;
font-size: 80%;
}
.quotelead {
font-style: italic;
margin-bottom: -1em;
color: #999;
font-size: 80%;
}
.quotechar { display: none; }
.footnote-ref, .footnote-back { text-decoration: none;}
.signature {
color: #999;
font-family: monospace;
white-space: pre;
margin: 1em 0 0 0;
font-size: 80%;
}
table, th, td {
border-collapse: collapse;
border: 1px solid #999;
}
th, td { padding: 0.5em; }
.header {
background: #eee;
}
.even { background: #eee; }
'''
STYLESHEET = os.path.join(os.path.expanduser('~/.mutt'),
'markdown2html.css')
if os.path.exists(STYLESHEET):
DEFAULT_CSS += open(STYLESHEET).read()
HTML_DOCUMENT = '''<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
<title>HTML E-Mail</title>
</head><body class="email">
{htmlbody}
</body></html>'''
SIGNATURE_HTML = \
'<div class="signature"><span class="leader">-- </span>{sig}</div>'
def _preprocess_markdown(mdwn):
'''
Preprocess Markdown for handling by the converter.
'''
# convert hard line breaks within paragraphs to 2 trailing spaces, which
# is the markdown way of representing hard line breaks. Note how the
# regexp will not match between paragraphs.
ret = re.sub(r'(\S)\n(\s*\S)', r'\g<1> \n\g<2>', mdwn, flags=re.MULTILINE)
# Clients like Thunderbird need the leading '>' to be able to properly
# create nested quotes, so we duplicate the symbol, the first instance
# will tell pandoc to create a blockquote, while the second instance will
# be a <span> containing the character, along with a class that causes CSS
# to actually hide it from display. However, this does not work with the
# text-mode HTML2text converters, and so it's left commented for now.
#ret = re.sub(r'\n>', r' \n>[>]{.quotechar}', ret, flags=re.MULTILINE)
return ret
def _identify_quotes_for_later(mdwn):
'''
Email quoting such as:
```
On 1970-01-01, you said:
> The Flat Earth Society has members all around the globe.
```
isn't really properly handled by Markdown, so let's do our best to
identify the individual elements, and mark them, using a syntax similar to
what pandoc uses already in some cases. As pandoc won't actually use these
data (yet?), we call `self._reformat_quotes` later to use these markers
to slap the appropriate classes on the HTML tags.
'''
def generate_lines_with_context(mdwn):
'''
Iterates the input string line-wise, returning a triplet of
previous, current, and next line, the first and last of which
will be None on the first and last line of the input data
respectively.
'''
prev = cur = nxt = None
lines = iter(mdwn.splitlines())
cur = next(lines)
for nxt in lines:
yield prev, cur, nxt
prev = cur
cur = nxt
yield prev, cur, None
ret = []
for prev, cur, nxt in generate_lines_with_context(mdwn):
# The lead-in to a quote is a single line immediately preceding the
# quote, and ending with ':'. Note that there could be multiple of
# these:
if nxt is not None and re.match(r'^\s*[^>].+:\s*$', cur) and nxt.startswith('>'):
ret.append(f'{{.quotelead}}{cur.strip()}')
# pandoc needs an empty line before the blockquote, so
# we enter one for the purpose of HTML rendition:
ret.append('')
continue
# The first blockquote after such a lead-in gets marked as the
# "initial" quote:
elif prev is not None and re.match(r'^\s*[^>].+:\s*$', prev) and cur.startswith('>'):
ret.append(re.sub(r'^(\s*>\s*)+(.+)',
r'\g<1>{.quoteinitial}\g<2>',
cur, flags=re.MULTILINE))
# All other occurrences of blockquotes get the "subsequent" marker:
elif cur.startswith('>') and prev is not None and not prev.startswith('>'):
ret.append(re.sub(r'^((?:\s*>\s*)+)(.+)',
r'\g<1>{.quotesubsequent}\g<2>',
cur, flags=re.MULTILINE))
else: # pass through everything else.
ret.append(cur)
return '\n'.join(ret)
def _reformat_quotes(html):
'''
Earlier in the pipeline, we marked email quoting, using markers, which we
now need to turn into HTML classes, so that we can use CSS to style them.
'''
ret = html.replace('{.quotelead}', '<p class="quotelead">')
ret = re.sub(r'<blockquote>\n((?:<blockquote>\n)*)<p>(?:\{\.quote(\w+)\})',
r'<blockquote class="quote \g<2>">\n\g<1><p>', ret, flags=re.MULTILINE)
return ret
def _convert_with_pandoc(mdwn, inputfmt='markdown', outputfmt='html5',
ext_enabled=None, ext_disabled=None,
standalone=True, title="HTML E-Mail"):
'''
Invoke pandoc to do the actual conversion of Markdown to HTML5.
'''
if not ext_enabled:
ext_enabled = [ 'backtick_code_blocks',
'line_blocks',
'fancy_lists',
'startnum',
'definition_lists',
'example_lists',
'table_captions',
'simple_tables',
'multiline_tables',
'grid_tables',
'pipe_tables',
'all_symbols_escapable',
'intraword_underscores',
'strikeout',
'superscript',
'subscript',
'fenced_divs',
'bracketed_spans',
'footnotes',
'inline_notes',
'emoji',
'tex_math_double_backslash',
'autolink_bare_uris'
]
if not ext_disabled:
ext_disabled = [ 'tex_math_single_backslash',
'tex_math_dollars',
'smart',
'raw_html'
]
enabled = '+'.join(ext_enabled)
disabled = '-'.join(ext_disabled)
inputfmt = f'{inputfmt}+{enabled}-{disabled}'
args = []
if standalone:
args.append('--standalone')
if title:
args.append(f'--metadata=pagetitle:"{title}"')
return pypandoc.convert_text(mdwn, format=inputfmt, to=outputfmt,
extra_args=args)
def _apply_styling(html):
'''
Inline all styles defined and used into the individual HTML tags.
'''
return pynliner.Pynliner().from_string(html).with_cssString(DEFAULT_CSS).run()
def _postprocess_html(html):
'''
Postprocess the generated and styled HTML.
'''
return html
def convert_markdown_to_html(mdwn):
'''
Converts the input Markdown to HTML, handling separately the body, as well
as an optional signature.
'''
parts = re.split(r'^-- $', mdwn, 1, flags=re.MULTILINE)
body = parts[0]
if len(parts) == 2:
sig = parts[1]
else:
sig = None
html=''
if body:
body = _preprocess_markdown(body)
body = _identify_quotes_for_later(body)
html = _convert_with_pandoc(body, standalone=False)
html = _reformat_quotes(html)
if sig:
sig = _preprocess_markdown(sig)
html += SIGNATURE_HTML.format(sig='<br/>'.join(sig.splitlines()))
html = HTML_DOCUMENT.format(htmlbody=html)
html = _apply_styling(html)
html = _postprocess_html(html)
return html
def main():
'''
Convert text on stdin to HTML, and print it to stdout, like mutt would
expect.
'''
html = convert_markdown_to_html(sys.stdin.read())
if html:
# mutt expects the content type in the first line, so:
print(f'text/html\n\n{html}')
if __name__ == '__main__':
main()

View file

@ -0,0 +1,421 @@
#!/usr/bin/env python3
#
# Mutt OAuth2 token management script, version 2020-08-07
# Written against python 3.7.3, not tried with earlier python versions.
#
# Copyright (C) 2020 Alexander Perlis
#
# 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.
'''Mutt OAuth2 token management'''
import sys
import json
import argparse
import urllib.parse
import urllib.request
import imaplib
import poplib
import smtplib
import base64
import secrets
import hashlib
import time
from datetime import timedelta, datetime
from pathlib import Path
import socket
import http.server
import subprocess
import readline
# The token file must be encrypted because it contains multi-use bearer tokens
# whose usage does not require additional verification. Specify whichever
# encryption and decryption pipes you prefer. They should read from standard
# input and write to standard output. The example values here invoke GPG,
# although won't work until an appropriate identity appears in the first line.
ENCRYPTION_PIPE = ['gpg', '--encrypt', '--recipient', 'YOUR_GPG_IDENTITY']
DECRYPTION_PIPE = ['gpg', '--decrypt']
registrations = {
'google': {
'authorize_endpoint': 'https://accounts.google.com/o/oauth2/auth',
'devicecode_endpoint': 'https://oauth2.googleapis.com/device/code',
'token_endpoint': 'https://accounts.google.com/o/oauth2/token',
'redirect_uri': 'urn:ietf:wg:oauth:2.0:oob',
'imap_endpoint': 'imap.gmail.com',
'pop_endpoint': 'pop.gmail.com',
'smtp_endpoint': 'smtp.gmail.com',
'sasl_method': 'OAUTHBEARER',
'scope': 'https://mail.google.com/',
'client_id': '',
'client_secret': '',
},
'microsoft': {
'authorize_endpoint': 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
'devicecode_endpoint': 'https://login.microsoftonline.com/common/oauth2/v2.0/devicecode',
'token_endpoint': 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
'redirect_uri': 'https://login.microsoftonline.com/common/oauth2/nativeclient',
'tenant': 'common',
'imap_endpoint': 'outlook.office365.com',
'pop_endpoint': 'outlook.office365.com',
'smtp_endpoint': 'smtp.office365.com',
'sasl_method': 'XOAUTH2',
'scope': ('offline_access https://outlook.office.com/IMAP.AccessAsUser.All '
'https://outlook.office.com/POP.AccessAsUser.All '
'https://outlook.office.com/SMTP.Send'),
'client_id': '',
'client_secret': '',
},
}
ap = argparse.ArgumentParser(epilog='''
This script obtains and prints a valid OAuth2 access token. State is maintained in an
encrypted TOKENFILE. Run with "--verbose --authorize" to get started or whenever all
tokens have expired, optionally with "--authflow" to override the default authorization
flow. To truly start over from scratch, first delete TOKENFILE. Use "--verbose --test"
to test the IMAP/POP/SMTP endpoints.
''')
ap.add_argument('-v', '--verbose', action='store_true', help='increase verbosity')
ap.add_argument('-d', '--debug', action='store_true', help='enable debug output')
ap.add_argument('tokenfile', help='persistent token storage')
ap.add_argument('-a', '--authorize', action='store_true', help='manually authorize new tokens')
ap.add_argument('--authflow', help='authcode | localhostauthcode | devicecode')
ap.add_argument('-t', '--test', action='store_true', help='test IMAP/POP/SMTP endpoints')
args = ap.parse_args()
token = {}
path = Path(args.tokenfile)
if path.exists():
if 0o777 & path.stat().st_mode != 0o600:
sys.exit('Token file has unsafe mode. Suggest deleting and starting over.')
try:
sub = subprocess.run(DECRYPTION_PIPE, check=True, input=path.read_bytes(),
capture_output=True)
token = json.loads(sub.stdout)
except subprocess.CalledProcessError:
sys.exit('Difficulty decrypting token file. Is your decryption agent primed for '
'non-interactive usage, or an appropriate environment variable such as '
'GPG_TTY set to allow interactive agent usage from inside a pipe?')
def writetokenfile():
'''Writes global token dictionary into token file.'''
if not path.exists():
path.touch(mode=0o600)
if 0o777 & path.stat().st_mode != 0o600:
sys.exit('Token file has unsafe mode. Suggest deleting and starting over.')
sub2 = subprocess.run(ENCRYPTION_PIPE, check=True, input=json.dumps(token).encode(),
capture_output=True)
path.write_bytes(sub2.stdout)
if args.debug:
print('Obtained from token file:', json.dumps(token))
if not token:
if not args.authorize:
sys.exit('You must run script with "--authorize" at least once.')
print('Available app and endpoint registrations:', *registrations)
token['registration'] = input('OAuth2 registration: ')
token['authflow'] = input('Preferred OAuth2 flow ("authcode" or "localhostauthcode" '
'or "devicecode"): ')
token['email'] = input('Account e-mail address: ')
token['access_token'] = ''
token['access_token_expiration'] = ''
token['refresh_token'] = ''
writetokenfile()
if token['registration'] not in registrations:
sys.exit(f'ERROR: Unknown registration "{token["registration"]}". Delete token file '
f'and start over.')
registration = registrations[token['registration']]
authflow = token['authflow']
if args.authflow:
authflow = args.authflow
baseparams = {'client_id': registration['client_id']}
# Microsoft uses 'tenant' but Google does not
if 'tenant' in registration:
baseparams['tenant'] = registration['tenant']
def access_token_valid():
'''Returns True when stored access token exists and is still valid at this time.'''
token_exp = token['access_token_expiration']
return token_exp and datetime.now() < datetime.fromisoformat(token_exp)
def update_tokens(r):
'''Takes a response dictionary, extracts tokens out of it, and updates token file.'''
token['access_token'] = r['access_token']
token['access_token_expiration'] = (datetime.now() +
timedelta(seconds=int(r['expires_in']))).isoformat()
if 'refresh_token' in r:
token['refresh_token'] = r['refresh_token']
writetokenfile()
if args.verbose:
print(f'NOTICE: Obtained new access token, expires {token["access_token_expiration"]}.')
if args.authorize:
p = baseparams.copy()
p['scope'] = registration['scope']
if authflow in ('authcode', 'localhostauthcode'):
verifier = secrets.token_urlsafe(90)
challenge = base64.urlsafe_b64encode(hashlib.sha256(verifier.encode()).digest())[:-1]
redirect_uri = registration['redirect_uri']
listen_port = 0
if authflow == 'localhostauthcode':
# Find an available port to listen on
s = socket.socket()
s.bind(('127.0.0.1', 0))
listen_port = s.getsockname()[1]
s.close()
redirect_uri = 'http://localhost:'+str(listen_port)+'/'
# Probably should edit the port number into the actual redirect URL.
p.update({'login_hint': token['email'],
'response_type': 'code',
'redirect_uri': redirect_uri,
'code_challenge': challenge,
'code_challenge_method': 'S256'})
print(registration["authorize_endpoint"] + '?' +
urllib.parse.urlencode(p, quote_via=urllib.parse.quote))
authcode = ''
if authflow == 'authcode':
authcode = input('Visit displayed URL to retrieve authorization code. Enter '
'code from server (might be in browser address bar): ')
else:
print('Visit displayed URL to authorize this application. Waiting...',
end='', flush=True)
class MyHandler(http.server.BaseHTTPRequestHandler):
'''Handles the browser query resulting from redirect to redirect_uri.'''
# pylint: disable=C0103
def do_HEAD(self):
'''Response to a HEAD requests.'''
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
def do_GET(self):
'''For GET request, extract code parameter from URL.'''
# pylint: disable=W0603
global authcode
querystring = urllib.parse.urlparse(self.path).query
querydict = urllib.parse.parse_qs(querystring)
if 'code' in querydict:
authcode = querydict['code'][0]
self.do_HEAD()
self.wfile.write(b'<html><head><title>Authorizaton result</title></head>')
self.wfile.write(b'<body><p>Authorization redirect completed. You may '
b'close this window.</p></body></html>')
with http.server.HTTPServer(('127.0.0.1', listen_port), MyHandler) as httpd:
try:
httpd.handle_request()
except KeyboardInterrupt:
pass
if not authcode:
sys.exit('Did not obtain an authcode.')
for k in 'response_type', 'login_hint', 'code_challenge', 'code_challenge_method':
del p[k]
p.update({'grant_type': 'authorization_code',
'code': authcode,
'client_secret': registration['client_secret'],
'code_verifier': verifier})
print('Exchanging the authorization code for an access token')
try:
response = urllib.request.urlopen(registration['token_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
print(err.code, err.reason)
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' in response:
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
sys.exit(1)
elif authflow == 'devicecode':
try:
response = urllib.request.urlopen(registration['devicecode_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
print(err.code, err.reason)
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' in response:
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
sys.exit(1)
print(response['message'])
del p['scope']
p.update({'grant_type': 'urn:ietf:params:oauth:grant-type:device_code',
'client_secret': registration['client_secret'],
'device_code': response['device_code']})
interval = int(response['interval'])
print('Polling...', end='', flush=True)
while True:
time.sleep(interval)
print('.', end='', flush=True)
try:
response = urllib.request.urlopen(registration['token_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
# Not actually always an error, might just mean "keep trying..."
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' not in response:
break
if response['error'] == 'authorization_declined':
print(' user declined authorization.')
sys.exit(1)
if response['error'] == 'expired_token':
print(' too much time has elapsed.')
sys.exit(1)
if response['error'] != 'authorization_pending':
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
sys.exit(1)
print()
else:
sys.exit(f'ERROR: Unknown OAuth2 flow "{token["authflow"]}. Delete token file and '
f'start over.')
update_tokens(response)
if not access_token_valid():
if args.verbose:
print('NOTICE: Invalid or expired access token; using refresh token '
'to obtain new access token.')
if not token['refresh_token']:
sys.exit('ERROR: No refresh token. Run script with "--authorize".')
p = baseparams.copy()
p.update({'client_secret': registration['client_secret'],
'refresh_token': token['refresh_token'],
'grant_type': 'refresh_token'})
try:
response = urllib.request.urlopen(registration['token_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
print(err.code, err.reason)
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' in response:
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
print('Perhaps refresh token invalid. Try running once with "--authorize"')
sys.exit(1)
update_tokens(response)
if not access_token_valid():
sys.exit('ERROR: No valid access token. This should not be able to happen.')
if args.verbose:
print('Access Token: ', end='')
print(token['access_token'])
def build_sasl_string(user, host, port, bearer_token):
'''Build appropriate SASL string, which depends on cloud server's supported SASL method.'''
if registration['sasl_method'] == 'OAUTHBEARER':
return f'n,a={user},\1host={host}\1port={port}\1auth=Bearer {bearer_token}\1\1'
if registration['sasl_method'] == 'XOAUTH2':
return f'user={user}\1auth=Bearer {bearer_token}\1\1'
sys.exit(f'Unknown SASL method {registration["sasl_method"]}.')
if args.test:
errors = False
imap_conn = imaplib.IMAP4_SSL(registration['imap_endpoint'])
sasl_string = build_sasl_string(token['email'], registration['imap_endpoint'], 993,
token['access_token'])
if args.debug:
imap_conn.debug = 4
try:
imap_conn.authenticate(registration['sasl_method'], lambda _: sasl_string.encode())
# Microsoft has a bug wherein a mismatch between username and token can still report a
# successful login... (Try a consumer login with the token from a work/school account.)
# Fortunately subsequent commands fail with an error. Thus we follow AUTH with another
# IMAP command before reporting success.
imap_conn.list()
if args.verbose:
print('IMAP authentication succeeded')
except imaplib.IMAP4.error as e:
print('IMAP authentication FAILED (does your account allow IMAP?):', e)
errors = True
pop_conn = poplib.POP3_SSL(registration['pop_endpoint'])
sasl_string = build_sasl_string(token['email'], registration['pop_endpoint'], 995,
token['access_token'])
if args.debug:
pop_conn.set_debuglevel(2)
try:
# poplib doesn't have an auth command taking an authenticator object
# Microsoft requires a two-line SASL for POP
# pylint: disable=W0212
pop_conn._shortcmd('AUTH ' + registration['sasl_method'])
pop_conn._shortcmd(base64.standard_b64encode(sasl_string.encode()).decode())
if args.verbose:
print('POP authentication succeeded')
except poplib.error_proto as e:
print('POP authentication FAILED (does your account allow POP?):', e.args[0].decode())
errors = True
# SMTP_SSL would be simpler but Microsoft does not answer on port 465.
smtp_conn = smtplib.SMTP(registration['smtp_endpoint'], 587)
sasl_string = build_sasl_string(token['email'], registration['smtp_endpoint'], 587,
token['access_token'])
smtp_conn.ehlo('test')
smtp_conn.starttls()
smtp_conn.ehlo('test')
if args.debug:
smtp_conn.set_debuglevel(2)
try:
smtp_conn.auth(registration['sasl_method'], lambda _=None: sasl_string)
if args.verbose:
print('SMTP authentication succeeded')
except smtplib.SMTPAuthenticationError as e:
print('SMTP authentication FAILED:', e)
errors = True
if errors:
sys.exit(1)

View file

@ -0,0 +1,290 @@
mutt_oauth.py README by Alexander Perlis, 2020-07-15
====================================================
Background on plain passwords, app passwords, OAuth2 bearer tokens
------------------------------------------------------------------
An auth stage occurs near the start of the IMAP/POP/SMTP protocol
conversation. Various SASL methods can be used (depends on what the
server offers, and what the client supports). The PLAIN method, also
known as "basic auth", involves simply sending the username and
password (this occurs over an encrypted connection), and used to be
common; but, for large cloud mail providers, basic auth is a security
hole. User passwords often have low entropy (humans generally choose
passwords that can be produced from human memory), thus are targets
for various types of exhaustive attacks. Older attacks try different
passwords against one user, whereas newer spray attacks try one
password against different users. General mitigation efforts such as
rate-limiting, or detection and outright blocking efforts, lead to
degraded or outright denied services for legitimate users. The
security weakness is two-fold: the low entropy of the user password,
together with the alarming consequence that the password often unlocks
many disparate systems in a typical enterprise single-sign-on
environment. Also, humans type passwords or copy/paste them from
elsewhere on the screen, so they can also be grabbed via keyloggers or
screen capture (or a human bystander). Two ways to solve these
conundrums:
- app passwords
- bearer tokens
App passwords are simply high-entropy protocol-specific passwords, in
other words a long computer-generated random string, you use one for
your mail system, a different one for your payroll system, and so
on. With app passwords in use, brute-force attacks become useless. App
passwords require no modifications to client software, and only minor
changes on the server side. One way to think about app passwords is
that they essentially impose on you the use of a password manager. Any
user can go to the trouble of using a password manager but most users
don't bother. App passwords put the password manager inside the server
and force you to use it.
Bearer tokens take the idea of app passwords to the next level. Much
like app passwords, they too are just long computer-generated random
strings, knowledge of which simply "lets you in". But unlike an app
password which the user must manually copy from a server password
screen and then paste into their client account config screen (a
process the user doesn't want to follow too often), bearer tokens get
swapped out approximately once an hour without user interaction. For
this to work, both clients and servers must be modified to speak a
separate out-of-band protocol (the "OAuth2" protocol) to swap out
tokens. More precisely, from start to finish, the process goes like
this: the client and server must once-and-for-all be informed about
each other (this is called "app registration" and might be done by the
client developer or left to each end user), then the client informs
the server that it wants to connect, then the user is informed to
independently use a web browser to visit a server destination to
approve this request (at this stage the server will require the user
to authenticate using say their password and perhaps additional
factors such as an SMS verification or crypto device), then the client
will have a long-term "refresh token" as well as an "access token"
good for about an hour. The access token can now be used with
IMAP/POP/SMTP to access the account. When it expires, the refresh
token is used to get a new access token and perhaps a new refresh
token. After several months of such usage, even the refresh token may
expire and the human user will have to go back and re-authenticate
(password, SMS, crypto device, etc) for things to start anew.
Since app passwords and tokens are high-entropy and their compromise
should compromise only a particular system (rather than all systems in
a single-sign-on environment), they have similar security strength
when compared to stark weakness of traditional human passwords. But if
compared only to each other, tokens provide more security. App
passwords must be short enough for humans to easily copy/paste them,
might get written down or snooped during that process, and anyhow are
long-lived and thus could get compromised by other means. The main
drawback to tokens is that their support requires significant changes
to clients and servers, but once such support exists, they are
superior and easier to use.
Many cloud providers are eliminating support for human passwords. Some are
allowing app passwords in addition to tokens. Some allow only tokens.
OAuth2 token support in mutt
----------------------------
Mutt supports the two SASL methods OAUTHBEARER and XOAUTH2 for presenting an
OAuth2 access token near the start of the IMAP/POP/SMTP connection.
(Two different SASL methods exist for historical reasons. While OAuth2
was under development, the experimental offering by servers was called
XOAUTH2, later fleshed out into a standard named OAUTHBEARER, but not
all servers have been updated to offer OAUTHBEARER. Once the major
cloud providers all support OAUTHBEARER, clients like mutt might be
modified to no longer know about XOAUTH2.)
Mutt can present a token inside IMAP/POP/SMTP, but by design mutt itself
does not know how to have a separate conversation (outside of IMAP/POP/SMTP)
with the server to authorize the user and obtain refresh and access tokens.
Mutt just needs an access token, and has a hook for an external script to
somehow obtain one.
mutt_oauth2.py is an example of such an external script. It likely can be
adapted to work with OAuth2 on many different cloud mail providers, and has
been tested against:
- Google consumer account (@gmail.com)
- Google work/school account (G Suite tenant)
- Microsoft consumer account (e.g., @live.com, @outlook.com, ...)
- Microsoft work/school account (Azure tenant)
(Note that Microsoft uses the marketing term "Modern Auth" in lieu of
"OAuth2". In that terminology, mutt indeed supports "Modern Auth".)
Configure script's token file encryption
----------------------------------------
The script remembers tokens between invocations by keeping them in a
token file. This file is encrypted. Inside the script are two lines
ENCRYPTION_PIPE
DECRYPTION_PIPE
that must be edited to specify your choice of encryption system. A
popular choice is gpg. To use this:
- Install gpg. For example, "sudo apt install gpg".
- "gpg --gen-key". Answer the questions. Instead of your email
address you could choose say "My mutt_oauth2 token store", then
choose a passphrase. You will need to produce that same passphrase
whenever mutt_oauth2 needs to unlock the token store.
- Edit mutt_oauth2.py and put your GPG identity (your email address or
whatever you picked above) in the ENCRYPTION_PIPE line.
- For the gpg-agent to be able to ask you the unlock passphrase,
the environment variable GPG_TTY must be set to the current tty.
Typically you would put the following inside your .bashrc or equivalent:
export GPG_TTY=$(tty)
Create an app registration
--------------------------
Before you can connect the script to an account, you need an
"app registration" for that service. Cloud entities (like Google and
Microsoft) and/or the tenant admins (the central technology admins at
your school or place of work) might be restrictive in who can create
app registrations, as well as who can subsequently use them. For
personal/consumer accounts, you can generally create your own
registration and then use it with a limited number of different personal
accounts. But for work/school accounts, the tenant admins might approve an
app registration that you created with a personal/consumer account, or
might want an official app registration from a developer (the creation of
which and blessing by the cloud provider might require payment and/or arduous
review), or might perhaps be willing to roll their own "in-house" registration.
What you ultimately need is the "client_id" (and "client_secret" if
one was set) for this registration. Those values must be edited into
the mutt_oauth2.py script. If your work or school environment has a
knowledge base that provides the client_id, then someone already took
care of the app registration, and you can skip the step of creating
your own registration.
-- How to create a Google registration --
Go to console.developers.google.com, and create a new project. The name doesn't
matter and could be "mutt registration project".
- Go to Library, choose Gmail API, and enable it
- Hit left arrow icon to get back to console.developers.google.com
- Choose OAuth Consent Screen
- Choose Internal for an organizational G Suite
- Choose External if that's your only choice
- For Application Name, put for example "Mutt"
- Under scopes, choose Add scope, scroll all the way down, enable the "https://mail.google.com/" scope
- Fill out additional fields (application logo, etc) if you feel like it (will make the consent screen look nicer)
- Back at console.developers.google.com, choose Credentials
- At top, choose Create Credentials / OAuth2 client iD
- Application type is "Desktop app"
Edit the client_id (and client_secret if there is one) into the
mutt_oauth2.py script.
-- How to create a Microsoft registration --
Go to portal.azure.com, log in with a Microsoft account (get a free
one at outlook.com), then search for "app registration", and add a
new registration. On the initial form that appears, put a name like
"Mutt", allow any type of account, and put "http://localhost/" as
the redirect URI, then more carefully go through each
screen:
Branding
- Leave fields blank or put in reasonable values
- For official registration, verify your choice of publisher domain
Authentication:
- Platform "Mobile and desktop"
- Redirect URI "http://localhost/"
- Any kind of account
- Enable public client (allow device code flow)
API permissions:
- Microsoft Graph, Delegated, "offline_access"
- Microsoft Graph, Delegated, "IMAP.AccessAsUser.All"
- Microsoft Graph, Delegated, "POP.AccessAsUser.All"
- Microsoft Graph, Delegated, "SMTP.Send"
- Microsoft Graph, Delegated, "User.Read"
Overview:
- Take note of the Application ID (a.k.a. Client ID), you'll need it shortly
End users who aren't able to get to the app registration screen within
portal.azure.com for their work/school account can temporarily use an
incognito browser window to create a free outlook.com account and use that
to create the app registration.
Edit the client_id (and client_secret if there is one) into the
mutt_oauth2.py script.
Running the script manually to authorize tokens
-----------------------------------------------
Run "mutt_oauth2.py --help" to learn script usage. To obtain the
initial set of tokens, run the script specifying a name for a
disposable token storage file, as well as "--authorize", for example
using this naming scheme:
mutt_oauth2.py userid@myschool.edu.tokens --verbose --authorize
The script will ask questions and provide some instructions. For the
flow question:
- "authcode": you paste a complicated URL into a browser, then
manually extract a "code" parameter from a subsequent URL in the
browser address bar and paste that back to the script.
- "localhostauthcode": you again paste the complicated URL into a browser
but that's it --- the code is automatically extracted from the response
relying on a localhost redirect and temporarily listening on a localhost
port. This flow can only be used if the web browser opening the redirect
URL sits on the same machine as where mutt is running, in other words can not
be used if you ssh to a remote machine and run mutt on that remote machine
while your web browser remains on your local machine.
- "devicecode": you go to a simple URL and just enter a short code.
Your answer here determines the default flow, but on any invocation of
the script you can override the default with the optional "--authflow"
parameter. To change the default, delete your token file and start over.
To figure out which flow to use, I suggest trying all three.
Depending on the OAuth2 provider and how the app registration was
configured, some flows might not work, so simply trying them is the
best way to figure out what works and which one you prefer. Personally
I prefer the "localhostauthcode" flow when I can use it.
Once you attempt an actual authorization, you might get stuck because
the web browser step might indicate your institution admins must grant
approval. Indeed engage them in a conversation about approving the
use of mutt to access mail. If that fails, an alternative is to
identify some other well-known IMAP/POP/SMTP client that they might
have already approved, or might be willing to approve, and first go
configure it for OAuth2 and see whether it will work to reach your
mail, and then you could dig into the source code for that client and
extract its client_id, client_secret, and redirect_uri and put those
into the mutt_oauth2.py script. This would be a temporary punt for
end-user experimentation, but not an approach for configuring systems
to be used by other people. Engaging your institution admins to create
a mutt registration is the better way to go.
Once you've succeeded authorizing mutt_oauth2.py to obtain tokens, try
one of the following to see whether IMAP/POP/SMTP are working:
mutt_oauth2.py userid@myschool.edu.tokens --verbose --test
mutt_oauth2.py userid@myschool.edu.tokens --verbose --debug --test
Without optional parameters, the script simply returns an access token
(possibly first conducting a behind-the-scenes URL retrieval using a
stored refresh token to obtain an updated access token). Calling the
script without optional parameters is how it will be used by
mutt. Your .muttrc would look something like:
set imap_user="userid@myschool.edu"
set folder="imap://outlook.office365.com/"
set smtp_url="smtp://${imap_user}@smtp.office365.com:587/"
set imap_authenticators="oauthbearer:xoauth2"
set imap_oauth_refresh_command="/path/to/script/mutt_oauth2.py ${imap_user}.tokens"
set smtp_authenticators=${imap_authenticators}
set smtp_oauth_refresh_command=${imap_oauth_refresh_command}

View file

@ -0,0 +1,9 @@
#!/bin/sh
# Demonstration of format string pipes. Sets the xterm title and returns the
# string unchanged.
#
# Example usage:
# set status_format="mutt_xtitle '%r %f (%L) [Msgs:%?M?%M/?%m%?n? New:%n?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?]'|"
printf "\033]0;$1\007" > /dev/tty
echo "$1"

View file

@ -0,0 +1,51 @@
# -*-muttrc-*-
#
# PGP command formats for PGP 2.
#
# $Id$
#
#
# Note: In order to be able to read your own messages, you'll have
# the +encrypttoself command line parameter to the pgp_encrypt_only_command
# and pgp_encrypt_sign_command variables.
#
# decode application/pgp
set pgp_decode_command="%?p?PGPPASSFD=0; export PGPPASSFD;? cat %?p?-? %f | pgp +language=mutt +verbose=0 +batchmode -f"
# verify a pgp/mime signature
set pgp_verify_command="pgp +language=mutt +verbose=0 +batchmode -t %s %f"
# decrypt a pgp/mime attachment
set pgp_decrypt_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp +language=mutt +verbose=0 +batchmode -f"
# don't check for GnuPG decryption status codes
unset pgp_check_gpg_decrypt_status_fd
# create a pgp/mime signed attachment
set pgp_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp +language=mutt +verbose=0 +batchmode -abfst %?a? -u %a?"
# create a pgp/mime encrypted attachment
set pgp_encrypt_only_command="pgp +language=mutt +verbose=0 +batchmode -aeft %r < %f"
# create a pgp/mime encrypted and signed attachment
set pgp_encrypt_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp +language=mutt +verbose=0 +batchmode -aefts %?a?-u %a? %r"
# import a key into the public key ring
set pgp_import_command="pgp -ka %f +language=mutt"
# export a key from the public key ring
set pgp_export_command="pgp -kxaf +language=mutt %r"
# verify a key
set pgp_verify_key_command="pgp -kcc +language=mutt %r"
# read in the public key ring
set pgp_list_pubring_command="mutt_pgpring -2 %r"
# read in the secret key ring
set pgp_list_secring_command="mutt_pgpring -s -2 %r"
# pattern for good signature
set pgp_good_sign="Good signature"

View file

@ -0,0 +1,47 @@
# -*-muttrc-*-
#
# PGP command formats for PGP 5.
#
# $Id$
#
# decode application/pgp
set pgp_decode_command="%?p?PGPPASSFD=0; export PGPPASSFD;? cat %?p?-? %f | pgpv +language=mutt +verbose=0 +batchmode -f --OutputInformationFD=0"
# verify a pgp/mime signature
set pgp_verify_command="pgpv +language=mutt +verbose=0 +batchmode --OutputInformationFD=1 %f %s"
# string that the verify command outputs if the signature is good
set pgp_good_sign = "Good signature"
# decrypt a pgp/mime attachment
set pgp_decrypt_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgpv +language=mutt +verbose=0 +batchmode --OutputInformationFD=2 -f"
# don't check for GnuPG decryption status codes
unset pgp_check_gpg_decrypt_status_fd
# create a pgp/mime signed attachment
set pgp_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgps +language=mutt +verbose=0 +batchmode -abft %?a? -u %a?"
# create a pgp/mime encrypted attachment
set pgp_encrypt_only_command="pgpewrap pgpe +language=mutt +verbose=0 +batchmode +nobatchinvalidkeys=off -aft -- -r %r < %f"
# create a pgp/mime encrypted and signed attachment
set pgp_encrypt_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgpewrap pgpe +language=mutt +verbose=0 +batchmode +nobatchinvalidkeys=off -afts %?a? -u %a? -- -r %r"
# import a key into the public key ring
set pgp_import_command="pgpk -a +language=mutt --OutputInformationFD=1 %f"
# export a key from the public key ring
set pgp_export_command="pgpk -xa +language=mutt --OutputInformationFD=1 %r"
# verify a key
set pgp_verify_key_command="pgpk -c +batchmode +language=mutt --OutputInformationFD=1 %r"
# read in the public key ring
set pgp_list_pubring_command="mutt_pgpring -5 %r"
# read in the secret key ring
set pgp_list_secring_command="mutt_pgpring -5 -s %r"

View file

@ -0,0 +1,48 @@
# -*-muttrc-*-
#
# PGP command formats for PGP 6.
#
# $Id$
#
# decode application/pgp
set pgp_decode_command="%?p?PGPPASSFD=0; export PGPPASSFD;? cat %?p?-? %f | pgp6 +compatible +verbose=0 +batchmode -f"
# verify a pgp/mime signature
set pgp_verify_command="pgp6 +compatible +verbose=0 +batchmode -t %s %f"
# decrypt a pgp/mime attachment
set pgp_decrypt_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp6 +compatible +verbose=0 +batchmode -f"
# don't check for GnuPG decryption status codes
unset pgp_check_gpg_decrypt_status_fd
# create a pgp/mime signed attachment
set pgp_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp6 +compatible +verbose=0 +batchmode -abfst %?a? -u %a?"
# create a pgp/mime encrypted attachment
set pgp_encrypt_only_command="pgp6 +compatible +verbose=0 +encrypttoself +batchmode -aeft %r < %f"
# create a pgp/mime encrypted and signed attachment
set pgp_encrypt_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp6 +compatible +verbose=0 +encrypttoself +batchmode +clearsig=off -aefts %?a? -u %a? %r"
# import a key into the public key ring
set pgp_import_command="pgp6 +compatible -ka %f "
# export a key from the public key ring
set pgp_export_command="pgp6 +compatible -kxaf %r"
# verify a key
set pgp_verify_key_command="pgp6 +compatible -kcc %r"
# read in the public key ring
set pgp_list_pubring_command="mutt_pgpring -5 %r"
# read in the secret key ring
set pgp_list_secring_command="mutt_pgpring -s -5 %r"
# create a clearsigned message
set pgp_clearsign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f | pgp6 +compatible +verbose=0 +batchmode +clearsig -afst %?a? -u %a?"
# fetch keys
set pgp_getkeys_command="pkspxycwrap %r"

View file

@ -0,0 +1,6 @@
# $Id$
text/html; netscape -remote openURL\(%s\)
image/gif; xv %s
image/jpg; xv %s
application/pgp-keys; pgp -f < %s ; copiousoutput

View file

@ -0,0 +1,340 @@
# $Id$
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# ME's personal .muttrc (Mutt 0.92.5)
#
# The format of this file is one command per line. Everything after a pound
# sign (#) is a comment, unless a backward slash (\) precedes it. Note: In
# folder-hook and send-hook you need to account for two levels of dequoting
# (see manual).
#
# Note: $folder should be set _before_ any other path vars where `+' or `='
# is used because paths are expanded when parsed
#
#set folder=~/Mail # where i keep my mailboxes
#set abort_unmodified=yes # automatically abort replies if I don't
# change the message
set alias_file=~/.mail_aliases # where I keep my aliases
#set allow_8bit # never do Q-P encoding on legal 8-bit chars
set arrow_cursor # use -> instead of hiliting the whole line
#set ascii_chars # use ASCII instead of ACS chars for threads
#set askbcc
#set askcc
#set attribution="On %d, %n wrote:" # how to attribute replies
set autoedit # go to the editor right away when composing
#set auto_tag # always operate on tagged messages
#set charset="iso-8859-1" # character set for your terminal
set noconfirmappend # don't ask me if i want to append to mailboxes
#set confirmcreate # prompt when creating new files
set copy=yes # always save a copy of outgoing messages
set delete=yes # purge deleted messages without asking
set edit_headers # let me edit the message header when composing
#set editor="emacs -nw" # editor to use when composing messages
#set bounce=yes # don't ask about bouncing messages, just do it
#set fast_reply # skip initial prompts when replying
#set fcc_attach # keep attachments in copies of sent messages?
#set force_name # fcc by recipient, create if mailbox doesn't exist
#set forward_decode # weed and MIME decode forwarded messages
#set forward_format="[%a: %s]" # subject to use when forwarding messages
#set forward_quote # quote the header and body of forward msgs
#set index_format="%4C %Z %{%m/%d} [%2N] %-15.15F (%4c) %s"
set index_format="%4C %Z %{%m/%d} %-15.15F (%4c) %s" # format of the index
#set hdrs # include `my_hdr' lines in outgoing messages
#set header # include message header when replying
set help # show the help lines
#set history=20 # number of lines of history to remember
#set hostname="mutt.org" # my DNS domain
set include # always include messages when replying
#set indent_string="> " # how to quote replied text
#set locale="C" # locale to use for printing time
#set mailcap_path="~/.mailcap:/usr/local/share/mailcap"
set nomark_old # i don't care about whether a message is old
set mail_check=10 # how often to poll for new mail
set mbox=+mbox # where to store read messages
#set menu_scroll # no implicit next-page/prev-page
#set metoo # remove my address when replying
set mime_forward # use message/rfc822 type to forward messages
set move=yes # don't ask about moving messages, just do it
#set pager=less # some people prefer an external pager
#set pager_context=3 # no. of lines of context to give when scrolling
#set pager_format="-%S- %-20.20f %s" # format of the pager status bar
set pager_index_lines=6 # how many index lines to show in the pager
#set pager_stop # don't move to the next message on next-page
#set pgp_strict_enc # use Q-P encoding when needed for PGP
set postponed=+postponed # mailbox to store postponed messages in
#set post_indent_string='---end quoted text---'
#set print=ask-yes # ask me if I really want to print messages
set print_command=/bin/false # how to print things (I like to save trees)
set noprompt_after # ask me for a command after the external pager exits
#set quote_regexp="^ *[a-zA-Z]*[>:#}]" # how to catch quoted text
set read_inc=25 # show progress when reading a mailbox
#set recall # prompt to recall postponed messages
set record=+outbox # default location to save outgoing mail
set reply_to # always use reply-to if present
#set reply_regexp="^(re:[ \t]*)+"# how to identify replies in the subject:
#set resolve # move to the next message when an action is performed
#set reverse_alias # attempt to look up my names for people
set reverse_name # use my address as it appears in the message
# i am replying to
set nosave_empty # remove files when no messages are left
#set save_name # save outgoing messages by recipient, if the
#set sendmail="/usr/lib/sendmail -oi -oem" # how to deliver mail
#set shell="/bin/zsh" # program to use for shell escapes
#set signature="~/.signature" # file which contains my signature
# I subscribe to a lot of mailing lists, so this is _very_ useful. This
# groups messages on the same subject to make it easier to follow a
# discussion. Mutt will draw a nice tree showing how the discussion flows.
set sort=threads # primary sorting method
#set sort_aux=reverse-date-received # how to sort subthreads
#set sort_aux=last-date # date of the last message in thread
set sort_browser=reverse-date # how to sort files in the dir browser
set spoolfile='~/mailbox' # where my new mail is located
#set status_format="-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b? %l]---(%s)-%>-(%P)---"
#set status_on_top # some people prefer the status bar on top
#set strict_threads # don't thread by subject
set tilde # virtual lines to pad blank lines in the pager
#set timeout=0 # timeout for prompt in the index menu
#set tmpdir=~/tmp # where to store temp files
#set to_chars=" +TCF"
#set use_8bitmime # enable the -B8BITMIME sendmail flag
set nouse_domain # don't qualify local addresses with $domain
#set use_from # always generate the `From:' header field
set implicit_autoview=yes # pager shows parts having a mailcap viewer
set pgp_verify_sig=no # don't automatically verify message signatures
#set visual=vim # editor invoked by ~v in the builtin editor
#set nowait_key # prompt when a pipe returns normal status
set write_inc=25 # show progress while writing mailboxes
# only enable the following IFF you have sendmail 8.8.x or you will not
# be able to send mail!!!
#set dsn_notify='failure,delay' # when to return an error message
#set dsn_return=hdrs # what to return in the error message
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Header fields I don't normally want to see
#
ignore * # this means "ignore all lines by default"
# I do want to see these fields, though!
unignore from: subject to cc mail-followup-to \
date x-mailer x-url # this shows how nicely wrap long lines
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Color definitions
#
#color normal white default
color hdrdefault red default
color quoted brightblue default
color signature red default
color indicator brightyellow red
color error brightred default
color status yellow blue
color tree magenta default # the thread tree in the index menu
color tilde magenta default
color message brightcyan default
color markers brightcyan default
color attachment brightmagenta default
color search default green # how to hilite search patterns in the pager
color header brightred default ^(From|Subject):
color body magenta default "(ftp|http|https)://[^ ]+" # point out URLs
color body magenta default [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses
color underline brightgreen default
# attributes when using a mono terminal
#mono header underline ^(From|Subject):
mono quoted bold
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Key bindings
#
# maps:
# alias alias menu
# attach attachment menu
# browser directory browser
# compose compose menu
# index message index
# pgp pgp menu
# postpone postponed message recall menu
# generic generic keymap for all of the above
# editor line editor
# pager text viewer
#
bind generic "\e<" first-entry # emacs-like bindings for moving to top/bottom
bind generic \e> last-entry
bind generic { top-page
bind generic } bottom-page
bind generic \177 last-entry
macro index \cb "<pipe-message> urlview<Enter>" # simulate the old browse-url function
macro index S "<save-message>+spam<Enter>"
macro pager S "<save-message>+spam<Enter>"
#macro index \# "<search>bug<Enter>" # search for bugs
#macro index "\"" "<enter-command> set realname=\"real hairy macro\" ?realname<Enter>" # and a comment to boot!
#macro index f1 "<enter-command>woohoo!"
bind pager G bottom # just like vi and less
#macro pager \Ck "<pipe-message> pgp -kaf<Enter>" # a comment is valid here
#macro pager X "<pipe-message> morepgp<Enter>" # pipe PGP message to a script
#bind editor \cy eol # make ^Y jump to the end of the line
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# User Defined Headers
#
#my_hdr X-Useless-Header: Look ma, it's a \# sign! # real comment
#my_hdr X-Operating-System: `uname -a`
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Specify default filename when saving messages
#
# save-hook [!]<pattern> <mailbox>
#
# <mailbox> is provided as default when saving messages from <pattern>
#save-hook mutt- =mutt-mail
#save-hook aol\\.com$ +spam
save-hook ^judge +diplomacy
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Multiple spool mailboxes
#
# mbox-hook [!]<pattern> <mbox-mailbox>
#
# Read mail in <pattern> is moved to <mbox-mailbox> when <pattern> is
# closed.
#mbox-hook =mutt-users.in =mutt-users
#mbox-hook +TEST +inbox
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Change settings based upon message recipient
#
# send-hook [!]<pattern> <command>
#
# <command> is executed when sending mail to an address matching <pattern>
#send-hook mutt- 'set signature=~/.sigmutt; my_hdr From: Mutt User <user@example.com>'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Specify where to save composed messages
#
# fcc-hook [!]<pattern> <mailbox>
#
# <pattern> is recipient(s), <mailbox> is where to save a copy
#fcc-hook joe +joe
#fcc-hook bob +bob
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Change settings based on mailbox
#
# folder-hook [!]<pattern> <command>
#
# <command> is executed when opening a mailbox matching <pattern>
#folder-hook . 'set sort=date-sent'
#folder-hook mutt 'set index_format="%4C %Z %02m/%02N %-20.20F (%4l) %s"'
#folder-hook =mutt my_hdr Revolution: \#9 # real comment
#folder-hook . 'set reply_regexp="^re:[ \t]*"'
# this mailing list prepends "[WM]" to all non reply subjects, so set
# $reply_regexp to ignore it
# Warning: May break threads for other people.
#folder-hook +wmaker 'set reply_regexp="^(re:[ \t]*)?\[WM\][ \t]*"'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Aliases
#
# alias <name> <address> [ , <address> ... ]
#alias exam "\# to annoy michael" <user@host>
#alias me Michael Elkins <me@mutt.org> # me!
alias mutt-dev Mutt Development List <mutt-dev@mutt.org> # power users
alias mutt-users Mutt User List <mutt-users@mutt.org>
alias mutt-announce Mutt Announcement List <mutt-announce@mutt.org>
alias wmaker WindowMaker Mailing List <wmaker@eosys.com>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Mailboxes to watch for new mail
#
# mailboxes <path1> [ <path2> ... ]
#
mailboxes ! +mutt-dev +mutt-users +open-pgp +wmaker +hurricane +vim +ietf \
+drums
#mailboxes `echo $HOME/Mail/*`
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Specify the order of the headers to appear when displaying a message
#
# hdr_order <hdr1> [ <hdr2> ... ]
#
unhdr_order * # forget the previous settings
hdr_order date from subject to cc
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Identify mailing lists I subscribe to
#
# lists <list-name> [ <list-name> ... ]
lists ^mutt-dev@mutt\\.org$ ^mutt-users@mutt\\.org$
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Automatically use entries from ~/.mailcap to view these MIME types
#
# auto_view <type> [ <type> ... ]
auto_view application/x-gunzip
auto_view application/x-gzip
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Scoring
#
# score <pattern> <value>
#
# 9999 and -9999 are special values which cause processing of hooks to stop
# at that entry. If you prefix the score with an equal sign (=), the score
# is assigned to the message and processing stops.
#score '~f ^me@cs\.hmc\.edu$' 1000
#score '~t mutt | ~c mutt' =500
#score '~f aol\.com$' -9999
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# I use Mutt on several different machines, so I put local config commands
# in a separate file so I can have the rest of the settings the same on all
# machines.
#
source ~/.muttrc-local # config commands local to this site
# EOF

View file

@ -0,0 +1,38 @@
# Example Mutt config file for the compress 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.
# Handler 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'"
# Handler 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'"
# Handler 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'"
# Handler 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'"
# Handler 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

View file

@ -0,0 +1,116 @@
# 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 = '|'
# Enable extended buffy mode to calculate total, new, and flagged
# message counts for each mailbox.
set mail_check_stats
# Display the Sidebar mailboxes using this format string.
set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S'
# 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

View file

@ -0,0 +1,106 @@
#
# Starter muttrc file, with just a few suggestions and settings.
#
# This file purposely doesn't include hooks, keybinding, macros, colors, etc.
# Read the manual, explore, and have fun!
#
###############
# Identity
#
set realname = "Example User"
set from = "user@example.com"
# If you have another address:
alternates "^mutt@example\.com$"
# Or, if you use the entire domain:
alternates "@example\.com$"
set reverse_name
###############
# Example: local mailboxes
#
# Some people use mbsync or getmail to retrieve their mail locally.
#
set folder = ~/Mail # This has the shortcut '+' or '='
set spoolfile = "+inbox" # This has the shortcut '!'
set record = "+sent"
set trash = "+trash"
set postponed = "+drafts"
mailboxes ! +mutt +family +work
###############
# Example: Gmail over IMAP
#
set imap_user = ".....@gmail.com"
# To avoid storing your password in the .muttrc:
# echo -n 'mypassword' | gpg --encrypt -r 0x1234567890ABCDEF > ~/.mutt/account.gpg
set imap_pass = "`gpg --batch -q --decrypt ~/.mutt/account.gpg`"
set folder = imaps://imap.gmail.com/
set spoolfile = "+INBOX"
unset record # Gmail auto-stores in "+[Gmail].Sent Mail"
unset trash # Unset, deletion will remove labels
set postponed = "+[Gmail].Drafts"
set mail_check = 60
###############
# Pager settings
#
ignore *
unignore From Message-ID Date To Cc Bcc Subject
set pager_stop
unset markers
# Prefer plain text to html.
# However, for brain dead clients that bundle attachments inside a
# multipart/alternative, prefer that alternative.
alternative_order multipart/mixed multipart/related text/plain
# Consult mime.types for determining types of these attachments
mime_lookup application/octet-stream
# This requires a ~/.mailcap entry with the copiousoutput flag, such as:
# text/html; lynx -dump -width ${COLUMNS:-80} %s; nametemplate=%s.html; copiousoutput
auto_view text/html
###############
# Index settings
#
set quit = ask-yes
set sort = threads
# Remember to `mkdir -p ~/.mutt/hcache` first:
set header_cache= "~/.mutt/hcache"
###############
# Message composition settings
#
set edit_headers
# set editor = "emacsclient -a emacs -t"
# set editor = "vim"
set mime_type_query_command = "xdg-mime query filetype"
# msmtp is a solid SMTP client.
# mutt also has built-in SMTP, or you can use an MTA like exim4 or postfix.
set sendmail = "/usr/bin/msmtp"
# lbdb is a versatile contact query tool.
# Invoke via ctrl-t in an address prompt
set query_command = "/usr/bin/lbdbq"
###############
# GnuPG
#
unset crypt_use_gpgme
source /usr/local/share/doc/mutt/samples/gpg.rc
set pgp_default_key = "0x1234567890ABCDEF"
set crypt_opportunistic_encrypt
set postpone_encrypt

View file

@ -0,0 +1,304 @@
# -*-muttrc-*-
#
# Mutt configuration file of Thomas Roessler <roessler@does-not-exist.org>
#
# Use and distribute freely.
#
# Note: This file doesn't contain any personal customization, i.e.,
# using it won't make you send messages with my name in the header.
#
# Things to change: You probably want to change the "priv.rc" source
# command in the end of this file. Also, it's likely you want to have
# a look at the the $editor and $tmpdir variables.
#
#
# MIME settings
#
# auto_view application/ms-tnef text/x-vcard
# auto_view application/x-chess application/x-lotus-notes
# auto_view text/html application/x-gzip application/x-gunzip
# auto_view application/rtf application/x-rath
# auto_view application/msword
auto_view text/html
mime_lookup application/octet-stream
# alternative_order application/pgp text/html text/enriched text/plain
alternative_order text/plain text/html
#
# Key bindings
#
#
# A few of these may resemble Pine. ups.
#
bind alias " " tag-entry
bind alias \n select-entry
bind alias \r select-entry
bind attach i exit
bind attach n next-entry
bind attach p previous-entry
bind attach " " select-entry
bind attach y print-entry
bind browser <end> last-entry
bind browser <home> first-entry
bind editor "\e<backspace>" kill-word
bind editor "\e<delete>" kill-word
bind editor "<backtab>" complete-query
bind editor "\eq" complete-query
bind editor "\Ct" transpose-chars
bind generic "\CV" next-page
bind generic "\Ca" first-entry
bind generic "\Ce" last-entry
bind generic "\eV" previous-page
bind generic "\ev" previous-page
bind generic + tag-entry
bind generic ^ first-entry
bind generic a tag-prefix
bind generic $ last-entry
bind generic q exit
bind index ";" limit
bind index "\Ce" last-entry # override edit-type
bind index "\eV" previous-page # override collapse-something
bind index "\e<" collapse-thread
bind index "\eq" query
bind index $ last-entry
bind index * flag-message
bind index <delete> delete-message
bind index <end> last-entry
bind index <home> first-entry
bind index J next-entry
bind index K previous-entry
bind index Q quit
bind index R group-reply
bind index \em recall-message
bind index a tag-prefix
bind index m mail
bind index p previous-entry
bind index t create-alias
bind index x sync-mailbox
bind index y print-message
bind index n next-entry
bind index "\ev" previous-page
bind pager "\Cn" next-line
bind pager "\Cp" previous-line
bind pager + tag-message
bind pager * flag-message
bind pager <delete> delete-message
bind pager <down> next-line
bind pager <end> bottom
bind pager <home> top
bind pager <up> previous-line
bind pager G group-reply
bind pager R group-reply
bind pager \em recall-message
bind pager t display-toggle-weed # like slrn
bind pager y print-message
bind query i exit
# make it feel like emacs
macro generic "\ex" ":exec "
macro pager "\ex" ":exec "
macro generic "\eX" "\ex"
macro pager "\eX" "\ex"
macro index "~" ";~"
# macro index "%" ";%"
# Thread tagging
bind index "\et" tag-subthread
bind index "\eT" tag-thread
# for majordomo list owner and moderator jobs
macro index "\ea" ":set nopipe_decode wait_key\n|approve\n:set nowait_key\n"
macro pager "\ea" ":set nopipe_decode wait_key\n|approve\n:set nowait_key\n"
# emulate the old URL-browser key bindings.
macro pager "\Cb" "| urlview -\n"
macro index "\Cb" "| urlview -\n"
# permit limiting from the pager.
macro pager "~" "<exit><limit>~"
macro pager ";" "<exit><limit>"
# emulate the old POP-feature bindings
macro index G "!fetchmail\n"
macro pager G "!fetchmail\n"
# razor-report: Report spam.
# macro index S ":set nopipe_decode nowait_key\n|razor-report > /dev/null 2> /dev/null\ns+junk\n"
# macro pager S ":set nopipe_decode nowait_key\n|razor-report > /dev/null 2> /dev/null\ns+junk\n"
macro index S "s+junk\n"
macro pager S "s+junk\n"
#
# Colors
#
# This is a tiny hack, so I can get different
# color schemes on the console and under X11.
source ~/.mutt/colors.`if [ "$TERM" = "linux" ] ; then echo linux ; else echo default ; fi`
mono index bold ~F
# mono body bold '\*[^*]+\*'
# mono body underline '_[^_]+_'
#
# The header weed list
#
ignore delivered-to
ignore content- errors-to in-reply-to mime-version
ignore lines precedence status
ignore nntp-posting-host path old-return-path received references
ignore priority >received >>received
ignore resent- return-path xref path
ignore x400 importance sensitivity autoforward original-encoded-information
ignore x- thread-
ignore DomainKey-Signature mail-followup-to
ignore list- comments posted-to approved-by
unignore x-spam-level x-url x-mailer list-id x-no-spam x-archived-at
unignore x-diagnostic
hdr_order from to cc date subject reply-to mail-followup-to list-id
#
# Various settings
#
set abort_nosubject=no # Let me send messages with an empty subject
set abort_unmodified=no # Let me send empty messages
set alias_file=~/.mutt/aliases # Where to store aliases
unset allow_8bit # Produce correct MIME
unset arrow_cursor # Use the bar cursor
set askcc # Ask me about CCs
unset bounce_delivered # Don't include Delivered-to with bounces
# set charset=iso-8859-1 # The local character set
set send_charset="us-ascii:iso-8859-1:iso-8859-15:iso-8859-2:utf-8"
set confirmcreate # Ask me about creating new files
unset confirmappend # Don't ask me about appending to files
set delete=yes # Don't ask me whether or not I meant to delete messages
# set display_filter="tr '\240\204\223\226' ' \"\"-'" # fix some funny characters
set edit_hdrs # I want to edit the headers.
set editor="/usr/bin/jed %s -f 'mail_mode();'"
# Invoke jed with mail_mode. This may
# or may not work for you.
set noenvelope_from # set messages' envelope-from header.
set fcc_clear # Store local copies of messages in the clear.
set folder=~/Mail # Where my mail folders go
set followup_to # Create Mail-Followup-To headers.
unset force_name # Don't create save folders which don't exist.
set forward_decode # Decode messages when forwarding.
set forward_decrypt # Decrypt messages when forwarding.
set nohelp # No help line.
set include=yes # Always include a copy when replying.
set mark_old # Distinguish between seen (but unread) and new messages
set mbox=+mbox # The (unused) mbox file.
unset metoo # Remove me from CC headers.
set mime_fwd=ask-no # Ask me whether or not to create a MIME-encapsulated forward
set move=no # Don't use mbox
set pager_stop # Don't fall through to the next message in the pager
set pager_index_lines=0 # The pager index is ugly.
set pgp_replyencrypt # Encrypt when replying to encrypted messages.
set pgp_replysignencrypted # Sign when replying to encrypted messages.
set pgp_show_unusable="no" # Don't display unusable keys.
set pgp_sort_keys="keyid" # Sort keys by key ID
set pgp_replysign # Sign when replying to signed messages.
set pgp_timeout=3600 # Forget the PGP passphrase after an hour.
set pipe_decode # Decode messages I pipe to commands, typically to patch(1).
set postponed=~/.mutt/postponed # Where to put postponed messages
set print=ask-no # Don't waste paper
set print_cmd="enscript -2Gr -Email" # Two columns, landscape, fancy header.
set print_split=yes # Invoke enscript once per message
set quit=yes # Don't ask me whether or not I want to quit.
set quote_regexp="^ *[a-zA-Z]*[>|][>:|]*" # Recognize quotes in the pager.
set read_inc=50 # Progress indicator when reading folders.
set recall=ask-no # When I say "compose", ask me whether I want to continue
# composing a postponed message.
set record="+archive/now" # Put copies of most outgoing messages to ~/Mail/archive/now
set reply_to=ask-yes # Ask me whether I want to honor users' reply-to headers.
set reverse_alias # Use aliases to display real names on the index.
set save_name # Save copies by name. Together with $record and $save_name,
# this means that when a folder exists, copies of outgoing
# messages are written to ~/Mail/<name>, otherwise they go to
# ~/Mail/archive/now
set signature=~/.signature # Silly signature
set sig_dashes # Add dashes above my signature
set smart_wrap # Try to be smart when wrapping around lines in the pager
set sort=threads # sort by threads,
set sort_aux=date # then by date
unset strict_threads # don't be strict about threads
# set suspend=no # Don't suspend - I usually run mutt like this: "xterm -e mutt"
set tilde # Indicate empty lines in the pager.
set tmpdir=~/.tmp # Temporary files aren't stored in public places.
set to_chars=" +TCF " # Don't tag list mail in the index
unset use_domain # Don't append a domain to addresses.
set write_inc=50 # Progress indicator when writing folders.
set query_command="lbdb2q.pl %s" # Use the Little Brother's Database with the external
# query feature.
set sendmail_wait=-1 # Don't put sendmail into the background.
set encode_from # "From " in the beginning of a line triggers quoted-printable
set nowait_key # Return immediately from external programs
set forw_format="[fwd] %s (from: %a)" # A different subject for forwarded messages
set nobeep # Shut up. ;-)
set reply_regexp="^((re([\\[0-9\\]+])*|aw):[ \t]*)+[ \t]*" # A regular expression to detect replies
set header # Include the message header when replying.
set ignore_list_reply_to # Ignore Reply-To headers pointing to mailing lists.
set norfc2047_parameters # Sometimes, I get mails which use a bogus encoding for
# MIME parameters. Setting this shouldn't harm.
# (OK, she doesn't use Notes any more, so I can unset this. ;-)
# set text_flowed # Generate text/plain; format=flowed
# unset use_ipv6 # Don't try to use IPv6 - it doesn't work here.
set keep_flagged # don't move flagged messages to mbox
set hide_missing=yes # Don't show how many messages are missing in a thread structure
set status_format="-%r-+(%v) %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?]----%>-(%P)---"
set compose_format="--+(%v) Compose [Approx. msg size: %l Atts: %a]%>-"
set pager_format="-%Z- %C/%m: %.20n %> %s"
set smileys="^$"
set ispell=iaspell
set markers=no # Don't mark wrapped lines
set wrapmargin=4 # Leave a margin in the pager
# PGP command configuration
# source ~/.mutt/pgp2.rc
source ~/.mutt/gpg.rc
set pgp_getkeys_command=""
# source ~/.mutt/smime.rc
# source non-public stuff, (hooks, alternates, ...)
source ~/.mutt/priv.rc
# source aliases
# source ~/.mutt/aliases-coruscant
source ~/.mutt/aliases

View file

@ -0,0 +1,35 @@
" Vim syntax file for the mutt sidebar patch
syntax keyword muttrcVarBool skipwhite contained sidebar_folder_indent nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarBool skipwhite contained sidebar_new_mail_only nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarBool skipwhite contained sidebar_next_new_wrap nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarBool skipwhite contained sidebar_short_path nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarBool skipwhite contained sidebar_visible nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarNum skipwhite contained sidebar_refresh_time nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarNum skipwhite contained sidebar_width nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr
syntax keyword muttrcVarStr contained skipwhite sidebar_divider_char nextgroup=muttrcVarEqualsIdxFmt
syntax keyword muttrcVarStr contained skipwhite sidebar_delim_chars nextgroup=muttrcVarEqualsIdxFmt
syntax keyword muttrcVarStr contained skipwhite sidebar_format nextgroup=muttrcVarEqualsIdxFmt
syntax keyword muttrcVarStr contained skipwhite sidebar_indent_string nextgroup=muttrcVarEqualsIdxFmt
syntax keyword muttrcVarStr contained skipwhite sidebar_sort_method nextgroup=muttrcVarEqualsIdxFmt
syntax keyword muttrcCommand sidebar_whitelist
syntax match muttrcFunction contained "\<sidebar-next\>"
syntax match muttrcFunction contained "\<sidebar-next-new\>"
syntax match muttrcFunction contained "\<sidebar-open\>"
syntax match muttrcFunction contained "\<sidebar-page-down\>"
syntax match muttrcFunction contained "\<sidebar-page-up\>"
syntax match muttrcFunction contained "\<sidebar-prev\>"
syntax match muttrcFunction contained "\<sidebar-prev-new\>"
syntax match muttrcFunction contained "\<sidebar-toggle-visible\>"
syntax keyword muttrcColorField contained sidebar_divider
syntax keyword muttrcColorField contained sidebar_flagged
syntax keyword muttrcColorField contained sidebar_highlight
syntax keyword muttrcColorField contained sidebar_indicator
syntax keyword muttrcColorField contained sidebar_new
" vim: syntax=vim

View file

@ -0,0 +1,127 @@
# -*-muttrc-*-
## The following options are only available if you have
## compiled in S/MIME support
# If you compiled mutt with support for both PGP and S/MIME, PGP
# will be the default method unless the following option is set
# set smime_is_default
# Uncomment this if you don't want to set labels for certificates you add.
# unset smime_ask_cert_label
# Passphrase expiration
# set smime_timeout=300
# Global crypto options -- these affect PGP operations as well.
# set crypt_autosign = yes
# set crypt_replyencrypt = yes
# set crypt_replysign = yes
# set crypt_replysignencrypted = yes
# set crypt_verify_sig = yes
# Section A: Key Management
# The default keyfile for encryption (used by $smime_self_encrypt and
# $postpone_encrypt).
#
# It will also be used for decryption unless
# $smime_decrypt_use_default_key is unset.
#
# It will additionally be used for signing unless $smime_sign_as is
# set to a key.
#
# Unless your key does not have encryption capability, uncomment this
# line and replace the keyid with your own.
#
# set smime_default_key="12345678.0"
# If you have a separate signing key, or your key _only_ has signing
# capability, uncomment this line and replace the keyid with your
# signing keyid.
#
# set smime_sign_as="87654321.0"
# Uncomment to make mutt ask what key to use when trying to decrypt a message.
# It will use the default key above (if that was set) else.
# unset smime_decrypt_use_default_key
# Path to a file or directory with trusted certificates
set smime_ca_location="~/.smime/ca-bundle.crt"
# Path to where all known certificates go. (must exist!)
set smime_certificates="~/.smime/certificates"
# Path to where all private keys go. (must exist!)
set smime_keys="~/.smime/keys"
# These are used to extract a certificate from a message.
# First generate a PKCS#7 structure from the message.
set smime_pk7out_command="openssl smime -verify -in %f -noverify -pk7out"
# Extract the included certificate(s) from a PKCS#7 structure.
set smime_get_cert_command="openssl pkcs7 -print_certs -in %f"
# Extract the signer's certificate only from a S/MIME signature (sender verification)
set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signer %c -out /dev/null"
# This is used to get the email address the certificate was issued to.
set smime_get_cert_email_command="openssl x509 -in %f -noout -email"
# Add a certificate to the database using smime_keys.
set smime_import_cert_command="smime_keys add_cert %f"
# Section B: Outgoing messages
# Algorithm to use for encryption.
# valid choices are aes128, aes192, aes256, rc2-40, rc2-64, rc2-128, des, des3
set smime_encrypt_with="aes256"
# Encrypt a message. Input file is a MIME entity.
set smime_encrypt_command="openssl cms -encrypt -%a -outform DER -in %f %c"
# Algorithm for the signature message digest.
# Valid choices are md5, sha1, sha224, sha256, sha384, sha512.
set smime_sign_digest_alg="sha256"
# Sign.
set smime_sign_command="openssl smime -sign -md %d -signer %c -inkey %k -passin stdin -in %f -certfile %i -outform DER"
# Section C: Incoming messages
# Decrypt a message. Output is a MIME entity.
set smime_decrypt_command="openssl cms -decrypt -passin stdin -inform DER -in %f -inkey %k -recip %c"
# Verify a signature of type multipart/signed
set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f"
# Verify a signature of type application/x-pkcs7-mime
set smime_verify_opaque_command="\
openssl smime -verify -inform DER -in %s %C || \
openssl smime -verify -inform DER -in %s -noverify 2>/dev/null"
# application/pkcs7-mime ".p7m" messages should have a smime-type
# parameter to tell Mutt whether it's signed or encrypted data.
#
# If the parameter is missing, Mutt by default assumes it's SignedData.
# This can be used to change Mutt's assumption to EnvelopedData (encrypted).
#
# set smime_pkcs7_default_smime_type="enveloped"
# Section D: Alternatives
# Sign. If you wish to NOT include the certificate your CA used in signing
# your public key, use this command instead.
# set smime_sign_command="openssl smime -sign -md %d -signer %c -inkey %k -passin stdin -in %f -outform DER"
#
# In order to verify the signature only and skip checking the certificate chain:
#
# set smime_verify_command="openssl smime -verify -inform DER -in %s -content %f -noverify"
# set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s -noverify"
#

View file

@ -0,0 +1,134 @@
#! /usr/bin/perl -W
# by Mike Schiraldi <raldi@research.netsol.com>
use strict;
use Expect;
sub run ($;$ );
umask 077; # probably not necc. but can't hurt
my $tmpdir = "/tmp/smime_keys_test-$$-" . time;
mkdir $tmpdir or die;
chdir $tmpdir or die;
open TMP, '>muttrc' or die;
print TMP <<EOF;
set smime_ca_location="$tmpdir/ca-bundle.crt"
set smime_certificates="$tmpdir/certificates"
set smime_keys="$tmpdir/keys"
EOF
close TMP;
$ENV{MUTT_CMDLINE} = "mutt -F $tmpdir/muttrc";
# make a user key
run 'smime_keys init';
run 'openssl genrsa -out user.key 1024';
# make a request for this key to be signed
run 'openssl req -new -key user.key -out newreq.pem', "\n\nx\n\nx\nx\nuser\@smime.mutt\n\nx\n";
mkdir 'demoCA' or die;
mkdir 'demoCA/certs' or die;
mkdir 'demoCA/crl' or die;
mkdir 'demoCA/newcerts' or die;
mkdir 'demoCA/private' or die;
open OUT, '>demoCA/serial' or die;
print OUT "01\n";
close OUT;
open OUT, '>demoCA/index.txt' or die;
close OUT;
# make the CA
run 'openssl req -new -x509 -keyout demoCA/private/cakey.pem -out demoCA/cacert.pem -days 7300 -nodes',
"\n\nx\n\nx\nx\n\n";
# trust it
run 'smime_keys add_root demoCA/cacert.pem', "root_CA\n";
# have the CA process the request
run 'openssl ca -batch -startdate 000101000000Z -enddate 200101000000Z -days 7300 ' .
'-policy policy_anything -out newcert.pem -infiles newreq.pem';
unlink 'newreq.pem' or die;
# put it all in a .p12 bundle
run 'openssl pkcs12 -export -inkey user.key -in newcert.pem -out cert.p12 -CAfile demoCA/cacert.pem -chain', "pass1\n" x 2;
unlink 'newcert.pem' or die;
unlink 'demoCA/cacert.pem' or die;
unlink 'demoCA/index.txt' or die;
unlink 'demoCA/index.txt.old' or die;
unlink 'demoCA/serial' or die;
unlink 'demoCA/serial.old' or die;
unlink 'demoCA/newcerts/01.pem' or die;
unlink 'demoCA/private/cakey.pem' or die;
rmdir 'demoCA/certs' or die;
rmdir 'demoCA/crl' or die;
rmdir 'demoCA/private' or die;
rmdir 'demoCA/newcerts' or die;
rmdir 'demoCA' or die;
# have smime_keys process it
run 'smime_keys add_p12 cert.p12', "pass1\n" . "pass2\n" x 2 . "old_label\n";
unlink 'cert.p12' or die;
# make sure it showed up
run 'smime_keys list > list';
open IN, 'list' or die;
<IN> eq "\n" or die;
<IN> =~ /^(.*)\: Issued for\: user\@smime\.mutt \"old_label\" \(Unverified\)\n/ or die;
close IN;
my $keyid = $1;
# see if we can rename it
run "smime_keys label $keyid", "new_label\n";
# make sure it worked
run 'smime_keys list > list';
open IN, 'list' or die;
<IN> eq "\n" or die;
<IN> =~ /^$keyid\: Issued for\: user\@smime\.mutt \"new_label\" \(Unverified\)\n/ or die;
close IN;
unlink 'list' or die;
# try signing something
run "openssl smime -sign -signer certificates/$keyid -inkey user.key -in /etc/passwd -certfile certificates/37adefc3.0 > signed";
unlink 'user.key' or die;
# verify it
run 'openssl smime -verify -out /dev/null -in signed -CAfile ca-bundle.crt';
unlink 'signed' or die;
# clean up
unlink 'ca-bundle.crt' or die;
unlink 'muttrc' or die;
unlink 'keys/.index' or die;
unlink 'certificates/.index' or die;
unlink <keys/*> or die;
unlink <certificates/*> or die;
rmdir 'keys' or die;
rmdir 'certificates' or die;
chdir '/' or die;
rmdir $tmpdir or die;
sub run ($;$) {
my $cmd = shift or die;
my $input = shift;
print "\n\nRunning [$cmd]\n";
my $exp = Expect->spawn ($cmd);
if (defined $input) {
print $exp $input;
}
$exp->soft_close;
$? and die "$cmd returned $?";
}

View file

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 7. Security Considerations</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="optionalfeatures.html" title="Chapter 6. Optional Features" /><link rel="next" href="tuning.html" title="Chapter 8. Performance Tuning" /><style xmlns="" type="text/css">
body { margin-left:2%; margin-right:2%; font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
p { text-align:justify; }
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
.email, .email a { font-family:monospace; }
div.table-contents table, div.informaltable table { border-collapse:collapse; border:1px solid #c0c0c0; }
div.table-contents table td, div.informaltable td, div.table-contents table th, div.informaltable table th { padding:5px; text-align:left; }
div.table-contents table th, div.informaltable table th {
font-family:sans-serif;
background:#d0d0d0;
font-weight:normal;
vertical-align:top;
}
div.cmdsynopsis { border-left:1px solid #707070; padding-left:5px; }
li div.cmdsynopsis { border-left:none; padding-left:0px; }
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; margin-left:2%; margin-right:2%; }
div.example p.title { margin-left:2%; }
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
div.note h3:after { content: ":" }
div.note { margin-bottom: 5px; }
.command { font-family: monospace; font-weight: normal; }
.command strong { font-weight: normal; }
tr { vertical-align: top; }
.comment { color:#707070; }
</style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. Security Considerations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="optionalfeatures.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="tuning.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="security"></a>Chapter 7. Security Considerations</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="security.html#security-passwords">1. Passwords</a></span></dt><dt><span class="sect1"><a href="security.html#security-tempfiles">2. Temporary Files</a></span></dt><dt><span class="sect1"><a href="security.html#security-leaks">3. Information Leaks</a></span></dt><dd><dl><dt><span class="sect2"><a href="security.html#security-leaks-mailto">3.1. <code class="literal">mailto:</code>-style Links</a></span></dt></dl></dd><dt><span class="sect1"><a href="security.html#security-external">4. External Applications</a></span></dt></dl></div><p>
First of all, Mutt contains no security holes included by intention but
may contain unknown security holes. As a consequence, please run Mutt
only with as few permissions as possible. Especially, do not run Mutt as
the super user.
</p><p>
When configuring Mutt, there're some points to note about secure setups
so please read this chapter carefully.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="security-passwords"></a>1. Passwords</h2></div></div></div><p>
Although Mutt can be told the various passwords for accounts, please
never store passwords in configuration files. Besides the fact that the
system's operator can always read them, you could forget to mask it out
when reporting a bug or asking for help via a mailing list. Even worse,
your mail including your password could be archived by internet search
engines, mail-to-news gateways etc. It may already be too late before
you notice your mistake.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="security-tempfiles"></a>2. Temporary Files</h2></div></div></div><p>
Mutt uses many temporary files for viewing messages, verifying digital
signatures, etc. As long as being used, these files are visible by other
users and maybe even readable in case of misconfiguration. Also, a
different location for these files may be desired which can be changed
via the <a class="link" href="reference.html#tmpdir" title="3.399. tmpdir">$tmpdir</a> variable.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="security-leaks"></a>3. Information Leaks</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="security-leaks-mailto"></a>3.1. <code class="literal">mailto:</code>-style Links</h3></div></div></div><p>
As Mutt be can be set up to be the mail client to handle
<code class="literal">mailto:</code> style links in websites, there're security
considerations, too. Arbitrary header fields can be embedded in these
links which could override existing header fields or attach arbitrary
files using <a class="link" href="gettingstarted.html#attach-header" title="6.2.2. Attach: Pseudo Header">the Attach:
pseudoheader</a>. This may be problematic if the <a class="link" href="reference.html#edit-headers" title="3.84. edit_headers">$edit-headers</a> variable is
<span class="emphasis"><em>unset</em></span>, i.e. the user doesn't want to see header
fields while editing the message and doesn't pay enough attention to the
compose menu's listing of attachments.
</p><p>
For example, following a link like
</p><pre class="screen">
mailto:joe@host?Attach=~/.gnupg/secring.gpg</pre><p>
will send out the user's private gnupg keyring to
<code class="literal">joe@host</code> if the user doesn't follow the information
on screen carefully enough.
</p><p>
To prevent these issues, Mutt by default only accepts the
<code class="literal">Subject</code>, <code class="literal">Body</code>,
<code class="literal">Cc</code>, <code class="literal">In-Reply-To</code>, and
<code class="literal">References</code> headers. Allowed headers can be
adjusted with the <a class="link" href="configuration.html#mailto-allow" title="33. Control allowed header fields in a mailto: URL"><span class="command"><strong>mailto_allow</strong></span></a> and
<a class="link" href="configuration.html#mailto-allow" title="33. Control allowed header fields in a mailto: URL"><span class="command"><strong>unmailto_allow</strong></span></a>
commands.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="security-external"></a>4. External Applications</h2></div></div></div><p>
Mutt in many places has to rely on external applications or for
convenience supports mechanisms involving external applications.
</p><p>
One of these is the <code class="literal">mailcap</code> mechanism as defined by
RfC1524. Details about a secure use of the mailcap mechanisms is given
in <a class="xref" href="mimesupport.html#secure-mailcap" title="3.2. Secure Use of Mailcap">Section 3.2, “Secure Use of Mailcap”</a>.
</p><p>
Besides the mailcap mechanism, Mutt uses a number of other external
utilities for operation, for example to provide crypto support, in
backtick expansion in configuration files or format string filters. The
same security considerations apply for these as for tools involved via
mailcap.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="optionalfeatures.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="tuning.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 6. Optional Features </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 8. Performance Tuning</td></tr></table></div></body></html>

View file

@ -0,0 +1,96 @@
How to add use mutt's S/MIME capabilities
- Add the contents of contrib/smime.rc to your .muttrc. Don't worry about
changing the smime_sign_as line at this point -- you'll change it later.
- Run 'smime_keys init'.
- Download and install OpenSSL.
- Get yourself a certificate. (You can get one for free from www.thawte.com,
or pay for one from VeriSign or one of its competitors) The way the
process generally works, the certificate will be installed "into" your web
browser. If you are asked what application you wish to use the
certificate with, select Netscape. Strangely enough, "mutt" is usually not
an option.
- Assuming you are using Mozilla, follow the instructions at
www.verisignlabs.com/Projects/smime_docs/linux.html to export the
certificate into a file called cert.p12. If you don't use Mozilla, you're
on your own.
- Run "smime_keys add_p12 cert.p12"
* When the script asks for the "Import password", enter the one you
provided when you exported the certificate.
* When it asks for a "PEM pass phrase", make up a new password. Every
time you sign or decrypt a message, mutt will ask for the PEM pass
phrase.
* Finally, when the script asks for a label, enter an easy-to-remember
name for the certificate, such as "me". The script output will include
a line like:
added private key: /home/raldi/.smime/keys/12345678.0 for raldi@verisignlabs.com
The number (including the ".0" at the end) is your keyid. You will
need this number in the next step.
- There is no more ca-bundle.crt file with the trusted roots to import shipped
in mutt. The user is encouraged to use ca-bundle.crt from ca-certificate
package. This makes you trust anything that was ultimately
signed by one of them. You can use "smime_keys add_root" to do so, or
just copy ca-bundle.crt into the place you point mutt's smime_ca_location
variable to.
Other notes
Key management is done in a way similar to OpenSSL's CA directory. Private
keys and certificates are stored in different directories, as OpenSSL
expects either to be supplied in a (distinct) file. Each directory contains
an unsorted file named '.index' wherein each line has several fields:
mailbox, keyid, label, id of the intermediate certificate and keyflags.
* Keyid is a hashvalue derived from the subject field of a certificate
and supplied by OpenSSL.
* The mailbox address is derived from either From or Sender field of the
message, and matched with the email field of the certificate. Non
matching address pairs get rejected, as get certificates not
containing a mailbox address at all. (These are security issues, that
perhaps should be configurable.)
* Label is set by the perl script (it will ask you to supply one), when
you add your keypair to the database. So are the remaining two fields.
* keyflags are set with certificate verification option of the perl
script. It may take as value one of the following: i: invalid
(verification failed), r: revoked, e: expired, u: unverified, v:
successfully verified and finally t: trusted, in case it was
successfully verified and you chose to trust the certificate (the
script will ask you). Mutt will not use invalid, revoked or expired
certificates for signing or encryption. It will ask for confirmation
before using unverified certificates, and finally it will issue a
warning before using successfully verified but untrusted certificates.
The purpose fields of a certificate do not get verified yet, also there is
no real check if the given file is a certificate at all.
Key retrieval is done obviously by searching the index file for a given
mailbox. If none is found, the user is presented a list of available keys
and asked to select one of those.
The certificate and key directories specified in muttrc have to exist. Mutt
will not create them. If you wish to sign messages yourself, note that this
mutt does not address any PKCS10 or PKCS12 issues (yet?); that is, you have
to get a valid certificate outside of mutt. (See above)
A certificate can be viewed by adding the following to your ~/.mailcap:
application/x-pkcs7-signature;openssl pkcs7 -in %s -inform der -noout \
-print_certs -text | less; needsterminal

View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 8. Performance Tuning</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="security.html" title="Chapter 7. Security Considerations" /><link rel="next" href="reference.html" title="Chapter 9. Reference" /><style xmlns="" type="text/css">
body { margin-left:2%; margin-right:2%; font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
p { text-align:justify; }
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
.email, .email a { font-family:monospace; }
div.table-contents table, div.informaltable table { border-collapse:collapse; border:1px solid #c0c0c0; }
div.table-contents table td, div.informaltable td, div.table-contents table th, div.informaltable table th { padding:5px; text-align:left; }
div.table-contents table th, div.informaltable table th {
font-family:sans-serif;
background:#d0d0d0;
font-weight:normal;
vertical-align:top;
}
div.cmdsynopsis { border-left:1px solid #707070; padding-left:5px; }
li div.cmdsynopsis { border-left:none; padding-left:0px; }
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; margin-left:2%; margin-right:2%; }
div.example p.title { margin-left:2%; }
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
div.note h3:after { content: ":" }
div.note { margin-bottom: 5px; }
.command { font-family: monospace; font-weight: normal; }
.command strong { font-weight: normal; }
tr { vertical-align: top; }
.comment { color:#707070; }
</style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. Performance Tuning</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="security.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="reference.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="tuning"></a>Chapter 8. Performance Tuning</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="tuning.html#tuning-mailboxes">1. Reading and Writing Mailboxes</a></span></dt><dt><span class="sect1"><a href="tuning.html#tuning-messages">2. Reading Messages from Remote Folders</a></span></dt><dt><span class="sect1"><a href="tuning.html#tuning-search">3. Searching and Limiting</a></span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="tuning-mailboxes"></a>1. Reading and Writing Mailboxes</h2></div></div></div><p>
Mutt's performance when reading mailboxes can be improved in two ways:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
For remote folders (IMAP and POP) as well as folders using one-file-per
message storage (Maildir and MH), Mutt's performance can be greatly
improved using <a class="link" href="optionalfeatures.html#header-caching" title="8.1. Header Caching">header caching</a>.
using a single database per folder.
</p></li><li class="listitem"><p>
Mutt provides the <a class="link" href="reference.html#read-inc" title="3.275. read_inc">$read_inc</a> and <a class="link" href="reference.html#write-inc" title="3.423. write_inc">$write_inc</a> variables to specify at which rate
to update progress counters. If these values are too low, Mutt may spend
more time on updating the progress counter than it spends on actually
reading/writing folders.
</p><p>
For example, when opening a maildir folder with a few thousand messages,
the default value for <a class="link" href="reference.html#read-inc" title="3.275. read_inc">$read_inc</a> may be
too low. It can be tuned on a folder-basis using <a class="link" href="configuration.html#folder-hook" title="9. Setting Variables Based Upon Mailbox"><span class="command"><strong>folder-hook</strong></span>s</a>:
</p><pre class="screen">
<span class="comment"># use very high $read_inc to speed up reading hcache'd maildirs</span>
folder-hook . 'set read_inc=1000'
<span class="comment"># use lower value for reading slower remote IMAP folders</span>
folder-hook ^imap 'set read_inc=100'
<span class="comment"># use even lower value for reading even slower remote POP folders</span>
folder-hook ^pop 'set read_inc=1'</pre></li></ol></div><p>
These settings work on a per-message basis. However, as messages may
greatly differ in size and certain operations are much faster than
others, even per-folder settings of the increment variables may not be
desirable as they produce either too few or too much progress updates.
Thus, Mutt allows to limit the number of progress updates per second
it'll actually send to the terminal using the <a class="link" href="reference.html#time-inc" title="3.397. time_inc">$time_inc</a> variable.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="tuning-messages"></a>2. Reading Messages from Remote Folders</h2></div></div></div><p>
Reading messages from remote folders such as IMAP an POP can be slow
especially for large mailboxes since Mutt only caches a very limited
number of recently viewed messages (usually 10) per session (so that it
will be gone for the next session.)
</p><p>
To improve performance and permanently cache whole messages and
headers, please refer to <a class="link" href="optionalfeatures.html#body-caching" title="8.2. Body Caching">body
caching</a> and <a class="link" href="optionalfeatures.html#header-caching" title="8.1. Header Caching">header
caching</a> for details.
</p><p>
Additionally, it may be worth trying some of Mutt's experimental
features. <a class="link" href="reference.html#imap-qresync" title="3.151. imap_qresync">$imap_qresync</a> (which
requires header caching) can provide a huge speed boost opening
mailboxes if your IMAP server supports it. <a class="link" href="reference.html#imap-deflate" title="3.137. imap_deflate">$imap_deflate</a> enables compression, which
can also noticeably reduce download time for large mailboxes and
messages.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="tuning-search"></a>3. Searching and Limiting</h2></div></div></div><p>
When searching mailboxes either via a search or a limit action, for some
patterns Mutt distinguishes between regular expression and string
searches. For regular expressions, patterns are prefixed with
<span class="quote"><span class="quote">~</span></span> and with <span class="quote"><span class="quote">=</span></span> for string searches.
</p><p>
Even though a regular expression search is fast, it's several times
slower than a pure string search which is noticeable especially on large
folders. As a consequence, a string search should be used instead of a
regular expression search if the user already knows enough about the
search pattern.
</p><p>
For example, when limiting a large folder to all messages sent to or by
an author, it's much faster to search for the initial part of an e-mail
address via <code class="literal">=Luser@</code> instead of
<code class="literal">~Luser@</code>. This is especially true for searching
message bodies since a larger amount of input has to be searched.
</p><p>
As for regular expressions, a lower case string search pattern makes
Mutt perform a case-insensitive search except for IMAP (because for IMAP
Mutt performs server-side searches which don't support
case-insensitivity).
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="security.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="reference.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Security Considerations </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Reference</td></tr></table></div></body></html>