Browse Source

Use application/octet-stream as default MIME type

master
Damien Goutte-Gattat 10 years ago
parent
commit
3a5413e480
  1. 15
      src/fmail.c

15
src/fmail.c

@ -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