Difference between revisions of "Evolution Header Format"

From ForensicsWiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 11: Line 11:
 
</pre>
 
</pre>
  
Code responsible for generating Message-ID:
+
The Message id consists of five parts:
<pre>
+
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)
+
        char host[MAXHOSTNAMELEN];
+
        char *name;
+
        static int count = 0;
+
        char *msgid;
+
        int retval;
+
        struct addrinfo *ai = NULL, hints = { 0 };
+
  
        retval = gethostname (host, sizeof (host));
+
# The current time as returned by the <tt>time</tt> function followed by a period. The value is dislayed in decimal and is the number of seconds since midnight on 1 Jan 1970. In the example above, 1185616355 refers to Sat, 28 Jul 2007 09:52:35 GMT.
        if (retval == 0 && *host) {
+
# The process id number in decimal followed by a period
                hints.ai_flags = AI_CANONNAME;
+
# The third value starts at zero but may increase as more messages are sent. It is also followed by a period
                ai = camel_getaddrinfo(host, NULL, &hints, NULL);
+
# The word <tt>camel</tt> followed by an '@'
                if (ai && ai->ai_canonname)
+
# If the canonical hostname can found, it is used. Otherwise the hostname
                        name = ai->ai_canonname;
+
                else
+
                        name = host;
+
        } else
+
                name = "localhost.localdomain";
+
  
        COUNT_LOCK ();
+
The Message id format comes from the function <tt>camel_header_msgid_generate</tt> in <tt>evolution-data-server/camel/camel-mime-utils.c</tt>.
        msgid = g_strdup_printf ("%d.%d.%d.camel@%s", (int) time (NULL), getpid (), count++, name);
+
        COUNT_UNLOCK ();
+
  
        if (ai)
+
[[Category:Email Analysis]]
                camel_freeaddrinfo(ai);
+
 
+
        return msgid;
+
}
+
</pre>
+
 
+
== References ==
+
evolution-data-server/camel/camel-mime-utils.c
+

Latest revision as of 01:29, 23 July 2012

Subject: header test
From: Username <username@sendinghost.com>
To: Username <username@receivinghost.com>
Content-Type: text/plain
Date: Sat, 28 Jul 2007 11:52:35 +0200
Message-Id: <1185616355.19231.0.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.10.1 
Content-Transfer-Encoding: 7bit

The Message id consists of five parts:

  1. The current time as returned by the time function followed by a period. The value is dislayed in decimal and is the number of seconds since midnight on 1 Jan 1970. In the example above, 1185616355 refers to Sat, 28 Jul 2007 09:52:35 GMT.
  2. The process id number in decimal followed by a period
  3. The third value starts at zero but may increase as more messages are sent. It is also followed by a period
  4. The word camel followed by an '@'
  5. If the canonical hostname can found, it is used. Otherwise the hostname

The Message id format comes from the function camel_header_msgid_generate in evolution-data-server/camel/camel-mime-utils.c.