Let the user edit the message header and body.
181{
185 if (!fp_out)
186 {
188 goto cleanup;
189 }
190
194 fputc('\n', fp_out);
195
196
197 FILE *fp_in = fopen(body, "r");
198 if (!fp_in)
199 {
202 goto cleanup;
203 }
204
206
209
210 struct stat st = { 0 };
212 {
214 goto cleanup;
215 }
216
218 if (mtime == (time_t) -1)
219 {
221 goto cleanup;
222 }
223
225 if ((stat(
buf_string(path), &st) != 0) || (mtime == st.st_mtime))
226 {
228
230 goto cleanup;
231 }
232
235
236
238 if (!fp_in)
239 {
241 goto cleanup;
242 }
243
245 if (!fp_out)
246 {
247
250 goto cleanup;
251 }
252
254 char buf[1024] = { 0 };
256 int bytes_read;
257 while ((bytes_read = fread(buf, 1, sizeof(buf), fp_in)) > 0)
258 fwrite(buf, 1, bytes_read, fp_out);
262
263
264
265
266
267#ifdef USE_NNTP
269#endif
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#ifdef MIXMASTER
387
390 {
392
393 char *t = strtok(np->
data + plen,
", \t\n");
394 while (t)
395 {
397 t = strtok(NULL, ", \t\n");
398 }
399 keep = false;
400 }
401#endif
402
403 if (!keep)
404 {
408 }
409 }
410
411cleanup:
413}
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.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
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.
bool OptNewsSend
(pseudo) used to change behavior when posting
#define mutt_debug(LEVEL,...)
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
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 ListHead chain
Mixmaster chain.
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.