Case-insensitive parsing of <id-right> in message-IDs

Julien ÉLIE julien at trigofacile.com
Thu Dec 24 12:43:32 UTC 2009


Hi,

In lib/hash.c, we have the cipoint() function only used in HashMessageID().
The message-ID is then hashed after the "case-insensitive point" with
lower-case chars.

USEFOR states that:

   Observe also that in contrast to the corresponding header field in
   [RFC5322]:

   o  Even though commonly derived from <domain>s, <id-rights>s are
      case-sensitive (and thus, once created, are not to be altered
      during subsequent transmission or copying)


Should we still go on using that "case-insensitive point" or could we
just drop the use of that function in INN 2.6?


/* cipoint - where in this message-ID does it become case-insensitive?
 *
 * The RFC822 code is not quite complete.  Absolute, total, full RFC822
 * compliance requires a horrible parsing job, because of the arcane
 * quoting conventions -- abc"def"ghi is not equivalent to abc"DEF"ghi,
 * for example.  There are three or four things that might occur in the
 * domain part of a message-id that are case-sensitive.  They don't seem
 * to ever occur in real news, thank Cthulhu.  (What?  You were expecting
 * a merciful and forgiving deity to be invoked in connection with RFC822?
 * Forget it; none of them would come near it.)
 *
 * Returns: pointer into s, or NULL for "nowhere"
 */
static const char *
cipoint(const char *s, size_t size)
{
    char *p;
    static const char post[] = "postmaster";
    static int plen = sizeof(post) - 1;

    if ((p = memchr(s, '@', size))== NULL)      /* no local/domain split */
        return NULL;                            /* assume all local */
    if ((p - (s + 1) == plen) && !strncasecmp(post, s+1, plen)) {
        /* crazy -- "postmaster" is case-insensitive */
        return s;
    }
    return p;
}

-- 
Julien ÉLIE

« -- Ce serait une joyeuse idée de faire une tempête dans nos cerveaux,
  n'est-il pas ?
  -- Il veut parler d'une réunion de dravail ! » (Astérix) 




More information about the inn-workers mailing list