Difference between revisions of "Mutt Header Format"

From ForensicsWiki
Jump to: navigation, search
(Replaced source code with English text version)
 
Line 11: Line 11:
 
</pre>
 
</pre>
  
Code responsible for generating Message-ID:
+
The format of the Message id field is:
<pre>
+
char *mutt_gen_msgid (void)
+
{
+
  char buf[SHORT_STRING];
+
  time_t now;
+
  struct tm *tm;
+
  const char *fqdn;
+
  
  now = time (NULL);
+
# Four digits for the current year
  tm = gmtime (&now);
+
# Two digits for the current month
  if(!(fqdn = mutt_fqdn(0)))
+
# Two digits for the current day of the month
    fqdn = NONULL(Hostname);
+
# Two digits for the current hour
 +
# Two digits for the current minute
 +
# Two digits for the current second
 +
# A period followed by the capital letter 'G'
 +
# A capital letter. The first message sent will have the letter 'A', the next 'B', and then 'C' until the 26th message will have 'Z'. The 27th message sent starts again with 'A'.
 +
# The current process id number
 +
# The '@' symbol
 +
# The fully qualified domain name of the sending computer.
  
  snprintf (buf, sizeof (buf), "<%d%02d%02d%02d%02d%02d.G%c%u@%s>",
+
The above was based on the function <tt>mutt_gen_msgid</tt> in <tt>mutt/sendlib.c</tt>.
            tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
+
            tm->tm_min, tm->tm_sec, MsgIdPfx, (unsigned int)getpid (), fqdn);
+
  MsgIdPfx = (MsgIdPfx == 'Z') ? 'A' : MsgIdPfx + 1;
+
  return (safe_strdup (buf));
+
}
+
</pre>
+
 
+
== References ==
+
mutt/sendlib.c
+

Latest revision as of 09:51, 8 August 2007

Date: Sat, 28 Jul 2007 18:29:15 +0200
To: Username <username@receivinghost.com>
Subject: header test
Message-ID: <20070728162915.GA2046@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.13 (2006-08-11)
From: Username <username@sendinghost.com>

The format of the Message id field is:

  1. Four digits for the current year
  2. Two digits for the current month
  3. Two digits for the current day of the month
  4. Two digits for the current hour
  5. Two digits for the current minute
  6. Two digits for the current second
  7. A period followed by the capital letter 'G'
  8. A capital letter. The first message sent will have the letter 'A', the next 'B', and then 'C' until the 26th message will have 'Z'. The 27th message sent starts again with 'A'.
  9. The current process id number
  10. The '@' symbol
  11. The fully qualified domain name of the sending computer.

The above was based on the function mutt_gen_msgid in mutt/sendlib.c.