From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5819bcd1d167e7efd0ba61f2bea1f1ad@quanstro.net> To: 9fans@9fans.net From: erik quanstrom Date: Tue, 17 Jun 2008 20:53:09 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] imap4d funny Topicbox-Message-UUID: c160854a-ead3-11e9-9d60-3106f5b1d025 perhaps i'm missing something, but i don't understand why imap4d sets its site the way it does. the relevant code is so (edited for brevity): servername = csquery("sys", sysname(), "dom"); t = getenv("site"); if(t == nil) site = servername; else{ n = strlen(t); s = strchr(servername, '.'); if(s == nil) s = servername; else s++; n += strlen(s) + 2; site = emalloc(n); snprint(site, n, "%s.%s", t, s); } thus if site=coraid.com and servername gets set to rb2.coraid.com, then site will be coraid.com.coraid.com. this results in envelops than can be mighty screwy if no @ appears in the from line, for example: 6 uid fetch 7 (envelope) * 4 FETCH (UID 7 ENVELOPE ("Tue, 17 Jun 2008 19:13:44 -0400" "testing123" (("erik quanstrom" NIL "quanstro" "coraid.com.coraid.com")) (("erik quanstrom" NIL "quanstro" "coraid.com.coraid.com")) (("erik quanstrom" NIL "quanstro" "coraid.com.coraid.com")) NIL NIL NIL NIL NIL)) i think it should be more like servername = csquery("sys", sysname(), "dom"); site = getenv("site"); if(site == nil){ site = strchr(servername, '.'); if(site == nil) site = servername; else site++; } am i missing something? - erik