Date: Tue, 27 Feb 2007 15:47:48 GMT From: Mark Starovoytov<mark_sf@kikg.ifmo.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/109607: [patch] mail/dbmail: rfc822-conformant headername processing Message-ID: <200702271547.l1RFlmkg083052@www.freebsd.org> Resent-Message-ID: <200702271550.l1RFo7P1021077@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 109607 >Category: ports >Synopsis: [patch] mail/dbmail: rfc822-conformant headername processing >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue Feb 27 15:50:07 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Mark Starovoytov >Release: FreeBSD 6.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD relay.rubinrelax.spb.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Wed Dec 20 12:50:35 MSK 2006 root@relay.rubinrelax.spb.ru:/usr/obj/usr/src/sys/2828_61_03 i386 >Description: Headernames should be processed case-insensitively according to RFC822 3.4.7. Problem reported by Larry Rosenman. Patch for the problem was on the dbmail-dev list. >How-To-Repeat: >Fix: Patch attached with submission follows: diff -urN ./dbmail.orig/Makefile ./dbmail/Makefile --- ./dbmail.orig/Makefile Wed Feb 14 01:05:53 2007 +++ ./dbmail/Makefile Tue Feb 27 18:30:57 2007 @@ -7,6 +7,7 @@ PORTNAME= dbmail PORTVERSION= 2.2.2 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.dbmail.org/download/2.2/ diff -urN ./dbmail.orig/files/patch-rfc822_headername_case ./dbmail/files/patch-rfc822_headername_case --- ./dbmail.orig/files/patch-rfc822_headername_case Thu Jan 1 03:00:00 1970 +++ ./dbmail/files/patch-rfc822_headername_case Tue Feb 27 18:26:38 2007 @@ -0,0 +1,26 @@ +--- dbmail-message.c ++++ dbmail-message.c +@@ -885,9 +885,13 @@ static int _header_get_id(const struct D + u64_t tmp; + gpointer cacheid; + gchar *safe_header; ++ gchar *tmpheader; + +- if (! (safe_header = dm_strnesc(header,CACHE_WIDTH_NAME))) ++ // rfc822 headernames are case-insensitive ++ if (! (tmpheader = dm_strnesc(header,CACHE_WIDTH_NAME))) + return -1; ++ safe_header = g_ascii_strdown(tmpheader,-1); ++ g_free(tmpheader); + + cacheid = g_hash_table_lookup(self->header_dict, (gconstpointer)safe_header); + if (cacheid) { +@@ -897,7 +901,7 @@ static int _header_get_id(const struct D + } + + GString *q = g_string_new(""); +- g_string_printf(q, "SELECT id FROM %sheadername WHERE headername='%s'", DBPFX, safe_header); ++ g_string_printf(q, "SELECT id FROM %sheadername WHERE lower(headername)='%s'", DBPFX, safe_header); + if (db_query(q->str) == -1) { + g_string_free(q,TRUE); + g_free(safe_header); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702271547.l1RFlmkg083052>