Browse Source

Use application/octet-stream as default MIME type

tags/fmail-0.1.1
Damien Goutte-Gattat 9 years ago
parent
commit
3a5413e480
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      src/fmail.c

+ 11
- 4
src/fmail.c View File

@@ -388,13 +388,20 @@ initialize_magic(void)
static void
process_attachment(const char *filename, magic_t ctx, FILE *out)
{
const char *mime, *last_eq;
const char *mime;
int binary;
FILE *f;

mime = magic_file(ctx, filename);
last_eq = strrchr(mime, '=');
binary = strcmp(last_eq, "=binary") ? 0 : 1;
if ( (mime = magic_file(ctx, filename)) ) {
const char *last_eq;

last_eq = strrchr(mime, '=');
binary = strcmp(last_eq, "=binary") ? 0 : 1;
}
else {
mime = "application/octet-stream";
binary = 1;
}

fprintf(out, "Content-Type: %s\r\n", mime);
fprintf(out, "Content-Transfer-Encoding: %s\r\n", binary ? "base64" : "quoted-printable");


Loading…
Cancel
Save