* it to the reader's screen width, but since our HTML-to-text parser
* isn't really all that great, it's probably better to just go with
* the plain text when we have it available.
+ *
+ * We also indicate to the server that we prefer to decode Base64 and
+ * quoted-printable on the client side.
*/
+ if ((CtdlIPCSpecifyPreferredFormats(ipc, buf, "dont_decode") / 100 ) != 2) {
+ scr_printf("ERROR: Extremely old server; MSG4 framework not supported.\n");
+ logoff(ipc, 0);
+ }
if ((CtdlIPCSpecifyPreferredFormats(ipc, buf, "text/plain|text/html") / 100 ) != 2) {
scr_printf("ERROR: Extremely old server; MSG4 framework not supported.\n");
logoff(ipc, 0);
*choose_preferred, *fixed_output_pre,
*fixed_output_post, (void *)&ma, 0);
mime_parser(mptr, NULL,
- *output_preferred, NULL, NULL, (void *)&ma, 0);
+ *output_preferred, NULL, NULL, (void *)&ma, CC->msg4_dont_decode);
}
else {
ma.use_fo_hooks = 1;
*/
void cmd_msgp(char *cmdbuf)
{
- safestrncpy(CC->preferred_formats, cmdbuf,
- sizeof(CC->preferred_formats));
- cprintf("%d ok\n", CIT_OK);
+ if (!strcasecmp(cmdbuf, "dont_decode")) {
+ CC->msg4_dont_decode = 1;
+ cprintf("%d MSG4 will not pre-decode messages.\n", CIT_OK);
+ }
+ else {
+ safestrncpy(CC->preferred_formats, cmdbuf, sizeof(CC->preferred_formats));
+ cprintf("%d Preferred MIME formats have been set.\n", CIT_OK);
+ }
}
char fake_hostname[64];
char fake_roomname[ROOMNAMELEN];
- char preferred_formats[256]; /* Preferred MIME formats */
+ /* Preferred MIME formats */
+ char preferred_formats[256];
+ int msg4_dont_decode;
/* Dynamically allocated session data */
struct citimap *IMAP;
struct citpop3 *POP3;
struct citsmtp *SMTP;
- struct citmgsve *MGSVE; /**< Managesieve Session struct */
+ struct citmgsve *MGSVE; /**< Managesieve Session struct */
struct cit_ical *CIT_ICAL; /* calendaring data */
struct ma_info *ma; /* multipart/alternative data */
- const char* ServiceName; /**< whats our actual purpose? */
+ const char* ServiceName; /**< whats our actual purpose? */
};
typedef struct CitContext t_context;