[9fans] imap4d funny - Plan9

This is a discussion on [9fans] imap4d funny - Plan9 ; 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{ ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [9fans] imap4d funny

  1. [9fans] imap4d funny

    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



  2. Re: [9fans] imap4d funny

    > thus if site=coraid.com and servername gets set to
    > rb2.coraid.com, then site will be coraid.com.coraid.com.


    If you want to change the local mail domain,
    you have to use the option

    -d me.coraid.com

    The man page clearly says that if that's not specified,
    then it uses $site with the domain from the server name.
    So you're expected to use

    site=glenda

    and then it turns that into glenda.coraid.com.

    I'm not claiming it's fantastic--I'd get rid
    of $site entirely--but it is working as documented.
    You're just not using it the way it's intended to be used.

    Russ



  3. Re: [9fans] imap4d funny

    > The man page clearly says that if that's not specified,
    > then it uses $site with the domain from the server name.
    > So you're expected to use
    >
    > site=glenda
    >
    > and then it turns that into glenda.coraid.com.
    >
    > I'm not claiming it's fantastic--I'd get rid
    > of $site entirely--but it is working as documented.
    > You're just not using it the way it's intended to be used.


    that would make more sense to me if in upas
    domainname_read() didn't end up using $site as
    the first potential value for domainname_read().

    - erik



+ Reply to Thread