Difference between revisions of "Mutt Header Format"

From ForensicsWiki
Jump to: navigation, search
(New page: <pre> 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: tex...)
 
Line 9: Line 9:
 
User-Agent: Mutt/1.5.13 (2006-08-11)
 
User-Agent: Mutt/1.5.13 (2006-08-11)
 
From: Username <username@sendinghost.com>
 
From: Username <username@sendinghost.com>
 +
</pre>
 +
 +
Code responsible for generating Message-ID:
 +
<pre>
 +
char *mutt_gen_msgid (void)
 +
{
 +
  char buf[SHORT_STRING];
 +
  time_t now;
 +
  struct tm *tm;
 +
  const char *fqdn;
 +
 +
  now = time (NULL);
 +
  tm = gmtime (&now);
 +
  if(!(fqdn = mutt_fqdn(0)))
 +
    fqdn = NONULL(Hostname);
 +
 +
  snprintf (buf, sizeof (buf), "<%d%02d%02d%02d%02d%02d.G%c%u@%s>",
 +
            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>
 
</pre>

Revision as of 12:45, 28 July 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>

Code responsible for generating Message-ID:

char *mutt_gen_msgid (void)
{
  char buf[SHORT_STRING];
  time_t now;
  struct tm *tm;
  const char *fqdn;

  now = time (NULL);
  tm = gmtime (&now);
  if(!(fqdn = mutt_fqdn(0)))
    fqdn = NONULL(Hostname);

  snprintf (buf, sizeof (buf), "<%d%02d%02d%02d%02d%02d.G%c%u@%s>",
            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));
}