Write a MIME part.
302{
303 FILE *fp_in = NULL;
305
307 {
308
311 {
313 mutt_error(
_(
"No boundary parameter found [report this error]"));
314 return -1;
315 }
316 char boundary[128] = { 0 };
318
320 {
321 fprintf(
fp,
"\n--%s\n", boundary);
323 return -1;
326 return -1;
327 }
328 fprintf(
fp,
"\n--%s--\n", boundary);
329 return ferror(
fp) ? -1 : 0;
330 }
331
332
335 {
336 fputs(
"Version: 1\n",
fp);
337 return 0;
338 }
339
341 if (!fp_in)
342 {
345 return -1;
346 }
347
349 {
350 char send_charset[128] = { 0 };
354 }
355 else
356 {
358 }
359
367 else
370
373
375 {
377 return -1;
378 }
379 return ferror(
fp) ? -1 : 0;
380}
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body's character set.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
SIG_ATOMIC_VOLATILE_T SigInt
true after SIGINT is received
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
@ ENC_BASE64
Base-64 encoded text.
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ TYPE_APPLICATION
Type: 'application/*'.
@ TYPE_TEXT
Type: 'text/*'.
struct FgetConv * mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, uint8_t flags)
Prepare a file for charset conversion.
void mutt_ch_fgetconv_close(struct FgetConv **ptr)
Close an fgetconv handle.
#define MUTT_ICONV_NO_FLAGS
No flags are set.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
#define APPLICATION_PGP
Use PGP to encrypt/sign.
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
static void encode_quoted(struct FgetConv *fc, FILE *fp_out, bool istext)
Encode text as quoted printable.
static bool write_as_text_part(struct Body *b)
Should the Body be written as a text MIME part.
static void encode_base64(struct FgetConv *fc, FILE *fp_out, int istext)
Base64-encode some data.
int mutt_write_mime_body(struct Body *a, FILE *fp, struct ConfigSubset *sub)
Write a MIME part.
static void encode_8bit(struct FgetConv *fc, FILE *fp_out)
Write the data as raw 8-bit data.
void mutt_sig_allow_interrupt(bool allow)
Allow/disallow Ctrl-C (SIGINT)
struct Body * parts
parts of a multipart or message/rfc822
bool noconv
Don't do character set conversion.
char * charset
Send mode: charset of attached file as stored on disk.
struct ParameterList parameter
Parameters of the content-type.
struct Body * next
next attachment in the list
char * subtype
content-type subtype
unsigned int encoding
content-transfer-encoding, ContentEncoding
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
Cursor for converting a file's encoding.