9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: [9fans] imap4d funny
Date: Tue, 17 Jun 2008 20:53:09 -0400	[thread overview]
Message-ID: <5819bcd1d167e7efd0ba61f2bea1f1ad@quanstro.net> (raw)

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




             reply	other threads:[~2008-06-18  0:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18  0:53 erik quanstrom [this message]
2008-06-18  2:12 ` Russ Cox
2008-06-18  2:22   ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5819bcd1d167e7efd0ba61f2bea1f1ad@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).