NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
lib.h File Reference
#include <stdbool.h>
#include <stdio.h>
#include "core/lib.h"
#include "edata.h"
#include "mx.h"
+ Include dependency graph for lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int maildir_check_empty (const char *path)
 Is the mailbox empty. More...
 
void maildir_gen_flags (char *dest, size_t destlen, struct Email *e)
 Generate the Maildir flags for an email. More...
 
bool maildir_msg_open_new (struct Mailbox *m, struct Message *msg, const struct Email *e)
 Open a new message in a Mailbox - Implements MxOps::msg_open_new() More...
 
FILE * maildir_open_find_message (const char *folder, const char *msg, char **newname)
 Find a new. More...
 
void maildir_parse_flags (struct Email *e, const char *path)
 Parse Maildir file flags. More...
 
struct Emailmaildir_parse_message (enum MailboxType type, const char *fname, bool is_old, struct Email *e)
 Actually parse a maildir message. More...
 
struct Emailmaildir_parse_stream (enum MailboxType type, FILE *fp, const char *fname, bool is_old, struct Email *e)
 Parse a Maildir message. More...
 
bool maildir_sync_mailbox_message (struct Mailbox *m, int msgno, struct HeaderCache *hc)
 Save changes to the mailbox. More...
 
bool maildir_update_flags (struct Mailbox *m, struct Email *e_old, struct Email *e_new)
 Update the mailbox flags. More...
 
int mh_check_empty (const char *path)
 Is mailbox empty. More...
 
int mh_sync_mailbox_message (struct Mailbox *m, int msgno, struct HeaderCache *hc)
 Save changes to the mailbox. More...
 

Variables

bool C_MaildirTrash
 Config: Use the maildir 'trashed' flag, rather than deleting. More...
 
struct MxOps MxMaildirOps
 Maildir Mailbox - Implements MxOps. More...
 
struct MxOps MxMhOps
 MH Mailbox - Implements MxOps. More...
 

Detailed Description

Maildir local mailbox type

Authors
  • Richard Russon

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 lib.h.

Function Documentation

◆ maildir_check_empty()

int maildir_check_empty ( const char *  path)

Is the mailbox empty.

Parameters
pathMailbox to check
Return values
1Mailbox is empty
0Mailbox contains mail
-1Error

Definition at line 1021 of file maildir.c.

1022 {
1023  DIR *dp = NULL;
1024  struct dirent *de = NULL;
1025  int rc = 1; /* assume empty until we find a message */
1026  char realpath[PATH_MAX];
1027  int iter = 0;
1028 
1029  /* Strategy here is to look for any file not beginning with a period */
1030 
1031  do
1032  {
1033  /* we do "cur" on the first iteration since it's more likely that we'll
1034  * find old messages without having to scan both subdirs */
1035  snprintf(realpath, sizeof(realpath), "%s/%s", path, (iter == 0) ? "cur" : "new");
1036  dp = opendir(realpath);
1037  if (!dp)
1038  return -1;
1039  while ((de = readdir(dp)))
1040  {
1041  if (*de->d_name != '.')
1042  {
1043  rc = 0;
1044  break;
1045  }
1046  }
1047  closedir(dp);
1048  iter++;
1049  } while (rc && iter < 2);
1050 
1051  return rc;
1052 }

◆ maildir_gen_flags()

void maildir_gen_flags ( char *  dest,
size_t  destlen,
struct Email e 
)

Generate the Maildir flags for an email.

Parameters
destBuffer for the result
destlenLength of buffer
eEmail

Definition at line 178 of file maildir.c.

179 {
180  *dest = '\0';
181 
182  const char *flags = NULL;
183 
185  if (edata)
186  flags = edata->maildir_flags;
187 
188  /* The maildir specification requires that all files in the cur
189  * subdirectory have the :unique string appended, regardless of whether
190  * or not there are any flags. If .old is set, we know that this message
191  * will end up in the cur directory, so we include it in the following
192  * test even though there is no associated flag. */
193 
194  if (e->flagged || e->replied || e->read || e->deleted || e->old || flags)
195  {
196  char tmp[1024];
197  snprintf(tmp, sizeof(tmp), "%s%s%s%s%s", e->flagged ? "F" : "", e->replied ? "R" : "",
198  e->read ? "S" : "", e->deleted ? "T" : "", NONULL(flags));
199  if (flags)
200  qsort(tmp, strlen(tmp), 1, ch_compare);
201  snprintf(dest, destlen, ":2,%s", tmp);
202  }
203 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_msg_open_new()

bool maildir_msg_open_new ( struct Mailbox m,
struct Message msg,
const struct Email e 
)

Open a new message in a Mailbox - Implements MxOps::msg_open_new()

Open a new (temporary) message in a maildir folder.

Note
This uses almost the maildir file name format, but with a {cur,new} prefix.

Definition at line 1458 of file maildir.c.

1459 {
1460  int fd;
1461  char path[PATH_MAX];
1462  char suffix[16];
1463  char subdir[16];
1464 
1465  if (e)
1466  {
1467  struct Email tmp = *e;
1468  tmp.deleted = false;
1469  tmp.edata = NULL;
1470  maildir_gen_flags(suffix, sizeof(suffix), &tmp);
1471  }
1472  else
1473  *suffix = '\0';
1474 
1475  if (e && (e->read || e->old))
1476  mutt_str_copy(subdir, "cur", sizeof(subdir));
1477  else
1478  mutt_str_copy(subdir, "new", sizeof(subdir));
1479 
1480  mode_t omask = umask(mh_umask(m));
1481  while (true)
1482  {
1483  snprintf(path, sizeof(path), "%s/tmp/%s.%lld.R%" PRIu64 ".%s%s",
1484  mailbox_path(m), subdir, (long long) mutt_date_epoch(),
1485  mutt_rand64(), NONULL(ShortHostname), suffix);
1486 
1487  mutt_debug(LL_DEBUG2, "Trying %s\n", path);
1488 
1489  fd = open(path, O_WRONLY | O_EXCL | O_CREAT, 0666);
1490  if (fd == -1)
1491  {
1492  if (errno != EEXIST)
1493  {
1494  umask(omask);
1495  mutt_perror(path);
1496  return false;
1497  }
1498  }
1499  else
1500  {
1501  mutt_debug(LL_DEBUG2, "Success\n");
1502  msg->path = mutt_str_dup(path);
1503  break;
1504  }
1505  }
1506  umask(omask);
1507 
1508  msg->fp = fdopen(fd, "w");
1509  if (!msg->fp)
1510  {
1511  FREE(&msg->path);
1512  close(fd);
1513  unlink(path);
1514  return false;
1515  }
1516 
1517  return true;
1518 }
+ Here is the call graph for this function:

◆ maildir_open_find_message()

FILE* maildir_open_find_message ( const char *  folder,
const char *  msg,
char **  newname 
)

Find a new.

Parameters
[in]folderMaildir path
[in]msgEmail path
[out]newnameNew name, if it has moved
Return values
ptrFile handle

Definition at line 974 of file maildir.c.

975 {
976  static unsigned int new_hits = 0, cur_hits = 0; /* simple dynamic optimization */
977 
978  struct Buffer *unique = mutt_buffer_pool_get();
979  maildir_canon_filename(unique, msg);
980 
981  FILE *fp = maildir_open_find_message_dir(folder, mutt_buffer_string(unique),
982  (new_hits > cur_hits) ? "new" : "cur", newname);
983  if (fp || (errno != ENOENT))
984  {
985  if ((new_hits < UINT_MAX) && (cur_hits < UINT_MAX))
986  {
987  new_hits += ((new_hits > cur_hits) ? 1 : 0);
988  cur_hits += ((new_hits > cur_hits) ? 0 : 1);
989  }
990 
991  goto cleanup;
992  }
994  (new_hits > cur_hits) ? "cur" : "new", newname);
995  if (fp || (errno != ENOENT))
996  {
997  if ((new_hits < UINT_MAX) && (cur_hits < UINT_MAX))
998  {
999  new_hits += ((new_hits > cur_hits) ? 0 : 1);
1000  cur_hits += ((new_hits > cur_hits) ? 1 : 0);
1001  }
1002 
1003  goto cleanup;
1004  }
1005 
1006  fp = NULL;
1007 
1008 cleanup:
1009  mutt_buffer_pool_release(&unique);
1010 
1011  return fp;
1012 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_parse_flags()

void maildir_parse_flags ( struct Email e,
const char *  path 
)

Parse Maildir file flags.

Parameters
eEmail
pathPath to email file

Definition at line 796 of file maildir.c.

797 {
798  char *q = NULL;
799 
800  e->flagged = false;
801  e->read = false;
802  e->replied = false;
803 
805 
806  char *p = strrchr(path, ':');
807  if (p && mutt_str_startswith(p + 1, "2,"))
808  {
809  p += 3;
810 
811  mutt_str_replace(&edata->maildir_flags, p);
812  q = edata->maildir_flags;
813 
814  while (*p)
815  {
816  switch (*p)
817  {
818  case 'F':
819  e->flagged = true;
820  break;
821 
822  case 'R': /* replied */
823  e->replied = true;
824  break;
825 
826  case 'S': /* seen */
827  e->read = true;
828  break;
829 
830  case 'T': /* trashed */
831  if (!e->flagged || !C_FlagSafe)
832  {
833  e->trash = true;
834  e->deleted = true;
835  }
836  break;
837 
838  default:
839  *q++ = *p;
840  break;
841  }
842  p++;
843  }
844  }
845 
846  if (q == edata->maildir_flags)
847  FREE(&edata->maildir_flags);
848  else if (q)
849  *q = '\0';
850 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_parse_message()

struct Email* maildir_parse_message ( enum MailboxType  type,
const char *  fname,
bool  is_old,
struct Email e 
)

Actually parse a maildir message.

Parameters
typeMailbox type, e.g. MUTT_MAILDIR
fnameMessage filename
is_oldtrue, if the email is old (read)
eEmail to populate (OPTIONAL)
Return values
ptrPopulated Email

This may also be used to fill out a fake header structure generated by lazy maildir parsing.

Definition at line 908 of file maildir.c.

910 {
911  FILE *fp = fopen(fname, "r");
912  if (!fp)
913  return NULL;
914 
915  e = maildir_parse_stream(type, fp, fname, is_old, e);
916  mutt_file_fclose(&fp);
917  return e;
918 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_parse_stream()

struct Email* maildir_parse_stream ( enum MailboxType  type,
FILE *  fp,
const char *  fname,
bool  is_old,
struct Email e 
)

Parse a Maildir message.

Parameters
typeMailbox type, e.g. MUTT_MAILDIR
fpMessage file handle
fnameMessage filename
is_oldtrue, if the email is old (read)
eEmail
Return values
ptrPopulated Email

Actually parse a maildir message. This may also be used to fill out a fake header structure generated by lazy maildir parsing.

Definition at line 864 of file maildir.c.

866 {
867  if (!e)
868  {
869  e = email_new();
870  e->edata = maildir_edata_new();
872  }
873  e->env = mutt_rfc822_read_header(fp, e, false, false);
874 
875  struct stat st;
876  fstat(fileno(fp), &st);
877 
878  if (!e->received)
879  e->received = e->date_sent;
880 
881  /* always update the length since we have fresh information available. */
882  e->body->length = st.st_size - e->body->offset;
883 
884  e->index = -1;
885 
886  if (type == MUTT_MAILDIR)
887  {
888  /* maildir stores its flags in the filename, so ignore the
889  * flags in the header of the message */
890 
891  e->old = is_old;
892  maildir_parse_flags(e, fname);
893  }
894  return e;
895 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_sync_mailbox_message()

bool maildir_sync_mailbox_message ( struct Mailbox m,
int  msgno,
struct HeaderCache hc 
)

Save changes to the mailbox.

Parameters
mMailbox
msgnoIndex number
hcHeader cache handle
Return values
trueSuccess
falseError

Definition at line 928 of file maildir.c.

929 {
930  struct Email *e = m->emails[msgno];
931  if (!e)
932  return false;
933 
934  if (e->deleted && !C_MaildirTrash)
935  {
936  char path[PATH_MAX];
937  snprintf(path, sizeof(path), "%s/%s", mailbox_path(m), e->path);
938 #ifdef USE_HCACHE
939  if (hc)
940  {
941  const char *key = e->path + 3;
942  size_t keylen = maildir_hcache_keylen(key);
943  mutt_hcache_delete_record(hc, key, keylen);
944  }
945 #endif
946  unlink(path);
947  }
948  else if (e->changed || e->attach_del ||
949  ((C_MaildirTrash || e->trash) && (e->deleted != e->trash)))
950  {
951  if (maildir_sync_message(m, msgno) == -1)
952  return false;
953  }
954 
955 #ifdef USE_HCACHE
956  if (hc && e->changed)
957  {
958  const char *key = e->path + 3;
959  size_t keylen = maildir_hcache_keylen(key);
960  mutt_hcache_store(hc, key, keylen, e, 0);
961  }
962 #endif
963 
964  return true;
965 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildir_update_flags()

bool maildir_update_flags ( struct Mailbox m,
struct Email e_old,
struct Email e_new 
)

Update the mailbox flags.

Parameters
mMailbox
e_oldOld Email
e_newNew Email
Return values
trueIf the flags changed
falseOtherwise

Definition at line 124 of file shared.c.

125 {
126  if (!m)
127  return false;
128 
129  /* save the global state here so we can reset it at the
130  * end of list block if required. */
131  bool context_changed = m->changed;
132 
133  /* user didn't modify this message. alter the flags to match the
134  * current state on disk. This may not actually do
135  * anything. mutt_set_flag() will just ignore the call if the status
136  * bits are already properly set, but it is still faster not to pass
137  * through it */
138  if (e_old->flagged != e_new->flagged)
139  mutt_set_flag(m, e_old, MUTT_FLAG, e_new->flagged);
140  if (e_old->replied != e_new->replied)
141  mutt_set_flag(m, e_old, MUTT_REPLIED, e_new->replied);
142  if (e_old->read != e_new->read)
143  mutt_set_flag(m, e_old, MUTT_READ, e_new->read);
144  if (e_old->old != e_new->old)
145  mutt_set_flag(m, e_old, MUTT_OLD, e_new->old);
146 
147  /* mutt_set_flag() will set this, but we don't need to
148  * sync the changes we made because we just updated the
149  * context to match the current on-disk state of the
150  * message. */
151  bool header_changed = e_old->changed;
152  e_old->changed = false;
153 
154  /* if the mailbox was not modified before we made these
155  * changes, unset the changed flag since nothing needs to
156  * be synchronized. */
157  if (!context_changed)
158  m->changed = false;
159 
160  return header_changed;
161 }
+ Here is the caller graph for this function:

◆ mh_check_empty()

int mh_check_empty ( const char *  path)

Is mailbox empty.

Parameters
pathMailbox to check
Return values
1Mailbox is empty
0Mailbox contains mail
-1Error

Definition at line 161 of file mh.c.

162 {
163  struct dirent *de = NULL;
164  int rc = 1; /* assume empty until we find a message */
165 
166  DIR *dp = opendir(path);
167  if (!dp)
168  return -1;
169  while ((de = readdir(dp)))
170  {
171  if (mh_valid_message(de->d_name))
172  {
173  rc = 0;
174  break;
175  }
176  }
177  closedir(dp);
178 
179  return rc;
180 }
+ Here is the call graph for this function:

◆ mh_sync_mailbox_message()

int mh_sync_mailbox_message ( struct Mailbox m,
int  msgno,
struct HeaderCache hc 
)

Save changes to the mailbox.

Parameters
mMailbox
msgnoIndex number
hcHeader cache handle
Return values
0Success
-1Error

Definition at line 738 of file mh.c.

739 {
740  if (!m || !m->emails || (msgno >= m->msg_count))
741  return -1;
742 
743  struct Email *e = m->emails[msgno];
744  if (!e)
745  return -1;
746 
747  if (e->deleted)
748  {
749  char path[PATH_MAX];
750  snprintf(path, sizeof(path), "%s/%s", mailbox_path(m), e->path);
751  if (C_MhPurge)
752  {
753 #ifdef USE_HCACHE
754  if (hc)
755  {
756  const char *key = e->path;
757  size_t keylen = strlen(key);
758  mutt_hcache_delete_record(hc, key, keylen);
759  }
760 #endif
761  unlink(path);
762  }
763  else
764  {
765  /* MH just moves files out of the way when you delete them */
766  if (*e->path != ',')
767  {
768  char tmp[PATH_MAX];
769  snprintf(tmp, sizeof(tmp), "%s/,%s", mailbox_path(m), e->path);
770  unlink(tmp);
771  rename(path, tmp);
772  }
773  }
774  }
775  else if (e->changed || e->attach_del)
776  {
777  if (mh_sync_message(m, msgno) == -1)
778  return -1;
779  }
780 
781 #ifdef USE_HCACHE
782  if (hc && e->changed)
783  {
784  const char *key = e->path;
785  size_t keylen = strlen(key);
786  mutt_hcache_store(hc, key, keylen, e, 0);
787  }
788 #endif
789 
790  return 0;
791 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ C_MaildirTrash

bool C_MaildirTrash

Config: Use the maildir 'trashed' flag, rather than deleting.

Definition at line 42 of file config.c.

◆ MxMaildirOps

struct MxOps MxMaildirOps

Maildir Mailbox - Implements MxOps.

Definition at line 1616 of file maildir.c.

◆ MxMhOps

struct MxOps MxMhOps

MH Mailbox - Implements MxOps.

Definition at line 1225 of file mh.c.

Email::date_sent
time_t date_sent
Time when the message was sent (UTC)
Definition: email.h:82
Email::msgno
int msgno
Number displayed to the user.
Definition: email.h:87
MUTT_FLAG
@ MUTT_FLAG
Flagged messages.
Definition: mutt.h:102
maildir_parse_flags
void maildir_parse_flags(struct Email *e, const char *path)
Parse Maildir file flags.
Definition: maildir.c:796
maildir_parse_stream
struct Email * maildir_parse_stream(enum MailboxType type, FILE *fp, const char *fname, bool is_old, struct Email *e)
Parse a Maildir message.
Definition: maildir.c:864
NONULL
#define NONULL(x)
Definition: string2.h:37
C_MhPurge
bool C_MhPurge
Config: Really delete files in MH mailboxes.
Definition: config.c:43
Mailbox::emails
struct Email ** emails
Array of Emails.
Definition: mailbox.h:99
Buffer
String manipulation buffer.
Definition: buffer.h:33
Body::offset
LOFF_T offset
offset where the actual data begins
Definition: body.h:44
maildir_hcache_keylen
size_t maildir_hcache_keylen(const char *fn)
Calculate the length of the Maildir path.
Definition: maildir.c:577
mutt_file_fclose
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:153
mutt_str_dup
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:370
FREE
#define FREE(x)
Definition: memory.h:40
mutt_perror
#define mutt_perror(...)
Definition: logging.h:85
Email::path
char * path
Path of Email (for local Mailboxes)
Definition: email.h:92
Email::edata_free
void(* edata_free)(void **ptr)
Free the private data attached to the Email.
Definition: email.h:117
PATH_MAX
#define PATH_MAX
Definition: mutt.h:44
mutt_buffer_pool_release
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
email_new
struct Email * email_new(void)
Create a new Email.
Definition: email.c:72
MUTT_READ
@ MUTT_READ
Messages that have been read.
Definition: mutt.h:96
Email::old
bool old
Email is seen, but unread.
Definition: email.h:50
Email::received
time_t received
Time when the message was placed in the mailbox.
Definition: email.h:83
mutt_buffer_pool_get
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
MaildirEmailData
Maildir-specific Email data -.
Definition: edata.h:33
Message::path
char * path
path to temp file
Definition: mx.h:97
Body::length
LOFF_T length
length (in bytes) of attachment
Definition: body.h:45
Mailbox::changed
bool changed
Mailbox has been modified.
Definition: mailbox.h:114
maildir_sync_message
int maildir_sync_message(struct Mailbox *m, int msgno)
Sync an email to a Maildir folder.
Definition: maildir.c:380
mh_sync_message
int mh_sync_message(struct Mailbox *m, int msgno)
Sync an email to an MH folder.
Definition: mh.c:445
Mailbox::msg_count
int msg_count
Total number of messages.
Definition: mailbox.h:91
Email::env
struct Envelope * env
Envelope information.
Definition: email.h:90
mutt_rand64
uint64_t mutt_rand64(void)
Create a 64-bit random number.
Definition: random.c:129
mutt_debug
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
MUTT_REPLIED
@ MUTT_REPLIED
Messages that have been replied to.
Definition: mutt.h:95
C_FlagSafe
WHERE bool C_FlagSafe
Config: Protect flagged messages from deletion.
Definition: mutt_globals.h:146
Message::fp
FILE * fp
pointer to the message data
Definition: mx.h:96
Email::flagged
bool flagged
Marked important?
Definition: email.h:43
mutt_buffer_string
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
maildir_gen_flags
void maildir_gen_flags(char *dest, size_t destlen, struct Email *e)
Generate the Maildir flags for an email.
Definition: maildir.c:178
mutt_date_epoch
time_t mutt_date_epoch(void)
Return the number of seconds since the Unix epoch.
Definition: date.c:416
Email::trash
bool trash
Message is marked as trashed on disk (used by the maildir_trash option)
Definition: email.h:60
mutt_str_replace
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:446
MUTT_OLD
@ MUTT_OLD
Old messages.
Definition: mutt.h:94
mh_valid_message
bool mh_valid_message(const char *s)
Is this a valid MH message filename.
Definition: mh.c:144
mutt_hcache_store
int mutt_hcache_store(struct HeaderCache *hc, const char *key, size_t keylen, struct Email *e, uint32_t uidvalidity)
Multiplexor for StoreOps::store.
Definition: hcache.c:527
Email::deleted
bool deleted
Email is deleted.
Definition: email.h:45
Email::edata
void * edata
Driver-specific data.
Definition: email.h:111
ShortHostname
WHERE char * ShortHostname
Short version of the hostname.
Definition: mutt_globals.h:50
mutt_hcache_delete_record
int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen)
Multiplexor for StoreOps::delete_record.
Definition: hcache.c:604
C_MaildirTrash
bool C_MaildirTrash
Config: Use the maildir 'trashed' flag, rather than deleting.
Definition: config.c:42
ch_compare
static int ch_compare(const void *a, const void *b)
qsort callback to sort characters
Definition: maildir.c:167
Email::index
int index
The absolute (unsorted) message number.
Definition: email.h:86
mutt_rfc822_read_header
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
parses an RFC822 header
Definition: parse.c:1112
maildir_edata_get
struct MaildirEmailData * maildir_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:64
maildir_open_find_message_dir
static FILE * maildir_open_find_message_dir(const char *folder, const char *unique, const char *subfolder, char **newname)
Find a message in a maildir folder.
Definition: maildir.c:742
MUTT_MAILDIR
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition: mailbox.h:51
Email::attach_del
bool attach_del
Has an attachment marked for deletion.
Definition: email.h:49
mailbox_path
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:206
Email::replied
bool replied
Email has been replied to.
Definition: email.h:54
Email
The envelope/body of an email.
Definition: email.h:37
mutt_str_startswith
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:160
mutt_set_flag
#define mutt_set_flag(m, e, flag, bf)
Definition: protos.h:67
mh_umask
mode_t mh_umask(struct Mailbox *m)
Create a umask from the mailbox directory.
Definition: shared.c:54
Email::read
bool read
Email is read.
Definition: email.h:51
maildir_edata_free
void maildir_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
Definition: edata.c:38
LL_DEBUG2
@ LL_DEBUG2
Log at debug level 2.
Definition: logging.h:41
maildir_edata_new
struct MaildirEmailData * maildir_edata_new(void)
Create a new MaildirEmailData object.
Definition: edata.c:53
Email::changed
bool changed
Email has been edited.
Definition: email.h:48
Email::body
struct Body * body
List of MIME parts.
Definition: email.h:91
maildir_canon_filename
void maildir_canon_filename(struct Buffer *dest, const char *src)
Generate the canonical filename for a Maildir folder.
Definition: maildir.c:712
mutt_str_copy
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:716