diff options
| author | Sam Varshavchik | 2019-02-24 19:03:57 -0500 |
|---|---|---|
| committer | Sam Varshavchik | 2019-02-24 19:03:57 -0500 |
| commit | 0877c2dea580caaeb10e5394cb859fd6ce6e1b5b (patch) | |
| tree | 735306eec3c1077eb172c646c4b345e5bd5f2506 | |
| parent | 6ec22ca5750d5f6936c558491776fc7532b2b759 (diff) | |
| download | courier-libs-0877c2dea580caaeb10e5394cb859fd6ce6e1b5b.tar.bz2 | |
pop3: New MIME_UNICODE_MESSAGE_TYPE config setting.
| -rw-r--r-- | imap/ChangeLog | 5 | ||||
| -rw-r--r-- | imap/pop3d.dist.in.git | 9 | ||||
| -rw-r--r-- | imap/pop3dserver.c | 12 |
3 files changed, 22 insertions, 4 deletions
diff --git a/imap/ChangeLog b/imap/ChangeLog index c7c9755..71e13c9 100644 --- a/imap/ChangeLog +++ b/imap/ChangeLog @@ -1,3 +1,8 @@ +2019-02-24 Sam Varshavchik <mrsam@courier-mta.com> + + * pop3dserver.c (do_retr): Use the new MIME_UNICODE_MESSAGE_TYPE + setting to set the type of the wrapped MIME attachment. + 5.0.6 2019-01-30 Sam Varshavchik <mrsam@courier-mta.com> diff --git a/imap/pop3d.dist.in.git b/imap/pop3d.dist.in.git index 17f1e38..788224f 100644 --- a/imap/pop3d.dist.in.git +++ b/imap/pop3d.dist.in.git @@ -181,3 +181,12 @@ POP3DSTART=NO # MAILDIRPATH - directory name of the maildir directory. # MAILDIRPATH=Maildir + +##NAME: MIME_UNICODE_MESSAGE_TYPE:0 +# +# MIME type that wraps Unicode messages for downloading by non-Unicode +# POP3 clients. +# +# This can be changed to "message/rfc822" to accomodate older mail clients. + +MIME_UNICODE_MESSAGE_TYPE="message/global" 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); } |
