From: Ken Hornstein Date: Wed, 15 Feb 2012 19:55:25 +0000 (-0500) Subject: Hm, it turns out we need to make sure we call getname() until we get X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=4e0b71d26ea73fe5ae324cc9c5caa7f204760781;p=mmh Hm, it turns out we need to make sure we call getname() until we get a NULL, otherwise the next set of calls to it will be working from the "old" search string. --- diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 633f6ef..ffdac3f 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -373,8 +373,13 @@ ismymbox (struct mailname *np) if ((am = context_find ("local-mailbox"))) { struct mailname *mptr; - if ((mptr = getm (am, NULL, 0, AD_NAME, NULL)) == NULL) { - admonish (NULL, "invalid entry in local-mailbox: %s", am); + if ((cp = getname(am)) == NULL) { + admonish (NULL, "Unable to find address in local-mailbox"); + return 0; + } + + if ((mptr = getm (cp, NULL, 0, AD_NAME, NULL)) == NULL) { + admonish (NULL, "invalid entry in local-mailbox: %s", cp); return 0; } @@ -387,6 +392,14 @@ ismymbox (struct mailname *np) mq = *mptr; free(mptr); + + /* + * Sigh, it turns out that the address parser gets messed up + * if you don't call getname() until it returns NULL. + */ + + while ((cp = getname(am)) != NULL) + ; } else { mq.m_mbox = getusername (); }