Edit an email or view it in an external editor.
64 bool old_append = m->
append;
79 mutt_error(
_(
"could not create temporary folder: %s"), strerror(errno));
94 mutt_error(
_(
"could not write temporary mail folder: %s"), strerror(oerrno));
110 if ((sb.st_size != 0) && (truncate(
mutt_b2s(fname), sb.st_size - 1) == -1))
113 mutt_error(
_(
"could not truncate temporary mail folder: %s"), strerror(errno));
140 if (mtime == (time_t) -1)
163 if ((action ==
EVM_EDIT) && (sb.st_mtime == mtime))
170 if ((action ==
EVM_VIEW) && (sb.st_mtime != mtime))
172 mutt_message(
_(
"Message of read-only mailbox modified! Ignoring changes."));
188 mutt_error(
_(
"Can't open message file: %s"), strerror(errno));
197 mutt_error(
_(
"Can't append to folder: %s"), strerror(errno));
207 if (fgets(buf,
sizeof(buf), fp) &&
is_from(buf, NULL, 0, NULL))
218 bool o_read = e->
read;
229 mutt_error(
_(
"Can't append to folder: %s"), strerror(errno));
237 fputc(
'\n', msg->
fp);
#define MUTT_APPEND
Open mailbox for appending messages.
#define MUTT_MSG_NO_FLAGS
No flags are set.
#define mutt_buffer_mktemp(buf)
enum MailboxType type
Mailbox type.
#define mutt_set_flag(m, e, flag, bf)
WHERE bool C_DeleteUntag
Config: Untag messages when they are marked for deletion.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
int mx_mbox_close(struct Context **ptr)
Save changes and close mailbox.
#define mutt_message(...)
int mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st)
Remove permissions from a file.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
String manipulation buffer.
#define CH_FROM
Retain the "From " message separator?
#define CH_NOSTATUS
Suppress the status and x-status fields.
struct Context * mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
Messages to be purged (bypass trash)
#define MUTT_CM_NO_FLAGS
No flags are set.
int mx_msg_close(struct Mailbox *m, struct Message **msg)
Close a message.
struct Message * mx_msg_open_new(struct Mailbox *m, const struct Email *e, MsgOpenFlags flags)
Open a new message.
bool old
Email is seen, but unread.
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
#define CH_FORCE_FROM
Give CH_FROM precedence over CH_WEED?
A local copy of an email.
WHERE char * C_Editor
Config: External command to use as an email editor.
#define CH_NO_FLAGS
No flags are set.
'mmdf' Mailbox type
Messages that have been read.
bool append
Mailbox is opened in append mode.
unsigned char C_MboxType
Config: Default type for creating new mailboxes.
#define MUTT_QUIET
Do not print any messages.
#define CH_NOLEN
Don't write Content-Length: and Lines:
uint8_t MsgOpenFlags
Flags for mx_msg_open_new(), e.g. MUTT_ADD_FROM.
'mbox' Mailbox type
MailboxType
Supported mailbox formats.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
int mx_msg_commit(struct Mailbox *m, struct Message *msg)
Commit a message to a folder - Wrapper for MxOps::msg_commit()
int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end, CopyHeaderFlags chflags, const char *prefix, int wraplen)
Copy header from one file to another.
int mutt_append_message(struct Mailbox *dest, struct Mailbox *src, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags)
Append a message.
FILE * fp
pointer to the message data
time_t mutt_file_decrease_mtime(const char *fp, struct stat *st)
Decrease a file's modification time by 1 second.
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
bool is_from(const char *s, char *path, size_t pathlen, time_t *tp)
Is a string a 'From' header line?
#define mutt_debug(LEVEL,...)
#define MUTT_NEWFOLDER
Create a new folder - same as MUTT_APPEND,.
#define MUTT_ADD_FROM
add a From_ line
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.