2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2001 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #include "procheader.h"
42 #include "prefs_common.h"
48 static GHashTable *procmime_get_mime_type_table (void);
50 MimeInfo *procmime_mimeinfo_new(void)
54 mimeinfo = g_new0(MimeInfo, 1);
55 mimeinfo->mime_type = MIME_UNKNOWN;
56 mimeinfo->encoding_type = ENC_UNKNOWN;
61 void procmime_mimeinfo_free(MimeInfo *mimeinfo)
63 if (!mimeinfo) return;
65 g_free(mimeinfo->encoding);
66 g_free(mimeinfo->content_type);
67 g_free(mimeinfo->charset);
68 g_free(mimeinfo->name);
69 g_free(mimeinfo->boundary);
70 g_free(mimeinfo->content_disposition);
71 g_free(mimeinfo->filename);
73 g_free(mimeinfo->plaintextfile);
74 g_free(mimeinfo->sigstatus);
75 g_free(mimeinfo->sigstatus_full);
78 procmime_mimeinfo_free(mimeinfo->sub);
83 void procmime_mimeinfo_free_all(MimeInfo *mimeinfo)
85 while (mimeinfo != NULL) {
88 g_free(mimeinfo->encoding);
89 g_free(mimeinfo->content_type);
90 g_free(mimeinfo->charset);
91 g_free(mimeinfo->name);
92 g_free(mimeinfo->boundary);
93 g_free(mimeinfo->content_disposition);
94 g_free(mimeinfo->filename);
96 g_free(mimeinfo->plaintextfile);
97 g_free(mimeinfo->sigstatus);
98 g_free(mimeinfo->sigstatus_full);
101 procmime_mimeinfo_free_all(mimeinfo->sub);
102 procmime_mimeinfo_free_all(mimeinfo->children);
104 procmime_mimeinfo_free_all(mimeinfo->plaintext);
107 next = mimeinfo->next;
113 MimeInfo *procmime_mimeinfo_insert(MimeInfo *parent, MimeInfo *mimeinfo)
115 MimeInfo *child = parent->children;
118 parent->children = mimeinfo;
120 while (child->next != NULL)
123 child->next = mimeinfo;
126 mimeinfo->parent = parent;
127 mimeinfo->level = parent->level + 1;
132 void procmime_mimeinfo_replace(MimeInfo *old, MimeInfo *new)
134 MimeInfo *parent = old->parent;
137 g_return_if_fail(parent != NULL);
138 g_return_if_fail(new->next == NULL);
140 for (child = parent->children; child && child != old;
144 g_warning("oops: parent can't find it's own child");
147 procmime_mimeinfo_free_all(old);
149 if (child == parent->children) {
150 new->next = parent->children->next;
151 parent->children = new;
153 new->next = child->next;
158 MimeInfo *procmime_mimeinfo_next(MimeInfo *mimeinfo)
160 if (!mimeinfo) return NULL;
162 if (mimeinfo->children)
163 return mimeinfo->children;
165 return mimeinfo->sub;
167 return mimeinfo->next;
169 for (mimeinfo = mimeinfo->parent; mimeinfo != NULL;
170 mimeinfo = mimeinfo->parent) {
172 return mimeinfo->next;
173 if (mimeinfo->main) {
174 mimeinfo = mimeinfo->main;
176 return mimeinfo->next;
183 MimeInfo *procmime_scan_message(MsgInfo *msginfo)
188 g_return_val_if_fail(msginfo != NULL, NULL);
190 if ((fp = procmsg_open_message(msginfo)) == NULL) return NULL;
191 mimeinfo = procmime_scan_mime_header(fp);
194 if (mimeinfo->mime_type != MIME_MULTIPART) {
195 if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
198 if (mimeinfo->mime_type != MIME_TEXT)
199 procmime_scan_multipart_message(mimeinfo, fp);
203 if (prefs_common.auto_check_signatures)
204 rfc2015_check_signature(mimeinfo, fp);
211 void procmime_scan_multipart_message(MimeInfo *mimeinfo, FILE *fp)
215 gint boundary_len = 0;
217 glong fpos, prev_fpos;
220 g_return_if_fail(mimeinfo != NULL);
221 g_return_if_fail(mimeinfo->mime_type != MIME_TEXT);
223 if (mimeinfo->mime_type == MIME_MULTIPART) {
224 g_return_if_fail(mimeinfo->boundary != NULL);
225 g_return_if_fail(mimeinfo->sub == NULL);
227 g_return_if_fail(fp != NULL);
229 boundary = mimeinfo->boundary;
232 boundary_len = strlen(boundary);
234 /* look for first boundary */
235 while ((p = fgets(buf, sizeof(buf), fp)) != NULL)
236 if (IS_BOUNDARY(buf, boundary, boundary_len)) break;
240 if ((fpos = ftell(fp)) < 0) {
245 for (npart = 0;; npart++) {
247 gboolean eom = FALSE;
251 partinfo = procmime_scan_mime_header(fp);
252 if (!partinfo) break;
253 procmime_mimeinfo_insert(mimeinfo, partinfo);
255 if (partinfo->mime_type == MIME_MULTIPART) {
256 if (partinfo->level < 8)
257 procmime_scan_multipart_message(partinfo, fp);
258 } else if (partinfo->mime_type == MIME_MESSAGE_RFC822) {
261 partinfo->sub = sub = procmime_scan_mime_header(fp);
263 sub->level = partinfo->level + 1;
264 sub->parent = partinfo->parent;
265 sub->main = partinfo;
267 if (sub->mime_type == MIME_MULTIPART) {
269 procmime_scan_multipart_message
274 /* look for next boundary */
276 while ((p = fgets(buf, sizeof(buf), fp)) != NULL) {
277 if (IS_BOUNDARY(buf, boundary, boundary_len)) {
278 if (buf[2 + boundary_len] == '-' &&
279 buf[2 + boundary_len + 1] == '-')
285 eom = TRUE; /* broken MIME message */
288 partinfo->size = fpos - prev_fpos - strlen(buf);
294 void procmime_scan_encoding(MimeInfo *mimeinfo, const gchar *encoding)
298 Xstrdup_a(buf, encoding, return);
300 g_free(mimeinfo->encoding);
302 mimeinfo->encoding = g_strdup(g_strstrip(buf));
303 if (!strcasecmp(buf, "7bit"))
304 mimeinfo->encoding_type = ENC_7BIT;
305 else if (!strcasecmp(buf, "8bit"))
306 mimeinfo->encoding_type = ENC_8BIT;
307 else if (!strcasecmp(buf, "quoted-printable"))
308 mimeinfo->encoding_type = ENC_QUOTED_PRINTABLE;
309 else if (!strcasecmp(buf, "base64"))
310 mimeinfo->encoding_type = ENC_BASE64;
311 else if (!strcasecmp(buf, "x-uuencode"))
312 mimeinfo->encoding_type = ENC_X_UUENCODE;
314 mimeinfo->encoding_type = ENC_UNKNOWN;
318 void procmime_scan_content_type(MimeInfo *mimeinfo, const gchar *content_type)
320 gchar *delim, *p, *cnttype;
323 if (conv_get_current_charset() == C_EUC_JP &&
324 strchr(content_type, '\033')) {
326 len = strlen(content_type) * 2 + 1;
327 Xalloca(buf, len, return);
328 conv_jistoeuc(buf, len, content_type);
330 Xstrdup_a(buf, content_type, return);
332 g_free(mimeinfo->content_type);
333 g_free(mimeinfo->charset);
334 g_free(mimeinfo->name);
335 mimeinfo->content_type = NULL;
336 mimeinfo->charset = NULL;
337 mimeinfo->name = NULL;
339 if ((delim = strchr(buf, ';'))) *delim = '\0';
340 mimeinfo->content_type = cnttype = g_strdup(g_strstrip(buf));
342 mimeinfo->mime_type = procmime_scan_mime_type(cnttype);
351 if ((delim = strchr(p, ';'))) *delim = '\0';
353 if (!(eq = strchr(p, '='))) break;
362 extract_quote(value, '"');
364 eliminate_parenthesis(value, '(', ')');
369 if (!strcasecmp(attr, "charset"))
370 mimeinfo->charset = g_strdup(value);
371 else if (!strcasecmp(attr, "name")) {
375 len = strlen(value) + 1;
376 Xalloca(tmp, len, return);
377 conv_unmime_header(tmp, len, value, NULL);
378 mimeinfo->name = g_strdup(tmp);
379 } else if (!strcasecmp(attr, "boundary"))
380 mimeinfo->boundary = g_strdup(value);
387 if (mimeinfo->mime_type == MIME_MULTIPART && !mimeinfo->boundary)
388 mimeinfo->mime_type = MIME_TEXT;
391 void procmime_scan_content_disposition(MimeInfo *mimeinfo,
392 const gchar *content_disposition)
394 gchar *delim, *p, *dispos;
397 if (conv_get_current_charset() == C_EUC_JP &&
398 strchr(content_disposition, '\033')) {
400 len = strlen(content_disposition) * 2 + 1;
401 Xalloca(buf, len, return);
402 conv_jistoeuc(buf, len, content_disposition);
404 Xstrdup_a(buf, content_disposition, return);
406 if ((delim = strchr(buf, ';'))) *delim = '\0';
407 mimeinfo->content_disposition = dispos = g_strdup(g_strstrip(buf));
416 if ((delim = strchr(p, ';'))) *delim = '\0';
418 if (!(eq = strchr(p, '='))) break;
427 extract_quote(value, '"');
429 eliminate_parenthesis(value, '(', ')');
434 if (!strcasecmp(attr, "filename")) {
438 len = strlen(value) + 1;
439 Xalloca(tmp, len, return);
440 conv_unmime_header(tmp, len, value, NULL);
441 g_free(mimeinfo->filename);
442 mimeinfo->filename = g_strdup(tmp);
454 H_CONTENT_TRANSFER_ENCODING = 0,
456 H_CONTENT_DISPOSITION = 2
459 MimeInfo *procmime_scan_mime_header(FILE *fp)
461 static HeaderEntry hentry[] = {{"Content-Transfer-Encoding:",
463 {"Content-Type:", NULL, TRUE},
464 {"Content-Disposition:",
466 {NULL, NULL, FALSE}};
472 g_return_val_if_fail(fp != NULL, NULL);
474 mimeinfo = procmime_mimeinfo_new();
475 mimeinfo->mime_type = MIME_TEXT;
476 mimeinfo->encoding_type = ENC_7BIT;
477 mimeinfo->fpos = ftell(fp);
479 while ((hnum = procheader_get_one_field(buf, sizeof(buf), fp, hentry))
483 if (H_CONTENT_TRANSFER_ENCODING == hnum) {
484 procmime_scan_encoding
485 (mimeinfo, buf + strlen(hp->name));
486 } else if (H_CONTENT_TYPE == hnum) {
487 procmime_scan_content_type
488 (mimeinfo, buf + strlen(hp->name));
489 } else if (H_CONTENT_DISPOSITION == hnum) {
490 procmime_scan_content_disposition
491 (mimeinfo, buf + strlen(hp->name));
495 if (mimeinfo->mime_type == MIME_APPLICATION_OCTET_STREAM &&
498 type = procmime_get_mime_type(mimeinfo->name);
500 mimeinfo->mime_type = procmime_scan_mime_type(type);
503 if (!mimeinfo->content_type)
504 mimeinfo->content_type = g_strdup("text/plain");
509 FILE *procmime_decode_content(FILE *outfp, FILE *infp, MimeInfo *mimeinfo)
512 gchar *boundary = NULL;
513 gint boundary_len = 0;
514 gboolean tmp_file = FALSE;
516 g_return_val_if_fail(infp != NULL, NULL);
517 g_return_val_if_fail(mimeinfo != NULL, NULL);
520 outfp = my_tmpfile();
528 if (mimeinfo->parent && mimeinfo->parent->boundary) {
529 boundary = mimeinfo->parent->boundary;
530 boundary_len = strlen(boundary);
533 if (mimeinfo->encoding_type == ENC_QUOTED_PRINTABLE) {
534 gboolean softline = FALSE;
536 while (fgets(buf, sizeof(buf), infp) != NULL &&
538 !IS_BOUNDARY(buf, boundary, boundary_len))) {
541 softline = DoOneQPLine(&p, FALSE, softline);
542 fwrite(buf, p - (guchar *)buf, 1, outfp);
544 } else if (mimeinfo->encoding_type == ENC_BASE64) {
545 gchar outbuf[BUFFSIZE];
547 Base64Decoder *decoder;
549 decoder = base64_decoder_new();
550 while (fgets(buf, sizeof(buf), infp) != NULL &&
552 !IS_BOUNDARY(buf, boundary, boundary_len))) {
553 len = base64_decoder_decode(decoder, buf, outbuf);
555 g_warning("Bad BASE64 content\n");
558 fwrite(outbuf, sizeof(gchar), len, outfp);
560 base64_decoder_free(decoder);
561 } else if (mimeinfo->encoding_type == ENC_X_UUENCODE) {
562 gchar outbuf[BUFFSIZE];
564 gboolean flag = FALSE;
566 while (fgets(buf, sizeof(buf), infp) != NULL &&
568 !IS_BOUNDARY(buf, boundary, boundary_len))) {
569 if(!flag && strncmp(buf,"begin ", 6)) continue;
572 len = fromuutobits(outbuf, buf);
575 g_warning("Bad UUENCODE content(%d)\n", len);
578 fwrite(outbuf, sizeof(gchar), len, outfp);
583 while (fgets(buf, sizeof(buf), infp) != NULL &&
585 !IS_BOUNDARY(buf, boundary, boundary_len))) {
590 if (tmp_file) rewind(outfp);
594 gint procmime_get_part(const gchar *outfile, const gchar *infile,
600 g_return_val_if_fail(outfile != NULL, -1);
601 g_return_val_if_fail(infile != NULL, -1);
602 g_return_val_if_fail(mimeinfo != NULL, -1);
604 if ((infp = fopen(infile, "r")) == NULL) {
605 FILE_OP_ERROR(infile, "fopen");
608 if (fseek(infp, mimeinfo->fpos, SEEK_SET) < 0) {
609 FILE_OP_ERROR(infile, "fseek");
613 if ((outfp = fopen(outfile, "w")) == NULL) {
614 FILE_OP_ERROR(outfile, "fopen");
619 while (fgets(buf, sizeof(buf), infp) != NULL)
620 if (buf[0] == '\r' || buf[0] == '\n') break;
622 procmime_decode_content(outfp, infp, mimeinfo);
625 if (fclose(outfp) == EOF) {
626 FILE_OP_ERROR(outfile, "fclose");
634 FILE *procmime_get_text_content(MimeInfo *mimeinfo, FILE *infp)
638 gboolean conv_fail = FALSE;
642 g_return_val_if_fail(mimeinfo != NULL, NULL);
643 g_return_val_if_fail(infp != NULL, NULL);
644 g_return_val_if_fail(mimeinfo->mime_type == MIME_TEXT ||
645 mimeinfo->mime_type == MIME_TEXT_HTML ||
646 mimeinfo->mime_type == MIME_TEXT_ENRICHED, NULL);
648 if (fseek(infp, mimeinfo->fpos, SEEK_SET) < 0) {
653 while (fgets(buf, sizeof(buf), infp) != NULL)
654 if (buf[0] == '\r' || buf[0] == '\n') break;
656 tmpfp = procmime_decode_content(NULL, infp, mimeinfo);
660 if ((outfp = my_tmpfile()) == NULL) {
666 src_codeset = prefs_common.force_charset
667 ? prefs_common.force_charset : mimeinfo->charset;
669 if (mimeinfo->mime_type == MIME_TEXT) {
670 while (fgets(buf, sizeof(buf), tmpfp) != NULL) {
671 str = conv_codeset_strdup(buf, src_codeset, NULL);
680 } else if (mimeinfo->mime_type == MIME_TEXT_HTML) {
684 conv = conv_code_converter_new(src_codeset);
685 parser = html_parser_new(tmpfp, conv);
686 while ((str = html_parse(parser)) != NULL) {
689 html_parser_destroy(parser);
690 conv_code_converter_destroy(conv);
691 } else if (mimeinfo->mime_type == MIME_TEXT_ENRICHED) {
695 conv = conv_code_converter_new(src_codeset);
696 parser = ertf_parser_new(tmpfp, conv);
697 while ((str = ertf_parse(parser)) != NULL) {
700 ertf_parser_destroy(parser);
701 conv_code_converter_destroy(conv);
705 g_warning(_("procmime_get_text_content(): Code conversion failed.\n"));
713 /* search the first text part of (multipart) MIME message,
714 decode, convert it and output to outfp. */
715 FILE *procmime_get_first_text_content(MsgInfo *msginfo)
717 FILE *infp, *outfp = NULL;
718 MimeInfo *mimeinfo, *partinfo;
720 g_return_val_if_fail(msginfo != NULL, NULL);
722 mimeinfo = procmime_scan_message(msginfo);
723 if (!mimeinfo) return NULL;
725 if ((infp = procmsg_open_message(msginfo)) == NULL) {
726 procmime_mimeinfo_free_all(mimeinfo);
731 while (partinfo && partinfo->mime_type != MIME_TEXT)
732 partinfo = procmime_mimeinfo_next(partinfo);
735 while (partinfo && partinfo->mime_type != MIME_TEXT_HTML &&
736 partinfo->mime_type != MIME_TEXT_ENRICHED)
737 partinfo = procmime_mimeinfo_next(partinfo);
742 outfp = procmime_get_text_content(partinfo, infp);
745 procmime_mimeinfo_free_all(mimeinfo);
750 gboolean procmime_find_string_part(MimeInfo *mimeinfo, const gchar *filename,
751 const gchar *str, gboolean case_sens)
756 gchar *(* StrFindFunc) (const gchar *haystack, const gchar *needle);
758 g_return_val_if_fail(mimeinfo != NULL, FALSE);
759 g_return_val_if_fail(mimeinfo->mime_type == MIME_TEXT ||
760 mimeinfo->mime_type == MIME_TEXT_HTML ||
761 mimeinfo->mime_type == MIME_TEXT_ENRICHED, FALSE);
762 g_return_val_if_fail(str != NULL, FALSE);
764 if ((infp = fopen(filename, "r")) == NULL) {
765 FILE_OP_ERROR(filename, "fopen");
769 outfp = procmime_get_text_content(mimeinfo, infp);
776 StrFindFunc = strstr;
778 StrFindFunc = strcasestr;
780 while (fgets(buf, sizeof(buf), outfp) != NULL) {
781 if (StrFindFunc(buf, str) != NULL) {
792 gboolean procmime_find_string(MsgInfo *msginfo, const gchar *str,
798 gboolean found = FALSE;
800 g_return_val_if_fail(msginfo != NULL, FALSE);
801 g_return_val_if_fail(str != NULL, FALSE);
803 filename = procmsg_get_message_file(msginfo);
804 if (!filename) return FALSE;
805 mimeinfo = procmime_scan_message(msginfo);
807 for (partinfo = mimeinfo; partinfo != NULL;
808 partinfo = procmime_mimeinfo_next(partinfo)) {
809 if (partinfo->mime_type == MIME_TEXT ||
810 partinfo->mime_type == MIME_TEXT_HTML ||
811 partinfo->mime_type == MIME_TEXT_ENRICHED) {
812 if (procmime_find_string_part
813 (partinfo, filename, str, case_sens) == TRUE) {
820 procmime_mimeinfo_free_all(mimeinfo);
826 gchar *procmime_get_tmp_file_name(MimeInfo *mimeinfo)
828 static guint32 id = 0;
833 g_return_val_if_fail(mimeinfo != NULL, NULL);
835 g_snprintf(f_prefix, sizeof(f_prefix), "%08x.", id++);
837 if (MIME_TEXT_HTML == mimeinfo->mime_type)
838 base = "mimetmp.html";
840 base = mimeinfo->filename ? mimeinfo->filename
841 : mimeinfo->name ? mimeinfo->name : "mimetmp";
842 base = g_basename(base);
843 if (*base == '\0') base = "mimetmp";
846 filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,
847 f_prefix, base, NULL);
852 ContentType procmime_scan_mime_type(const gchar *mime_type)
856 if (!strncasecmp(mime_type, "text/html", 9))
857 type = MIME_TEXT_HTML;
858 else if (!strncasecmp(mime_type, "text/enriched", 13))
859 type = MIME_TEXT_ENRICHED;
860 else if (!strncasecmp(mime_type, "text/", 5))
862 else if (!strncasecmp(mime_type, "message/rfc822", 14))
863 type = MIME_MESSAGE_RFC822;
864 else if (!strncasecmp(mime_type, "message/", 8))
866 else if (!strncasecmp(mime_type, "application/octet-stream", 24))
867 type = MIME_APPLICATION_OCTET_STREAM;
868 else if (!strncasecmp(mime_type, "application/", 12))
869 type = MIME_APPLICATION;
870 else if (!strncasecmp(mime_type, "multipart/", 10))
871 type = MIME_MULTIPART;
872 else if (!strncasecmp(mime_type, "image/", 6))
874 else if (!strncasecmp(mime_type, "audio/", 6))
876 else if (!strcasecmp(mime_type, "text"))
884 static GList *mime_type_list = NULL;
886 gchar *procmime_get_mime_type(const gchar *filename)
888 static GHashTable *mime_type_table = NULL;
890 const gchar *ext, *p;
892 if (!mime_type_table) {
893 mime_type_table = procmime_get_mime_type_table();
894 if (!mime_type_table) return NULL;
897 filename = g_basename(filename);
898 p = strrchr(filename, '.');
904 mime_type = g_hash_table_lookup(mime_type_table, ext);
908 str = g_strconcat(mime_type->type, "/", mime_type->sub_type,
916 static guint procmime_str_hash(gconstpointer gptr)
918 guint hash_result = 0;
921 for (str = gptr; str && *str; str++) {
922 if (isupper(*str)) hash_result += (*str + ' ');
923 else hash_result += *str;
929 static gint procmime_str_equal(gconstpointer gptr1, gconstpointer gptr2)
931 const char *str1 = gptr1;
932 const char *str2 = gptr2;
934 return !strcasecmp(str1, str2);
937 static GHashTable *procmime_get_mime_type_table(void)
939 GHashTable *table = NULL;
944 if (!mime_type_list) {
945 mime_type_list = procmime_get_mime_type_list();
946 if (!mime_type_list) return NULL;
949 table = g_hash_table_new(procmime_str_hash, procmime_str_equal);
951 for (cur = mime_type_list; cur != NULL; cur = cur->next) {
954 mime_type = (MimeType *)cur->data;
956 if (!mime_type->extension) continue;
958 exts = g_strsplit(mime_type->extension, " ", 16);
959 for (i = 0; exts[i] != NULL; i++)
960 g_hash_table_insert(table, g_strdup(exts[i]),
968 GList *procmime_get_mime_type_list(void)
977 return mime_type_list;
979 if ((fp = fopen("/etc/mime.types", "r")) == NULL) {
980 if ((fp = fopen(SYSCONFDIR "/mime.types", "r")) == NULL) {
981 FILE_OP_ERROR(SYSCONFDIR "/mime.types", "fopen");
986 while (fgets(buf, sizeof(buf), fp) != NULL) {
987 p = strchr(buf, '#');
992 while (*p && !isspace(*p)) p++;
997 delim = strchr(buf, '/');
998 if (delim == NULL) continue;
1001 mime_type = g_new(MimeType, 1);
1002 mime_type->type = g_strdup(buf);
1003 mime_type->sub_type = g_strdup(delim + 1);
1005 while (*p && isspace(*p)) p++;
1007 mime_type->extension = g_strdup(p);
1009 mime_type->extension = NULL;
1011 list = g_list_append(list, mime_type);
1017 g_warning("Can't read mime.types\n");
1022 EncodingType procmime_get_encoding_for_charset(const gchar *charset)
1026 else if (!strncasecmp(charset, "ISO-2022-", 9) ||
1027 !strcasecmp(charset, "US-ASCII"))
1031 /* return ENC_BASE64; */
1032 /* return ENC_QUOTED_PRINTABLE; */
1035 const gchar *procmime_get_encoding_str(EncodingType encoding)
1037 static const gchar *encoding_str[] = {
1038 "7bit", "8bit", "quoted-printable", "base64", "x-uuencode",
1042 if (encoding >= ENC_7BIT && encoding <= ENC_UNKNOWN)
1043 return encoding_str[encoding];