Let the user edit the message header and body.
183{
187 if (!fp_out)
188 {
190 goto cleanup;
191 }
192
196 fputc('\n', fp_out);
197
198
200 if (!fp_in)
201 {
204 goto cleanup;
205 }
206
208
211
212 struct stat st = { 0 };
214 {
216 goto cleanup;
217 }
218
220 if (mtime == (time_t) -1)
221 {
223 goto cleanup;
224 }
225
227 if ((stat(
buf_string(path), &st) != 0) || (mtime == st.st_mtime))
228 {
230
232 goto cleanup;
233 }
234
237
238
240 if (!fp_in)
241 {
243 goto cleanup;
244 }
245
247 if (!fp_out)
248 {
249
252 goto cleanup;
253 }
254
256 char buf[1024] = { 0 };
258 int bytes_read;
259 while ((bytes_read = fread(buf, 1, sizeof(buf), fp_in)) > 0)
260 fwrite(buf, 1, bytes_read, fp_out);
264
265
266
267
268
270 {
275 {
277 }
278 }
279
280
283
286 env_new = NULL;
287
289
290
291
292
293 struct ListNode *np = NULL, *tmp = NULL;
295 {
296 bool keep = true;
297 size_t plen = 0;
298
299
303 {
305 if (*p)
306 {
309 }
310 keep = false;
311 }
312
316 {
317 struct Body *body2 = NULL;
319
321 if (*p)
322 {
324 for (; (p[0] != '\0') && (p[0] != ' ') && (p[0] != '\t'); p++)
325 {
326 if (p[0] == '\\')
327 {
328 if (p[1] == '\0')
329 break;
330 p++;
331 }
333 }
335
338 if (body2)
339 {
342 ;
343
345 }
346 else
347 {
350 }
351 }
352 keep = false;
353 }
354
359 {
364 {
367 }
368 keep = false;
369 }
370
375 {
380 {
383 }
384 keep = false;
385 }
386
387 if (!keep)
388 {
392 }
393 }
394
395cleanup:
397}
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.