Let the user edit the message header and body.
175{
179 if (!fp_out)
180 {
182 goto cleanup;
183 }
184
188 fputc('\n', fp_out);
189
190
191 FILE *fp_in = fopen(body, "r");
192 if (!fp_in)
193 {
196 goto cleanup;
197 }
198
200
203
204 struct stat st = { 0 };
206 {
208 goto cleanup;
209 }
210
212 if (mtime == (time_t) -1)
213 {
215 goto cleanup;
216 }
217
220 {
222
224 goto cleanup;
225 }
226
229
230
232 if (!fp_in)
233 {
235 goto cleanup;
236 }
237
239 if (!fp_out)
240 {
241
244 goto cleanup;
245 }
246
248 char buf[1024] = { 0 };
250 int bytes_read;
251 while ((bytes_read = fread(buf, 1, sizeof(buf), fp_in)) > 0)
252 fwrite(buf, 1, bytes_read, fp_out);
256
257
258
259
260
261#ifdef USE_NNTP
263#endif
264 {
269 {
271 }
272 }
273
274
277
280 env_new = NULL;
281
283
284
285
286
287 struct ListNode *np = NULL, *tmp = NULL;
289 {
290 bool keep = true;
292
293
297 {
299 if (*p)
300 {
303 }
304 keep = false;
305 }
306
310 {
311 struct Body *body2 = NULL;
313
315 if (*p)
316 {
318 for (; (p[0] != '\0') && (p[0] != ' ') && (p[0] != '\t'); p++)
319 {
320 if (p[0] == '\\')
321 {
322 if (p[1] == '\0')
323 break;
324 p++;
325 }
327 }
329
332 if (body2)
333 {
336 ;
337
339 }
340 else
341 {
344 }
345 }
346 keep = false;
347 }
348
353 {
358 {
361 }
362 keep = false;
363 }
364
369 {
374 {
377 }
378 keep = false;
379 }
380#ifdef MIXMASTER
381
384 {
386
387 char *t = strtok(np->
data +
plen,
", \t\n");
388 while (t)
389 {
391 t = strtok(NULL, ", \t\n");
392 }
393 keep = false;
394 }
395#endif
396
397 if (!keep)
398 {
402 }
403 }
404
405cleanup:
407}
void mutt_expand_aliases_env(struct Envelope *env)
Expand aliases in all the fields of an Envelope.
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t mutt_buffer_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * mutt_buffer_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.
@ 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 mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
#define mutt_buffer_mktemp(buf)
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 Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
static size_t plen
Length of cached packet.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from 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.