NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
msg_commit()

Save changes to an email. More...

+ Collaboration diagram for msg_commit():

Functions

static int comp_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
int imap_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
int maildir_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int mbox_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int mmdf_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int mh_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int nm_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 

Detailed Description

Save changes to an email.

Parameters
mMailbox
msgMessage to commit
Return values
0Success
-1Failure
Precondition
m is not NULL
msg is not NULL

Function Documentation

◆ comp_msg_commit()

static int comp_msg_commit ( struct Mailbox * m,
struct Message * msg )
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 756 of file compress.c.

757{
758 if (!m->compress_info)
759 return -1;
760
761 struct CompressInfo *ci = m->compress_info;
762
763 const struct MxOps *ops = ci->child_ops;
764 if (!ops)
765 return -1;
766
767 /* Delegate */
768 return ops->msg_commit(m, msg);
769}
Private data for compress.
Definition lib.h:61
const struct MxOps * child_ops
callbacks of de-compressed file
Definition lib.h:66
void * compress_info
Compressed mbox module private data.
Definition mailbox.h:120
Definition mxapi.h:87
int(* msg_commit)(struct Mailbox *m, struct Message *msg)
Definition mxapi.h:243

◆ imap_msg_commit()

int imap_msg_commit ( struct Mailbox * m,
struct Message * msg )

Save changes to an email - Implements MxOps::msg_commit() -.

Note
May also return EOF Failure, see errno

Definition at line 2189 of file message.c.

2190{
2191 int rc = mutt_file_fclose(&msg->fp);
2192 if (rc != 0)
2193 return rc;
2194
2195 return imap_append_message(m, msg);
2196}
#define mutt_file_fclose(FP)
Definition file.h:139
int imap_append_message(struct Mailbox *m, struct Message *msg)
Write an email back to the server.
Definition message.c:1543
FILE * fp
pointer to the message data
Definition message.h:35
+ Here is the call graph for this function:

◆ maildir_msg_commit()

int maildir_msg_commit ( struct Mailbox * m,
struct Message * msg )

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 628 of file message.c.

629{
630 return maildir_commit_message(m, msg, NULL);
631}
static int maildir_commit_message(struct Mailbox *m, struct Message *msg, struct Email *e)
Commit a message to a maildir folder.
Definition message.c:364
+ Here is the call graph for this function:

◆ mbox_msg_commit()

static int mbox_msg_commit ( struct Mailbox * m,
struct Message * msg )
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1497 of file mbox.c.

1498{
1499 if (fputc('\n', msg->fp) == EOF)
1500 return -1;
1501
1502 if ((fflush(msg->fp) == EOF) || (fsync(fileno(msg->fp)) == -1))
1503 {
1504 mutt_perror(_("Can't write message"));
1505 return -1;
1506 }
1507
1508 return 0;
1509}
#define mutt_perror(...)
Definition logging2.h:95
#define _(a)
Definition message.h:28

◆ mmdf_msg_commit()

static int mmdf_msg_commit ( struct Mailbox * m,
struct Message * msg )
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1618 of file mbox.c.

1619{
1620 if (fputs(MMDF_SEP, msg->fp) == EOF)
1621 return -1;
1622
1623 if ((fflush(msg->fp) == EOF) || (fsync(fileno(msg->fp)) == -1))
1624 {
1625 mutt_perror(_("Can't write message"));
1626 return -1;
1627 }
1628
1629 return 0;
1630}
#define MMDF_SEP
Definition lib.h:63

◆ mh_msg_commit()

static int mh_msg_commit ( struct Mailbox * m,
struct Message * msg )
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1169 of file mh.c.

1170{
1171 return mh_commit_msg(m, msg, NULL, true);
1172}
static int mh_commit_msg(struct Mailbox *m, struct Message *msg, struct Email *e, bool updseq)
Commit a message to an MH folder.
Definition mh.c:243
+ Here is the call graph for this function:

◆ nm_msg_commit()

static int nm_msg_commit ( struct Mailbox * m,
struct Message * msg )
static

Save changes to an email - Implements MxOps::msg_commit() -.

Return values
-1Always

Definition at line 2435 of file notmuch.c.

2436{
2437 mutt_error(_("Can't write to virtual folder"));
2438 return -1;
2439}
#define mutt_error(...)
Definition logging2.h:94