From owner-freebsd-ports Sat Jul 15 13:20:10 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 881F537B5B0 for ; Sat, 15 Jul 2000 13:20:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id NAA82054; Sat, 15 Jul 2000 13:20:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from raditex.se (gandalf.raditex.se [192.5.36.18]) by hub.freebsd.org (Postfix) with ESMTP id 976F537BA05 for ; Sat, 15 Jul 2000 13:11:37 -0700 (PDT) (envelope-from kaj@raditex.se) Received: (from kaj@localhost) by raditex.se (8.9.3/8.9.3) id WAA35326; Sat, 15 Jul 2000 22:11:36 +0200 (CEST) (envelope-from kaj) Message-Id: <200007152011.WAA35326@raditex.se> Date: Sat, 15 Jul 2000 22:11:36 +0200 (CEST) From: kaj@raditex.se Reply-To: kaj@raditex.se To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/19955: mail/gbuffy: Fix for multi-line X-Face from imap Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 19955 >Category: ports >Synopsis: mail/gbuffy: Fix for multi-line X-Face from imap >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 15 13:20:05 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Rasmus Kaj >Release: FreeBSD 3.2-STABLE i386 >Organization: Raditex AB >Environment: Ports collection as of today >Description: GBuffy only reads the first line of the mail headers when talking imap, but X-Face is usually a multi-line header, so the image will be displayed as noise. I am the maintainer of gbuffy. This PR is not directly related to ports/19952 (other than being about the same port), the PRs can be handled in any order. >How-To-Repeat: Install gbuffy, get an imap mailbox and use gbuffy on it. Send yourself a mail with a multi-line X-Face (or Subject). The image will be displayed as noise (or you'll see only the first "line" of Subject. >Fix: Install the following patch as mail/gbuffy/patches/patch-aa. ---- snip ---- --- imap.c.orig Mon Aug 2 09:41:38 1999 +++ imap.c Sat Jul 15 19:49:45 2000 @@ -318,12 +318,12 @@ static int parse_fetch (BOX_INFO *ibox, CONNECTION *conn, GList *headers, int unseen) { - char from[STRING] = ""; - char subject[STRING] = ""; - char xface[STRING] = ""; + char from[LONG_STRING] = ""; + char subject[LONG_STRING] = ""; + char xface[LONG_STRING] = ""; char buf[LONG_STRING]; char seq[8]; - char *s; + char *s, *last_head; int recent = 0; @@ -339,8 +339,7 @@ return (-1); } - if (buf[0] == '*') - { + if (buf[0] == '*') { s = imap_next_word (buf); if (!isdigit (*s)) continue; @@ -377,10 +376,12 @@ if (!strncasecmp (buf, "From:", 5)) { rfc2047_decode (from, buf, sizeof (from)); + last_head = from; } else if (!strncasecmp (buf, "Subject:", 8)) { rfc2047_decode (subject, buf, sizeof (subject)); + last_head = subject; } else if (!strncasecmp (buf, "X-Face:", 7)) { @@ -389,6 +390,21 @@ strfcpy (xface, s, sizeof (xface)); if (strlen (s) > sizeof (xface)) g_print ("-E- xface header is larger than buffer\n"); + last_head = xface; + } + else if (ISSPACE(buf[0])) { + s = buf; + while (*s && ISSPACE (*s)) s++; + if(strlen(s) + strlen(last_head) + 1 > LONG_STRING) + g_print ("-E- a continuing header is larger than buffer\n"); + else { + /* If this is an X-Face line the space don't matter, but if this + * is any other header the space is required. */ + strcat(last_head, " "); + strncat(last_head, s, LONG_STRING - strlen(last_head)); + } + } else { + last_head = NULL; } } } ---- snip ---- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message