#include "config.h"
#include <locale.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "gui/lib.h"
#include "hdrline.h"
#include "ncrypt/lib.h"
#include "context.h"
#include "format_flags.h"
#include "hook.h"
#include "maillist.h"
#include "mutt_globals.h"
#include "mutt_menu.h"
#include "mutt_parse.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "sort.h"
#include "notmuch/lib.h"
Go to the source code of this file.
|
enum | FlagChars {
FLAG_CHAR_TAGGED,
FLAG_CHAR_IMPORTANT,
FLAG_CHAR_DELETED,
FLAG_CHAR_DELETED_ATTACH,
FLAG_CHAR_REPLIED,
FLAG_CHAR_OLD,
FLAG_CHAR_NEW,
FLAG_CHAR_OLD_THREAD,
FLAG_CHAR_NEW_THREAD,
FLAG_CHAR_SEMPTY,
FLAG_CHAR_ZEMPTY
} |
| Index into the $flag_chars variable ($flag_chars) More...
|
|
enum | CryptChars {
FLAG_CHAR_CRYPT_GOOD_SIGN,
FLAG_CHAR_CRYPT_ENCRYPTED,
FLAG_CHAR_CRYPT_SIGNED,
FLAG_CHAR_CRYPT_CONTAINS_KEY,
FLAG_CHAR_CRYPT_NO_CRYPTO
} |
| Index into the $crypt_chars variable ($crypt_chars) More...
|
|
enum | FieldType {
DISP_TO,
DISP_CC,
DISP_BCC,
DISP_FROM,
DISP_PLAIN,
DISP_MAX
} |
| Header types. More...
|
|
|
static size_t | add_index_color (char *buf, size_t buflen, MuttFormatFlags flags, char color) |
| Insert a color marker into a string. More...
|
|
static const char * | get_nth_wchar (struct MbTable *table, int index) |
| Extract one char from a multi-byte table. More...
|
|
static const char * | make_from_prefix (enum FieldType disp) |
| Create a prefix for an author field. More...
|
|
static void | make_from (struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags) |
| Generate a From: field (with optional prefix) More...
|
|
static void | make_from_addr (struct Envelope *env, char *buf, size_t buflen, bool do_lists) |
| Create a 'from' address for a reply email. More...
|
|
static bool | user_in_addr (struct AddressList *al) |
| Do any of the addresses refer to the user? More...
|
|
static int | user_is_recipient (struct Email *e) |
| Is the user a recipient of the message. More...
|
|
static char * | apply_subject_mods (struct Envelope *env) |
| Apply regex modifications to the subject. More...
|
|
static bool | thread_is_new (struct Email *e) |
| Does the email thread contain any new emails? More...
|
|
static bool | thread_is_old (struct Email *e) |
| Does the email thread contain any unread emails? More...
|
|
static const char * | index_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags) |
| Format a string for the index list - Implements format_t. More...
|
|
void | mutt_make_string (char *buf, size_t buflen, int cols, const char *s, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress) |
| Create formatted strings using mailbox expandos. More...
|
|
String processing routines to generate the mail index
- Authors
- Michael R. Elkins
- Richard Russon
- Ian Zimmerman
- Pietro Cerutti
- Copyright
- 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, see http://www.gnu.org/licenses/.
Definition in file hdrline.c.
◆ FlagChars
Index into the $flag_chars
variable ($flag_chars)
Enumerator |
---|
FLAG_CHAR_TAGGED | Character denoting a tagged email.
|
FLAG_CHAR_IMPORTANT | Character denoting a important (flagged) email.
|
FLAG_CHAR_DELETED | Character denoting a deleted email.
|
FLAG_CHAR_DELETED_ATTACH | Character denoting a deleted attachment.
|
FLAG_CHAR_REPLIED | Character denoting an email that has been replied to.
|
FLAG_CHAR_OLD | Character denoting an email that has been read.
|
FLAG_CHAR_NEW | Character denoting an unread email.
|
FLAG_CHAR_OLD_THREAD | Character denoting a thread of emails that has been read.
|
FLAG_CHAR_NEW_THREAD | Character denoting a thread containing at least one new email.
|
FLAG_CHAR_SEMPTY | Character denoting a read email, $index_format S expando.
|
FLAG_CHAR_ZEMPTY | Character denoting a read email, $index_format Z expando.
|
Definition at line 83 of file hdrline.c.
◆ CryptChars
Index into the $crypt_chars
variable ($crypt_chars)
Enumerator |
---|
FLAG_CHAR_CRYPT_GOOD_SIGN | Character denoting a message signed with a verified key.
|
FLAG_CHAR_CRYPT_ENCRYPTED | Character denoting a message is PGP-encrypted.
|
FLAG_CHAR_CRYPT_SIGNED | Character denoting a message is signed.
|
FLAG_CHAR_CRYPT_CONTAINS_KEY | Character denoting a message contains a PGP key.
|
FLAG_CHAR_CRYPT_NO_CRYPTO | Character denoting a message has no cryptography information.
|
Definition at line 101 of file hdrline.c.
◆ FieldType
Header types.
Strings for printing headers
Enumerator |
---|
DISP_TO | To: string.
|
DISP_CC | Cc: string.
|
DISP_BCC | Bcc: string.
|
DISP_FROM | From: string.
|
DISP_PLAIN | Empty string.
|
DISP_MAX | |
Definition at line 115 of file hdrline.c.
◆ add_index_color()
static size_t add_index_color |
( |
char * |
buf, |
|
|
size_t |
buflen, |
|
|
MuttFormatFlags |
flags, |
|
|
char |
color |
|
) |
| |
|
static |
Insert a color marker into a string.
- Parameters
-
- Return values
-
The colors are stored as "magic" strings embedded in the text.
Definition at line 135 of file hdrline.c.
◆ get_nth_wchar()
static const char* get_nth_wchar |
( |
struct MbTable * |
table, |
|
|
int |
index |
|
) |
| |
|
static |
Extract one char from a multi-byte table.
- Parameters
-
table | Multi-byte table |
index | Select this character |
- Return values
-
ptr | String pointer to the character |
Extract one multi-byte character from a string table. If the index is invalid, then a space character will be returned. If the character selected is '
' (Ctrl-M), then "" will be returned.
Definition at line 172 of file hdrline.c.
174 if (!table || !table->
chars || (index < 0) || (index >= table->
len))
177 if (table->
chars[index][0] ==
'\r')
180 return table->
chars[index];
◆ make_from_prefix()
static const char* make_from_prefix |
( |
enum FieldType |
disp | ) |
|
|
static |
Create a prefix for an author field.
- Parameters
-
- Return values
-
ptr | Prefix string (do not free it) |
If $from_chars is set, pick an appropriate character from it. If not, use the default prefix: "To", "Cc", etc
Definition at line 191 of file hdrline.c.
194 static char padded[8];
195 static const char *long_prefixes[
DISP_MAX] = {
201 return long_prefixes[disp];
207 snprintf(padded,
sizeof(padded),
"%s ", pchar);
◆ make_from()
Generate a From: field (with optional prefix)
- Parameters
-
env | Envelope of the email |
buf | Buffer to store the result |
buflen | Size of the buffer |
do_lists | Should we check for mailing lists? |
flags | Format flags, see MuttFormatFlags |
Generate the F or L field in $index_format. This is the author, or recipient of the email.
The field can optionally be prefixed by a character from $from_chars. If $from_chars is not set, the prefix will be, "To", "Cc", etc
Definition at line 225 of file hdrline.c.
233 struct AddressList *name = NULL;
◆ make_from_addr()
static void make_from_addr |
( |
struct Envelope * |
env, |
|
|
char * |
buf, |
|
|
size_t |
buflen, |
|
|
bool |
do_lists |
|
) |
| |
|
static |
Create a 'from' address for a reply email.
- Parameters
-
env | Envelope of current email |
buf | Buffer for the result |
buflen | Length of buffer |
do_lists | If true, check for mailing lists |
Definition at line 281 of file hdrline.c.
◆ user_in_addr()
static bool user_in_addr |
( |
struct AddressList * |
al | ) |
|
|
static |
Do any of the addresses refer to the user?
- Parameters
-
- Return values
-
true | If any of the addresses match one of the user's addresses |
Definition at line 311 of file hdrline.c.
◆ user_is_recipient()
static int user_is_recipient |
( |
struct Email * |
e | ) |
|
|
static |
Is the user a recipient of the message.
- Parameters
-
- Return values
-
0 | User is not in list |
1 | User is unique recipient |
2 | User is in the TO list |
3 | User is in the CC list |
4 | User is originator |
5 | Sent to a subscribed mailinglist |
6 | User is in the Reply-To list |
Definition at line 331 of file hdrline.c.
◆ apply_subject_mods()
static char* apply_subject_mods |
( |
struct Envelope * |
env | ) |
|
|
static |
Apply regex modifications to the subject.
- Parameters
-
- Return values
-
ptr | Modified subject |
NULL | No modification made |
Definition at line 372 of file hdrline.c.
◆ thread_is_new()
static bool thread_is_new |
( |
struct Email * |
e | ) |
|
|
static |
Does the email thread contain any new emails?
- Parameters
-
- Return values
-
true | If thread contains new mail |
Definition at line 395 of file hdrline.c.
◆ thread_is_old()
static bool thread_is_old |
( |
struct Email * |
e | ) |
|
|
static |
Does the email thread contain any unread emails?
- Parameters
-
- Return values
-
true | If thread contains unread mail |
Definition at line 405 of file hdrline.c.
◆ index_format_str()
static const char* index_format_str |
( |
char * |
buf, |
|
|
size_t |
buflen, |
|
|
size_t |
col, |
|
|
int |
cols, |
|
|
char |
op, |
|
|
const char * |
src, |
|
|
const char * |
prec, |
|
|
const char * |
if_str, |
|
|
const char * |
else_str, |
|
|
intptr_t |
data, |
|
|
MuttFormatFlags |
flags |
|
) |
| |
|
static |
Format a string for the index list - Implements format_t.
Expando | Description |
%a | Address of the author |
%A | Reply-to address (if present; otherwise: address of author) |
%b | Filename of the original message folder (think mailbox) |
%B | The list to which the email was sent, or else the folder name (b) |
%C | Current message number |
%c | Number of characters (bytes) in the body of the message |
%cr | Number of characters (bytes) in the message, including header |
%D | Date and time of message using $date_format and local timezone |
%d | Date and time of message using $date_format and sender's timezone |
%e | Current message number in thread |
%E | Number of messages in current thread |
%Fp | Like F, but plain. No contextual formatting is applied to recipient name |
%F | Author name, or recipient name if the message is from you |
%f | Sender (address + real name), either From: or Return-Path: |
%Gx | Individual message tag (e.g. notmuch tags/imap flags) |
%g | Message tags (e.g. notmuch tags/imap flags) |
%H | Spam attribute(s) of this message |
%I | Initials of author |
%i | Message-id of the current message |
%J | Message tags (if present, tree unfolded, and != parent's tags) |
%K | The list to which the email was sent (if any; otherwise: empty) |
%L | Like F, except 'lists' are displayed first |
%l | Number of lines in the message |
%M | Number of hidden messages if the thread is collapsed |
%m | Total number of message in the mailbox |
%n | Author's real name (or address if missing) |
%N | Message score |
%O | Like L, except using address instead of name |
%P | Progress indicator for the built-in pager (how much of the file has been displayed) |
%q | Newsgroup name (if compiled with NNTP support) |
%R | Comma separated list of Cc: recipients |
%r | Comma separated list of To: recipients |
%S | Single character status of the message (N/O/D/d/!/r/-) |
%s | Subject of the message |
%t | 'To:' field (recipients) |
%T | The appropriate character from the $to_chars string |
%u | User (login) name of the author |
%v | First name of the author, or the recipient if the message is from you |
%W | Name of organization of author ('Organization:' field) |
%x | 'X-Comment-To:' field (if present and compiled with NNTP support) |
%X | Number of MIME attachments |
%y | 'X-Label:' field (if present) |
%Y | 'X-Label:' field (if present, tree unfolded, and != parent's x-label) |
%zc | Message crypto flags |
%zs | Message status flags |
%zt | Message tag flags |
%Z | Combined message flags |
%(fmt) | Date/time when the message was received |
%[fmt] | Message date/time converted to the local time zone |
%{fmt} | Message date/time converted to sender's time zone |
Definition at line 466 of file hdrline.c.
472 char fmt[128], tmp[1024];
473 char *p = NULL, *tags = NULL;
498 if (reply_to && reply_to->
mailbox)
594 snprintf(fmt + colorlen,
sizeof(fmt) - colorlen,
"%%%sd", prec);
596 snprintf(buf, buflen, fmt, e->
msgno + 1);
607 const char *cp = NULL;
611 if (optional && ((op ==
'[') || (op ==
'(')))
617 char *is = (
char *) prec;
625 while (*is && (*is !=
'?'))
627 int t = strtol(is, &is, 10);
635 t *= (60 * 60 * 24 * 365);
637 t += ((tm.tm_mon * 60 * 60 * 24 * 30) + (tm.tm_mday * 60 * 60 * 24) +
638 (tm.tm_hour * 60 * 60) + (tm.tm_min * 60) + tm.tm_sec);
645 t *= (60 * 60 * 24 * 30);
647 t += ((tm.tm_mday * 60 * 60 * 24) + (tm.tm_hour * 60 * 60) +
648 (tm.tm_min * 60) + tm.tm_sec);
655 t *= (60 * 60 * 24 * 7);
657 t += ((tm.tm_wday * 60 * 60 * 24) + (tm.tm_hour * 60 * 60) +
658 (tm.tm_min * 60) + tm.tm_sec);
667 t += ((tm.tm_hour * 60 * 60) + (tm.tm_min * 60) + tm.tm_sec);
676 t += ((tm.tm_min * 60) + tm.tm_sec);
697 if (((now > j) || (now < (-1 * j))) ^ invert)
714 size_t len = buflen - 1;
716 ((((op ==
'd') || (op ==
'D')) && *cp) ||
717 ((op ==
'{') && (*cp !=
'}')) || ((op ==
'[') && (*cp !=
']')) ||
718 ((op ==
'(') && (*cp !=
')')) || ((op ==
'<') && (*cp !=
'>'))))
723 if (((*cp ==
'Z') || (*cp ==
'z')) && ((op ==
'd') || (op ==
'{')))
756 if ((op ==
'[') || (op ==
'D'))
776 setlocale(LC_TIME,
"C");
777 strftime(tmp,
sizeof(tmp), buf, &tm);
779 setlocale(LC_TIME,
"");
785 if ((len > 0) && (op !=
'd') && (op !=
'D'))
791 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
798 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
814 const bool is_plain = (src[0] ==
'p');
897 bool have_tags =
true;
903 char *parent_tags = NULL;
922 optional = have_tags;
926 mutt_format_s(buf + colorlen, buflen - colorlen, prec, tags);
937 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
939 snprintf(buf + colorlen, buflen - colorlen, fmt, (
int) e->
lines);
942 else if (e->
lines <= 0)
964 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
965 snprintf(buf, buflen, fmt, m->
msg_count);
978 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
984 snprintf(buf + colorlen, buflen - colorlen, fmt, e->
num_hidden);
987 else if (is_index && threads)
1005 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
1006 snprintf(buf, buflen, fmt, e->
score);
1043 if (optional && (tmp[0] ==
'\0'))
1051 if (optional && (tmp[0] ==
'\0'))
1072 snprintf(tmp,
sizeof(tmp),
"%s%s", e->
tree, buf);
1089 const char *wch = NULL;
1100 else if (e->
read && (msg_in_pager != e->
msgno))
1107 snprintf(tmp,
sizeof(tmp),
"%s", wch);
1109 mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
1130 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
1131 snprintf(buf, buflen, fmt,
1142 p = strpbrk(tmp,
"%@");
1163 p = strpbrk(tmp,
" %@");
1195 optional = (count != 0);
1197 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
1198 snprintf(buf, buflen, fmt, count);
1216 struct Email *e_tmp = NULL;
1249 const char *ch = NULL;
1258 else if (e->
read && (msg_in_pager != e->
msgno))
1273 snprintf(tmp,
sizeof(tmp),
"%s", ch);
1276 else if (src[0] ==
'c')
1278 const char *ch =
"";
1292 snprintf(tmp,
sizeof(tmp),
"%s", ch);
1295 else if (src[0] ==
't')
1297 const char *ch =
"";
1305 snprintf(tmp,
sizeof(tmp),
"%s", ch);
1312 mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
1319 const char *first = NULL;
1324 else if (e->
read && (msg_in_pager != e->
msgno))
1340 const char *second =
"";
1357 const char *third =
"";
1365 snprintf(tmp,
sizeof(tmp),
"%s%s%s", first, second, third);
1369 mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
1375 const char *end = src;
1376 static unsigned char recurse = 0;
1378 while ((*end !=
'\0') && (*end !=
'@'))
1380 if ((*end ==
'@') && (recurse < 20))
1397 snprintf(buf, buflen,
"%%%s%c", prec, op);
1404 (intptr_t) hfi, flags);
1409 (intptr_t) hfi, flags);
◆ mutt_make_string()
void mutt_make_string |
( |
char * |
buf, |
|
|
size_t |
buflen, |
|
|
int |
cols, |
|
|
const char * |
s, |
|
|
struct Mailbox * |
m, |
|
|
int |
inpgr, |
|
|
struct Email * |
e, |
|
|
MuttFormatFlags |
flags, |
|
|
const char * |
progress |
|
) |
| |
Create formatted strings using mailbox expandos.
- Parameters
-
Definition at line 1427 of file hdrline.c.
◆ C_CryptChars
Config: User-configurable crypto flags: signed, encrypted etc.
Definition at line 64 of file hdrline.c.
◆ C_FlagChars
Config: User-configurable index flags: tagged, new, etc.
Definition at line 65 of file hdrline.c.
◆ C_FromChars
Config: User-configurable index flags: to address, cc address, etc.
Definition at line 66 of file hdrline.c.
◆ C_ToChars
Config: Indicator characters for the 'To' field in the index.
Definition at line 67 of file hdrline.c.
bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
Check an address list for a mailing list.
struct MbTable * C_ToChars
Config: Indicator characters for the 'To' field in the index.
time_t date_sent
Time when the message was sent (UTC)
int msgno
Number displayed to the user.
char * subject
Email's subject.
struct AddressList bcc
Email's 'Bcc' list.
static void make_from(struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags)
Generate a From: field (with optional prefix)
@ FLAG_CHAR_REPLIED
Character denoting an email that has been replied to.
static const char * get_nth_wchar(struct MbTable *table, int index)
Extract one char from a multi-byte table.
@ MT_COLOR_INDEX_DATE
Index: date field.
@ FLAG_CHAR_CRYPT_SIGNED
Character denoting a message is signed.
char * mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, const char *str)
Apply replacements to a buffer.
static void make_from_addr(struct Envelope *env, char *buf, size_t buflen, bool do_lists)
Create a 'from' address for a reply email.
@ SORT_THREADS
Sort by email threads.
char * nm_email_get_folder_rel_db(struct Mailbox *m, struct Email *e)
Get the folder for a Email from the same level as the notmuch database.
int lines
How many lines in the body of this message?
char * message_id
Message ID.
struct MbTable * C_FromChars
Config: User-configurable index flags: to address, cc address, etc.
char * organization
Organisation header.
@ MT_COLOR_INDEX_LABEL
Index: label field.
static bool user_in_addr(struct AddressList *al)
Do any of the addresses refer to the user?
struct MuttThread * thread
Thread of Emails.
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
@ MT_COLOR_INDEX_AUTHOR
Index: author field (takes a pattern)
@ FLAG_CHAR_NEW_THREAD
Character denoting a thread containing at least one new email.
@ FLAG_CHAR_SEMPTY
Character denoting a read email, $index_format S expando.
size_t email_size(const struct Email *e)
compute the size of an email
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
static const char * make_from_prefix(enum FieldType disp)
Create a prefix for an author field.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_SIGN
Email is signed.
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
#define TAILQ_EMPTY(head)
#define TAILQ_FOREACH(var, head, field)
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, enum MessageInThread mit)
Count the messages in a thread.
void mutt_format_s_x(char *buf, size_t buflen, const char *prec, const char *s, bool arboreal)
Format a string like snprintf()
char * x_comment_to
List of 'X-comment-to' fields.
bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
Search list of addresses for a mailing list.
#define SORT_MASK
Mask for the sort id.
@ MT_COLOR_INDEX_NUMBER
Index: index number.
#define STAILQ_EMPTY(head)
@ FLAG_CHAR_TAGGED
Character denoting a tagged email.
short recipient
User_is_recipient()'s return value, cached.
bool zoccident
True, if west of UTC, False if east.
@ FLAG_CHAR_DELETED
Character denoting a deleted email.
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
char * tree
Character string to print thread tree.
char * mutt_strn_copy(char *dest, const char *src, size_t len, size_t dsize)
Copy a sub-string into a buffer.
struct MuttThread * prev
Previous sibling Thread.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
void * mutt_hash_find(const struct HashTable *table, const char *strkey)
Find the HashElem data in a Hash Table element using a key.
struct MuttThread * parent
Parent of this Thread.
struct AddressList reply_to
Email's 'reply-to'.
WHERE bool C_SaveAddress
Config: Use sender's full address as a default save folder.
bool old
Email is seen, but unread.
time_t received
Time when the message was placed in the mailbox.
#define TAILQ_FIRST(head)
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
struct AddressList cc
Email's 'Cc' list.
static bool thread_is_new(struct Email *e)
Does the email thread contain any new emails?
static bool thread_is_old(struct Email *e)
Does the email thread contain any unread emails?
enum MailboxType type
Mailbox type.
bool tagged
Email is tagged.
int mutt_count_body_parts(struct Mailbox *m, struct Email *e)
Count the MIME Body parts.
unsigned int zminutes
Minutes away from UTC.
LOFF_T length
length (in bytes) of attachment
#define APPLICATION_PGP
Use PGP to encrypt/sign.
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
struct Email * message
Email this Thread refers to.
int len
Number of characters.
int msg_count
Total number of messages.
struct MbTable * C_CryptChars
Config: User-configurable crypto flags: signed, encrypted etc.
char ** chars
The array of multibyte character strings.
static int user_is_recipient(struct Email *e)
Is the user a recipient of the message.
@ FLAG_CHAR_OLD
Character denoting an email that has been read.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
struct AddressList to
Email's 'To' list.
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
struct Envelope * env
Envelope information.
@ FLAG_CHAR_CRYPT_NO_CRYPTO
Character denoting a message has no cryptography information.
@ FLAG_CHAR_NEW
Character denoting an unread email.
bool flagged
Marked important?
unsigned int zhours
Hours away from UTC.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
bool first_mailing_list(char *buf, size_t buflen, struct AddressList *al)
Get the first mailing list in the list of addresses.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
@ MT_COLOR_INDEX_SIZE
Index: size field.
char * disp_subj
Display subject (modified copy of subject)
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
@ FLAG_CHAR_CRYPT_CONTAINS_KEY
Character denoting a message contains a PGP key.
time_t mutt_date_epoch(void)
Return the number of seconds since the Unix epoch.
static char * apply_subject_mods(struct Envelope *env)
Apply regex modifications to the subject.
bool collapsed
Is this message part of a collapsed thread?
@ FLAG_CHAR_ZEMPTY
Character denoting a read email, $index_format Z expando.
#define MUTT_DATE_NOW
Constant representing the 'current time', see: mutt_date_gmtime(), mutt_date_localtime()
@ MT_COLOR_INDEX_TAG
Index: tag field (g, takes a pattern)
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
char * mailbox
Mailbox and host address.
char * newsgroups
List of newsgroups.
bool deleted
Email is deleted.
void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string with tree characters.
struct AddressList from
Email's 'From' list.
@ FLAG_CHAR_IMPORTANT
Character denoting a important (flagged) email.
@ MUTT_SPECIAL_INDEX
Colour indicator.
@ MT_COLOR_INDEX
Index: default colour (takes a pattern)
WHERE short C_Sort
Config: Sort method for the index.
#define TAILQ_NEXT(elm, field)
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string.
@ FLAG_CHAR_DELETED_ATTACH
Character denoting a deleted attachment.
struct TagList tags
For drivers that support server tagging.
struct MbTable * C_FlagChars
Config: User-configurable index flags: tagged, new, etc.
@ MT_COLOR_INDEX_FLAGS
Index: flags field (takes a pattern)
const char * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
struct tm mutt_date_gmtime(time_t t)
Converts calendar time to a broken-down time structure expressed in UTC timezone.
bool recip_valid
Is_recipient is valid.
struct Buffer spam
Spam header.
@ MT_COLOR_INDEX_SUBJECT
Index: subject field (takes a pattern)
bool attach_del
Has an attachment marked for deletion.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
WHERE struct HashTable * TagFormats
Hash Table of tag-formats (tag -> format string)
@ FLAG_CHAR_CRYPT_ENCRYPTED
Character denoting a message is PGP-encrypted.
WHERE char * C_DateFormat
Config: strftime format string for the d expando.
bool replied
Email has been replied to.
The envelope/body of an email.
static size_t add_index_color(char *buf, size_t buflen, MuttFormatFlags flags, char color)
Insert a color marker into a string.
@ FLAG_CHAR_CRYPT_GOOD_SIGN
Character denoting a message signed with a verified key.
struct ReplaceList SubjectRegexList
List of regexes to tidy the view of the email's subject.
#define SEC_GOODSIGN
Email has a valid signature.
bool mutt_mb_get_initials(const char *name, char *buf, size_t buflen)
Turn a name into initials.
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
const char * mutt_addr_for_display(const struct Address *a)
Convert an Address for display purposes.
static const char * index_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format a string for the index list - Implements format_t.
struct Body * body
List of MIME parts.
#define mutt_thread_contains_unread(e)
@ DISP_PLAIN
Empty string.
@ FLAG_CHAR_OLD_THREAD
Character denoting a thread of emails that has been read.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)