Let the user edit the message header and body.
184{
188 if (!fp_out)
189 {
191 goto cleanup;
192 }
193
197 fputc('\n', fp_out);
198
199
201 if (!fp_in)
202 {
205 goto cleanup;
206 }
207
209
212
213 struct stat st = { 0 };
215 {
217 goto cleanup;
218 }
219
221 if (mtime == (time_t) -1)
222 {
224 goto cleanup;
225 }
226
228 if ((stat(
buf_string(path), &st) != 0) || (mtime == st.st_mtime))
229 {
231
233 goto cleanup;
234 }
235
238
239
241 if (!fp_in)
242 {
244 goto cleanup;
245 }
246
248 if (!fp_out)
249 {
250
253 goto cleanup;
254 }
255
257 char buf[1024] = { 0 };
259 int bytes_read;
260 while ((bytes_read = fread(buf, 1, sizeof(buf), fp_in)) > 0)
261 fwrite(buf, 1, bytes_read, fp_out);
265
266
267
268
269
271 {
276 {
278 }
279 }
280
281
284
287 env_new = NULL;
288
290
291
292
293
294 struct ListNode *np = NULL, *tmp = NULL;
296 {
297 bool keep = true;
298 size_t plen = 0;
299
300
304 {
306 if (*p)
307 {
310 }
311 keep = false;
312 }
313
317 {
318 struct Body *body2 = NULL;
320
322 if (*p)
323 {
325 for (; (p[0] != '\0') && (p[0] != ' ') && (p[0] != '\t'); p++)
326 {
327 if (p[0] == '\\')
328 {
329 if (p[1] == '\0')
330 break;
331 p++;
332 }
334 }
336
339 if (body2)
340 {
343 ;
344
346 }
347 else
348 {
351 }
352 }
353 keep = false;
354 }
355
360 {
365 {
368 }
369 keep = false;
370 }
371
376 {
381 {
384 }
385 keep = false;
386 }
387
388 if (!keep)
389 {
393 }
394 }
395
396cleanup:
398}
void mutt_expand_aliases_env(struct Envelope *env)
Expand aliases in all the fields of an Envelope.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
@ NT_EMAIL_CHANGE
Email has changed.
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
void mutt_env_to_local(struct Envelope *env)
Convert an Envelope's Address fields to local format.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
time_t mutt_file_decrease_mtime(const char *fp, struct stat *st)
Decrease a file's modification time by 1 second.
void mutt_file_unlink(const char *s)
Delete a file, carefully.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
bool OptNewsSend
(pseudo) used to change behavior when posting
#define mutt_debug(LEVEL,...)
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
@ LL_DEBUG1
Log at debug level 1.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
char * mutt_str_dup(const char *str)
Copy a string, safely.
char * mutt_str_skip_email_wsp(const char *s)
Skip over whitespace as defined by RFC5322.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
#define SEC_NO_FLAGS
No flags are set.
@ NT_EMAIL
Email has changed, NotifyEmail, EventEmail.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
SecurityFlags mutt_parse_crypt_hdr(const char *p, bool set_empty_signas, SecurityFlags crypt_app)
Parse a crypto header string.
#define STAILQ_REMOVE(head, elm, type, field)
#define STAILQ_FIRST(head)
#define STAILQ_EMPTY(head)
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
#define STAILQ_SWAP(head1, head2, type)
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
struct Body * parts
parts of a multipart or message/rfc822
char * description
content-description
struct Body * next
next attachment in the list
String manipulation buffer.
struct Envelope * env
Envelope information.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
struct Body * body
List of MIME parts.
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
struct ListHead userhdrs
user defined headers
struct ListHead references
message references (in reverse order)
struct ListHead in_reply_to
in-reply-to header content
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.