34#include <sys/utsname.h>
45#ifdef CRYPT_BACKEND_GPGME
52#include <openssl/opensslv.h>
55#include <gnutls/gnutls.h>
58#define PCRE2_CODE_UNIT_WIDTH 8
70 "Copyright (C) 2015-2025 Richard Russon <rich@flatcap.org>\n"
71 "Copyright (C) 2016-2025 Pietro Cerutti <gahr@gahr.ch>\n"
72 "Copyright (C) 2017-2019 Mehdi Abaakouk <sileht@sileht.net>\n"
73 "Copyright (C) 2018-2020 Federico Kircheis <federico.kircheis@gmail.com>\n"
74 "Copyright (C) 2017-2022 Austin Ray <austin@austinray.io>\n"
75 "Copyright (C) 2023-2025 Dennis Schön <mail@dennis-schoen.de>\n"
76 "Copyright (C) 2016-2017 Damien Riegel <damien.riegel@gmail.com>\n"
77 "Copyright (C) 2023 Rayford Shireman\n"
78 "Copyright (C) 2021-2023 David Purton <dcpurton@marshwiggle.net>\n"
79 "Copyright (C) 2020-2023 наб <nabijaczleweli@nabijaczleweli.xyz>\n";
83 "Many others not mentioned here contributed code, fixes and suggestions.\n");
87 "This program is free software; you can redistribute it and/or modify\n"
88 "it under the terms of the GNU General Public License as published by\n"
89 "the Free Software Foundation; either version 2 of the License, or\n"
90 "(at your option) any later version.\n"
92 "This program is distributed in the hope that it will be useful,\n"
93 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
94 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
95 "GNU General Public License for more details.\n"
97 "You should have received a copy of the GNU General Public License\n"
98 "along with this program; if not, write to the Free Software\n"
99 "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n");
102static const char *
ReachingUs =
N_(
"To learn more about NeoMutt, visit: https://neomutt.org\n"
103 "If you find a bug in NeoMutt, please raise an issue at:\n"
104 " https://github.com/neomutt/neomutt/issues\n"
105 "or send an email to: <neomutt-devel@neomutt.org>\n");
110 N_(
"Copyright (C) 2015-2025 Richard Russon and friends\n"
111 "NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.\n"
112 "NeoMutt is free software, and you are welcome to redistribute it\n"
113 "under certain conditions; type 'neomutt -vv' for details.\n");
144#ifdef HAVE_GETADDRINFO
145 {
"getaddrinfo", 1 },
147 {
"getaddrinfo", 0 },
154#ifdef CRYPT_BACKEND_GPGME
190 {
"locales_hack", 1 },
192 {
"locales_hack", 0 },
209#ifdef USE_SSL_OPENSSL
217#ifdef CRYPT_BACKEND_CLASSIC_PGP
230#ifdef CRYPT_BACKEND_CLASSIC_SMIME
240#ifdef NEOMUTT_DIRECT_COLORS
253#ifdef USE_DEBUG_BACKTRACE
256#ifdef USE_DEBUG_COLOR
259#ifdef USE_DEBUG_EMAIL
262#ifdef USE_DEBUG_GRAPHVIZ
265#ifdef USE_DEBUG_KEYMAP
268#ifdef USE_DEBUG_LOGGING
271#ifdef USE_DEBUG_NAMES
274#ifdef USE_DEBUG_NOTIFY
277#ifdef QUEUE_MACRO_DEBUG_TRACE
283#ifdef USE_DEBUG_WINDOW
297 static char vstring[256];
298 snprintf(vstring,
sizeof(vstring),
"NeoMutt %s%s", PACKAGE_VERSION,
GitVer);
314 char *p = &s[strlen(s)];
318 while ((p >= s) && ((*p ==
'\n') || (*p ==
'\r')))
332 struct utsname uts = { 0 };
338 buf_printf(buf,
"%s %s", uts.sysname, uts.release);
347#ifdef NCURSES_VERSION
348 buf_add_printf(buf,
" (compiled with %s.%d)", NCURSES_VERSION, NCURSES_VERSION_PATCH);
354#ifdef _LIBICONV_VERSION
355 buf_printf(buf,
"%d.%d", _LIBICONV_VERSION >> 8, _LIBICONV_VERSION & 0xff);
367#ifdef CRYPT_BACKEND_GPGME
373#ifdef USE_SSL_OPENSSL
374#ifdef LIBRESSL_VERSION_TEXT
378#ifdef OPENSSL_VERSION_TEXT
392 buf_printf(buf,
"%d.%d.%d", LIBNOTMUCH_MAJOR_VERSION,
393 LIBNOTMUCH_MINOR_VERSION, LIBNOTMUCH_MICRO_VERSION);
400 char version[24] = { 0 };
401 pcre2_config(PCRE2_CONFIG_VERSION, version);
480#ifdef USE_HCACHE_COMPRESSION
546 for (
int i = 0; co[i].
name; i++)
548 const size_t len = strlen(co[i].name) + 2;
555 const char *fmt =
"?%s ";
556 switch (co[i].enabled)
560 fmt =
"\033[1;31m-%s\033[0m ";
566 fmt =
"\033[1;32m+%s\033[0m ";
572 fmt =
"\033[1;36m%s\033[0m ";
577 fprintf(fp, fmt, co[i].name);
600 const char *col_cyan =
"";
601 const char *col_bold =
"";
602 const char *col_end =
"";
606 col_cyan =
"\033[1;36m";
607 col_bold =
"\033[1m";
611 fprintf(fp,
"%s%s%s\n", col_cyan, ver->
version, col_end);
612 fprintf(fp,
"%s\n",
_(
Notice));
616 fprintf(fp,
"%s%s:%s %s\n", col_bold, kv->
key, col_end, kv->
value);
621 fprintf(fp,
"%sstorage:%s ", col_bold, col_end);
633 fprintf(fp,
"%scompression:%s ", col_bold, col_end);
644 fprintf(fp,
"%sConfigure options:%s ", col_bold, col_end);
649 if (!np || !np->
data)
660 fprintf(fp,
"%sCompilation CFLAGS:%s ", col_bold, col_end);
663 if (!np || !np->
data)
672 fprintf(fp,
"%s%s%s\n", col_bold,
_(
"Compile options:"), col_end);
678 fprintf(fp,
"%s%s%s\n", col_bold,
_(
"Devel options:"), col_end);
685 fprintf(fp,
"%s%s%s=\"%s\"\n", col_bold, kv->
key, col_end, kv->
value);
711 return !ferror(stdout);
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_INIT(head)
Initialize an array.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
struct Slist * compress_list(void)
Get a list of compression backend names.
API for the header cache compression.
Convenience wrapper for the config headers.
const char * mutt_gpgme_print_version(void)
Get version of GPGME.
Convenience wrapper for the gui headers.
const char * mutt_idna_print_version(void)
Create an IDN version string.
#define MUTT_MEM_CALLOC(n, type)
Convenience wrapper for the library headers.
struct Slist * slist_parse(const char *str, uint32_t flags)
Parse a list of strings into a list.
void slist_free(struct Slist **ptr)
Free an Slist object.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
API for encryption/signing of emails.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_NEXT(elm, field)
struct Slist * store_backend_list(void)
Get a list of backend names.
String manipulation buffer.
const char * name
Option name.
int enabled
0 Disabled, 1 Enabled, 2 Devel only
Version info about NeoMutt.
struct KeyValueArray paths
Compiled-in paths.
struct Slist * configure
Configure options.
const char * version
Version of NeoMutt: YYYYMMDD-NUM-HASH (number of commits, git hash)
struct Slist * compression
Compression methods, e.g. zlib.
struct Slist * storage
Storage backends, e.g. lmdb.
const struct CompileOption * devel
Compiled-in development features.
const struct CompileOption * feature
Compiled-in features.
struct Slist * compilation
Compilation CFLAGS.
struct KeyValueArray system
System information.
struct ListHead head
List containing values.
#define D_SLIST_SEP_SPACE
Slist items are space-separated.
static const struct CompileOption DevelOpts[]
Devel options strings for neomutt -v output.
static void paths_get(struct KeyValueArray *kva)
Get compiled-in paths.
static const char * Thanks
CLI Version: Thanks.
static const char * License
CLI Version: License.
static const char * Copyright
CLI Version: Authors' copyrights.
static const int SCREEN_WIDTH
CLI: Width to wrap version info.
void version_free(struct NeoMuttVersion **ptr)
Free a NeoMuttVersion.
static const char * ReachingUs
CLI Version: How to reach the NeoMutt Team.
const char * mutt_make_version(void)
Generate the NeoMutt version string.
bool print_copyright(void)
Print copyright message.
unsigned char configure_options[]
bool print_version(FILE *fp, bool use_ansi)
Print system and compile info to a file.
static void system_get(struct KeyValueArray *kva)
Get info about system libraries.
static void kva_clear(struct KeyValueArray *kva)
Free the strings of a KeyValueArray.
unsigned char cc_cflags[]
static char * rstrip_in_place(char *s)
Strip a trailing carriage return.
static const char * Notice
CLI Version: Warranty notice.
bool feature_enabled(const char *name)
Test if a compile-time feature is enabled.
struct NeoMuttVersion * version_get(void)
Get NeoMutt version info.
static const struct CompileOption CompOpts[]
Compile options strings for neomutt -v output.
static void print_compile_options(const struct CompileOption *co, FILE *fp, bool use_ansi)
Print a list of enabled/disabled features.
Display version and copyright about NeoMutt.