# HG changeset patch # User markus schnalke # Date 1330521764 -3600 # Node ID 7c5e51c53f72a60f4c8a433c8e1d832c87757158 # Parent 8a62bebda631a911cf6b92ad19a43a8fddb9ae77 Finally found the newline that was to much in spool_read_header(). diff -r 8a62bebda631 -r 7c5e51c53f72 src/parse.c --- a/src/parse.c Wed Feb 29 13:33:40 2012 +0100 +++ b/src/parse.c Wed Feb 29 14:22:44 2012 +0100 @@ -390,6 +390,12 @@ gchar *addr_end; gboolean ret; + if (!string) { + return NULL; + } + while (isspace(*string)) { + string++; + } /* TODO: what about (string == NULL)? */ if (string && (string[0] == '\0')) { address *addr = g_malloc(sizeof(address)); @@ -411,21 +417,20 @@ if (!ret) { return NULL; } - - address *addr = g_malloc(sizeof(address)); - gchar *p = addr_end; - - memset(addr, 0, sizeof(address)); - - if (loc_beg[0] == '|') { + if (*loc_beg == '|') { parse_error = g_strdup("no pipe allowed for RFC 822/821 address"); return NULL; } + address *addr = g_malloc(sizeof(address)); + memset(addr, 0, sizeof(address)); + + gchar *p = addr_end; while (*p && (*p != ',')) { + /* it seems as if we do this for the code in rewrite.c */ p++; } - addr->address = g_strndup(string, p - string); + addr->address = g_strstrip(g_strndup(string, p - string)); addr->local_part = g_strndup(loc_beg, loc_end - loc_beg); #ifdef PARSE_TEST @@ -448,6 +453,10 @@ *end = p; } + DEBUG(6) debugf("_create_address(): address: `%s'\n", addr->address); + DEBUG(6) debugf("_create_address(): local_part: `%s'\n", addr->local_part); + DEBUG(6) debugf("_create_address(): domain: `%s'\n", addr->domain); + #ifndef PARSE_TEST addr_unmark_delivered(addr); #endif