Package: lbdb Version: 0.39 Severity: normal Tags: patch Dear Maintainer,
I observe following problem. The lbdb-fetchaddr cuts too less characters from original input names, if UTF-8 is used and input name contains Cyrillic symbols. The problem is that lbdb-fetchaddr cuts all personal names that are longer that 30 bytes. I use UTF-8 as default encoding for outgoing mails. This is multi-byte encoding and 30 bytes in UTF-8 is 15 Cyrillic symbols (2-byte per symbol). 15 symbols for name is too short. Almost always we use patronymic name in our personal name especially in official work/business mails and that makes personal names even longer. My own full name is 25 Cyrillic characters long (50 bytes) and I don't have the longest personal name. >From the technical point of view I don't see any technical problem to extend this limitation. The attached patch increases max name length to 70 bytes. -- System Information: Debian Release: 8.0 APT prefers testing-updates APT policy: (500, 'testing-updates'), (500, 'testing') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages lbdb depends on: ii libc6 2.19-15 ii libvformat0 1.13-10 ii perl 5.20.2-2 lbdb recommends no packages. Versions of packages lbdb suggests: pn abook <none> ii finger 0.17-15 ii libauthen-sasl-perl 2.1600-1 pn libnet-ldap-perl <none> pn libpalm-perl <none> ii mutt 1.5.23-3 ii procmail 3.22-24 -- no debconf information
>From 9314aab41a0de0286426d5a3f56fa14bebd71dbc Mon Sep 17 00:00:00 2001 From: Andrey Skvortsov <andrej.skvort...@gmail.com> Date: Mon, 22 Dec 2014 17:08:48 +0300 Subject: [PATCH] fetchaddr.c: replace magic numbers that handle maximal length of personal name with a macro definition and extend personal name width. --- fetchaddr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fetchaddr.c b/fetchaddr.c index 46235d5..16f3cb2 100644 --- a/fetchaddr.c +++ b/fetchaddr.c @@ -32,7 +32,8 @@ #include "rfc2047.h" #define MAXHDRS 21 - + /* max personal length in bytes */ +#define MAX_PERSONAL_LENGTH 70 struct header { char *tag; @@ -88,8 +88,10 @@ int writeout(struct header *h, const char *datefmt, } if(!p->group && p->mailbox && *p->mailbox && p->personal) { - if(p->personal && strlen(p->personal) > 30) - strcpy(p->personal + 27, "..."); + const char end[] = "..."; + + if(p->personal && strlen(p->personal) > MAX_PERSONAL_LENGTH) + strcpy(p->personal + MAX_PERSONAL_LENGTH - strlen(end), end); if ((c=strchr(p->mailbox,'@'))) for(c++; *c; c++)