summaryrefslogtreecommitdiffstats
path: root/imap/pop3dserver.c
diff options
context:
space:
mode:
authorSam Varshavchik2019-02-24 19:03:57 -0500
committerSam Varshavchik2019-02-24 19:03:57 -0500
commit0877c2dea580caaeb10e5394cb859fd6ce6e1b5b (patch)
tree735306eec3c1077eb172c646c4b345e5bd5f2506 /imap/pop3dserver.c
parent6ec22ca5750d5f6936c558491776fc7532b2b759 (diff)
downloadcourier-libs-0877c2dea580caaeb10e5394cb859fd6ce6e1b5b.tar.bz2
pop3: New MIME_UNICODE_MESSAGE_TYPE config setting.
Diffstat (limited to 'imap/pop3dserver.c')
-rw-r--r--imap/pop3dserver.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/imap/pop3dserver.c b/imap/pop3dserver.c
index aa5ae24..fc98f2f 100644
--- a/imap/pop3dserver.c
+++ b/imap/pop3dserver.c
@@ -666,7 +666,7 @@ char buf[NUMBUFSIZE];
"The original message is included as a separate attachment\n" \
"so that it can be downloaded manually.\n\n" \
"--%s\n" \
- "Content-Type: message/global\n\n"
+ "Content-Type: %s\n\n"
struct retr_source {
char *wrapheader;
@@ -712,19 +712,23 @@ static void do_retr(unsigned i, unsigned *lptr)
char buf[NUMBUFSIZE];
unsigned long *cntr;
char boundary[256];
- char wrapheader[sizeof(MIMEWRAPTXT)+768];
+ char wrapheader[sizeof(MIMEWRAPTXT)+1024];
char wrapfooter[512];
-
+ const char *mime_message_type=getenv("MIME_UNICODE_MESSAGE_TYPE");
struct retr_source rs;
wrapheader[0]=0;
wrapfooter[0]=0;
+ if (!mime_message_type)
+ mime_message_type="message/global";
+
if (msglist_a[i]->isutf8 && !utf8_enabled)
{
sprintf(boundary, "=_%d-%d", (int)getpid(), (int)time(NULL));
- sprintf(wrapheader, MIMEWRAPTXT, boundary, boundary, boundary);
+ sprintf(wrapheader, MIMEWRAPTXT, boundary, boundary, boundary,
+ mime_message_type);
sprintf(wrapfooter, "\n--%s--\n", boundary);
}