621 LOFF_T new_offset = -1;
637 if (cmflags & MUTT_CM_PREFIX)
642 int rc_attach_del = -1;
643 LOFF_T new_length = body->
length;
644 struct Buffer *quoted_date = NULL;
652 fseeko(fp_in, body->
offset, SEEK_SET);
658 goto attach_del_cleanup;
659 fprintf(fp_out,
"Content-Length: " OFF_T_FMT
"\n", new_length);
663 fprintf(fp_out,
"Lines: %d\n", new_lines);
666 if (ferror(fp_out) || feof(fp_out))
667 goto attach_del_cleanup;
668 new_offset = ftello(fp_out);
671 if (fseeko(fp_in, body->
offset, SEEK_SET) < 0)
672 goto attach_del_cleanup;
674 goto attach_del_cleanup;
678 LOFF_T fail = ((ftello(fp_out) - new_offset) - new_length);
681 mutt_error(ngettext(
"The length calculation was wrong by %ld byte",
682 "The length calculation was wrong by %ld bytes", fail),
691 e->
lines = new_lines;
692 body->
offset = new_offset;
700 body->
length = new_length;
708 return rc_attach_del;
712 (chflags &
CH_PREFIX) ? prefix : NULL, wraplen) == -1)
717 new_offset = ftello(fp_out);
723 struct State s = { 0 };
726 if (cmflags & MUTT_CM_PREFIX)
749 struct Body *cur = NULL;
757 fputs(
"MIME-Version: 1.0\n", fp_out);
769 mutt_error(
_(
"No decryption engine available for message"));
776 if (fseeko(fp, cur->
offset, SEEK_SET) < 0)
789 if (fseeko(fp_in, body->
offset, SEEK_SET) < 0)
791 if (cmflags & MUTT_CM_PREFIX)
794 size_t bytes = body->
length;
796 fputs(prefix, fp_out);
798 while (((c = fgetc(fp_in)) != EOF) && bytes--)
803 fputs(prefix, fp_out);
811 if ((cmflags & MUTT_CM_UPDATE) && ((cmflags & MUTT_CM_NOHEADER) == 0) &&
814 body->
offset = new_offset;
#define MUTT_CM_DECODE_CRYPT
#define MUTT_DISPLAY
Output is displayed to the user.
int lines
How many lines in the body of this message?
off_t size
Size of the Mailbox.
int msg_in_pager
Message currently shown in the pager.
void mutt_date_make_date(struct Buffer *buf)
Write a date in RFC822 format to a buffer.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
struct Body * body
List of MIME parts.
#define MUTT_CHARCONV
Do character set conversions.
#define MUTT_CM_UPDATE
Update structs on sync.
#define SEC_ENCRYPT
Email is encrypted.
bool attach_del
Has an attachment marked for deletion.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
#define MUTT_CM_WEED
Weed message/rfc822 attachment headers.
String manipulation buffer.
char * prefix
String to add to the beginning of each output line.
LOFF_T offset
offset where the actual data begins
static int count_delete_lines(FILE *fp, struct Body *b, LOFF_T *length, size_t datelen)
Count lines to be deleted in this email body.
FILE * fp_out
File to write to.
#define MUTT_PRINTING
Are we printing? - MUTT_DISPLAY "light".
#define MUTT_CM_PRINTING
Printing the message - display light.
Container for Accounts, Notifications.
FILE * fp_in
File to read from.
#define MUTT_CM_REPLYING
Replying the message.
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
#define MUTT_CM_DISPLAY
Output is displayed to the user.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
int wraplen
Width to wrap lines to (when flags & MUTT_DISPLAY)
off_t vsize
Size (in bytes) of the messages shown.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
#define MUTT_CM_PREFIX
Quote the header and body.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
LOFF_T length
length (in bytes) of attachment
size_t mutt_buffer_len(const struct Buffer *buf)
Calculate the length of a Buffer.
#define MUTT_CM_DECODE
Decode the message body into text/plain.
#define MUTT_VERIFY
Perform signature verification.
#define MUTT_CM_CHARCONV
Perform character set conversions.
static int copy_delete_attach(struct Body *b, FILE *fp_in, FILE *fp_out, const char *quoted_date)
Copy a message, deleting marked attachments.
struct Body * parts
parts of a multipart or message/rfc822
#define MUTT_WEED
Weed headers even when not in display mode.
int crypt_smime_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Wrapper for CryptModuleSpecs::decrypt_mime()
#define CH_UPDATE_LEN
Update Lines: and Content-Length:
void mutt_body_free(struct Body **ptr)
Free a Body.
int mutt_file_copy_bytes(FILE *fp_in, FILE *fp_out, size_t size)
Copy some content from one file to another.
size_t mutt_buffer_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
#define MUTT_CM_VERIFY
Do signature verification.
#define CH_NOLEN
Don't write Content-Length: and Lines:
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib...
unsigned int type
content-type primary type, ContentType
#define MUTT_CM_DECODE_SMIME
Used for decoding S/MIME messages.
int * v2r
Mapping from virtual to real msgno.
int crypt_pgp_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Wrapper for CryptModuleSpecs::decrypt_mime()
Type: 'multipart/*'.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
int mutt_copy_header(FILE *fp_in, struct Email *e, FILE *fp_out, CopyHeaderFlags chflags, const char *prefix, int wraplen)
Copy Email header.
#define MUTT_CM_DECODE_PGP
Used for decoding PGP messages.
#define MUTT_REPLYING
Are we replying?
Keep track when processing files.
int mutt_body_handler(struct Body *b, struct State *s)
Handler for the Body of an email.
struct ConfigSubset * sub
Inherited config items.
#define MUTT_CM_NOHEADER
Don't copy the message header.
#define CH_PREFIX
Quote header using $indent_string string?
Type: 'application/*'.
#define CH_NONEWLINE
Don't output terminating newline after the header.
#define mutt_make_string(BUF, BUFLEN, COLS, S, M, INPGR, E)
int msgno
Number displayed to the user.
WHERE char * C_IndentString
Config: String used to indent 'reply' text.
WHERE bool C_TextFlowed
Config: Generate 'format=flowed' messages.