ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
}
else if (!strcasecmp(encoding, "Q")) { /**< quoted-printable */
- ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, strlen(istr));
+ size_t len;
+ long pos;
+
+ len = strlen(istr);
+ pos = 0;
+ while (pos < len)
+ {
+ if (istr[pos] == '_') istr[pos] = ' ';
+ pos++;
+ }
+
+ ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
}
else {
strcpy(ibuf, istr); /**< unknown encoding */
wprintf("</tr></table>\n");
/** Begin body */
- wprintf("<table border=0 width=100%% bgcolor=\"#FFFFFF\" "
+ wprintf("<table class=\"messages_background\" "
"cellpadding=1 cellspacing=0><tr><td>");
/**
*/
void readloop(char *oper)
{
- char cmd[SIZ];
+ char cmd[256];
char buf[SIZ];
char old_msgs[SIZ];
int a, b;
else if (!strcmp(oper, "readold")) {
strcpy(cmd, "MSGS OLD");
}
+ else if (!strcmp(oper, "do_search")) {
+ sprintf(cmd, "MSGS SEARCH|%s", bstr("query"));
+ }
else {
strcpy(cmd, "MSGS ALL");
}
if ((WC->wc_view == VIEW_MAILBOX) && (maxmsgs > 1)) {
is_summary = 1;
- strcpy(cmd, "MSGS ALL");
+ if (!strcmp(oper, "do_search")) {
+ sprintf(cmd, "MSGS SEARCH|%s", bstr("query"));
+ }
+ else {
+ strcpy(cmd, "MSGS ALL");
+ }
}
if ((WC->wc_view == VIEW_ADDRESSBOOK) && (maxmsgs > 1)) {
is_addressbook = 1;
- strcpy(cmd, "MSGS ALL");
+ if (!strcmp(oper, "do_search")) {
+ sprintf(cmd, "MSGS SEARCH|%s", bstr("query"));
+ }
+ else {
+ strcpy(cmd, "MSGS ALL");
+ }
maxmsgs = 9999999;
}
- if (is_summary) {
- strcpy(cmd, "MSGS ALL|||1"); /**< fetch header summary */
+ if (is_summary) { /**< fetch header summary */
+ snprintf(cmd, sizeof cmd, "MSGS %s|%s||1",
+ (!strcmp(oper, "do_search") ? "SEARCH" : "ALL"),
+ (!strcmp(oper, "do_search") ? bstr("query") : "")
+ );
startmsg = 1;
maxmsgs = 9999999;
}
if (nummsgs == 0) {
if ((!is_tasks) && (!is_calendar) && (!is_notes) && (!is_addressbook)) {
- wprintf("<em>");
+ wprintf("<div align=\"center\"><br /><em>");
if (!strcmp(oper, "readnew")) {
wprintf(_("No new messages."));
} else if (!strcmp(oper, "readold")) {
} else {
wprintf(_("No messages here."));
}
- wprintf("</em>\n");
+ wprintf("</em><br /></div>\n");
}
goto DONE;
/** RFC2045 requires this, and some clients look for it... */
serv_puts("MIME-Version: 1.0");
+ serv_puts("X-Mailer: " SERVER);
/** If there are attachments, we have to do multipart/mixed */
if (WC->first_attachment != NULL) {
encoded_length = ((att->length * 150) / 100);
encoded = malloc(encoded_length);
if (encoded == NULL) break;
- CtdlEncodeBase64(encoded, att->data, att->length);
+ CtdlEncodeBase64(encoded, att->data, att->length, 1);
serv_printf("--%s", boundary);
serv_printf("Content-type: %s", att->content_type);
wprintf("</div>\n");
wprintf("<div id=\"content\">\n"
"<div class=\"fix_scrollbar_bug\">"
- "<table width=100%% border=0 bgcolor=\"#ffffff\"><tr><td>");
+ "<table class=\"messages_background\"><tr><td>");
/** Now check our actual recipients if there are any */
if (recipient_required) {