Write a MIME part.
301{
302 FILE *fp_in = NULL;
304
306 {
307
310 {
312 mutt_error(
_(
"No boundary parameter found [report this error]"));
313 return -1;
314 }
315 char boundary[128] = { 0 };
317
319 {
320 fprintf(
fp,
"\n--%s\n", boundary);
322 return -1;
325 return -1;
326 }
327 fprintf(
fp,
"\n--%s--\n", boundary);
328 return ferror(
fp) ? -1 : 0;
329 }
330
331
334 {
335 fputs(
"Version: 1\n",
fp);
336 return 0;
337 }
338
340 if (!fp_in)
341 {
344 return -1;
345 }
346
348 {
349 char send_charset[128] = { 0 };
353 }
354 else
355 {
357 }
358
366 else
369
372
374 {
376 return -1;
377 }
378 return ferror(
fp) ? -1 : 0;
379}
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.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
#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 *b, 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.
volatile sig_atomic_t SigInt
true after SIGINT is received
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.