NeoMutt  2025-12-11-1061-g88ae84
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()

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

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

Definition at line 718 of file compress.c.

719{
720 if (!m->compress_info)
721 return -1;
722
723 struct CompressInfo *ci = m->compress_info;
724
725 const struct MxOps *ops = ci->child_ops;
726 if (!ops)
727 return -1;
728
729 /* Delegate */
730 return ops->msg_commit(m, msg);
731}
Private data for compress.
Definition lib.h:62
const struct MxOps * child_ops
callbacks of de-compressed file
Definition lib.h:67
void * compress_info
Compressed mbox module private data.
Definition mailbox.h:123
Definition mxapi.h:98
int(* msg_commit)(struct Mailbox *m, struct Message *msg)
Definition mxapi.h:254

◆ 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 2200 of file message.c.

2201{
2202 int rc = mutt_file_fclose(&msg->fp);
2203 if (rc != 0)
2204 return rc;
2205
2206 return imap_append_message(m, msg);
2207}
#define mutt_file_fclose(FP)
Definition file.h:144
int imap_append_message(struct Mailbox *m, struct Message *msg)
Write an email back to the server.
Definition message.c:1549
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 629 of file message.c.

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

◆ mbox_msg_commit()

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

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

Definition at line 1530 of file mbox.c.

1531{
1532 if (fputs(MBOX_SEP, msg->fp) == EOF)
1533 return -1;
1534
1535 if ((fflush(msg->fp) == EOF) || (fsync(fileno(msg->fp)) == -1))
1536 {
1537 mutt_perror(_("Can't write message"));
1538 return -1;
1539 }
1540
1541 return 0;
1542}
#define mutt_perror(...)
Definition logging2.h:95
#define _(a)
Definition message.h:28
#define MBOX_SEP
Definition mx.h:69

◆ mmdf_msg_commit()

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

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

Definition at line 1651 of file mbox.c.

1652{
1653 if (fputs(MMDF_SEP, msg->fp) == EOF)
1654 return -1;
1655
1656 if ((fflush(msg->fp) == EOF) || (fsync(fileno(msg->fp)) == -1))
1657 {
1658 mutt_perror(_("Can't write message"));
1659 return -1;
1660 }
1661
1662 return 0;
1663}
#define MMDF_SEP
Definition lib.h:63

◆ mh_msg_commit()

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

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

Definition at line 1176 of file mh.c.

1177{
1178 return mh_commit_msg(m, msg, NULL, true);
1179}
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()

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 2407 of file notmuch.c.

2408{
2409 mutt_error(_("Can't write to virtual folder"));
2410 return -1;
2411}
#define mutt_error(...)
Definition logging2.h:94