Mailinglist Archive: opensuse-de (1288 mails)

< Previous Next >
Re: hostname -f: Kein FQDN
  • From: Philipp Thomas <pth@xxxxxxx>
  • Date: Tue, 6 Jul 2010 18:02:47 +0200
  • Message-id: <20100706160247.GF16561@xxxxxxxxxxxxxxxx>
* David Haller (dnh@xxxxxxxxxxxx) [20100706 12:06]:

BTW: Evolution erzeugt (AFAIK immer noch) die Message-ID
ausschließlich per "gethostbyname"

Nicht ganz. Die massgebliche Funktion aus camel-mime-utils.c (Teil von
evolution-data-server):

gchar *
camel_header_msgid_generate (void)
{
static pthread_mutex_t count_lock = PTHREAD_MUTEX_INITIALIZER;
#define COUNT_LOCK() pthread_mutex_lock (&count_lock)
#define COUNT_UNLOCK() pthread_mutex_unlock (&count_lock)
gchar host[MAXHOSTNAMELEN];
const gchar *name;
static gint count = 0;
gchar *msgid;
gint retval;
struct addrinfo *ai = NULL, hints = { 0 };
static gchar *cached_hostname = NULL;

if (!cached_hostname) {
retval = gethostname (host, sizeof (host));
if (retval == 0 && *host) {
hints.ai_flags = AI_CANONNAME;
ai = camel_getaddrinfo(host, NULL, &hints, NULL);
if (ai && ai->ai_canonname)
name = ai->ai_canonname;
else
name = host;
} else
name = "localhost.localdomain";

cached_hostname = g_strdup (name);
}

COUNT_LOCK ();
msgid = g_strdup_printf ("%d.%d.%d.camel@%s", (gint) time (NULL), getpid
(), count++, cached_hostname);
COUNT_UNLOCK ();

if (ai)
camel_freeaddrinfo(ai);

return msgid;
}

Davon schmeisst evo alles bis zum @ weg und fügt eigenes ein. Also werden
letztendlich gethostname und getaddrinfo verwendet.

Philipp
--
Um die Liste abzubestellen, schicken Sie eine Mail an:
opensuse-de+unsubscribe@xxxxxxxxxxxx
Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken
Sie eine Mail an: opensuse-de+help@xxxxxxxxxxxx

< Previous Next >