This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nobody
Recipients
Date 2001-03-29.17:06:33
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I am playing around with mailbox.BabylMailbox to parse
my RMAIL
file. It seems like certain headers are only recognized
some of the
time.  For instance, "Message-Id:" headers sometime
appears, sometimes not. 

The following program:

------------------------------------------------------------------
#!/usr/bin/env python
import mailbox
mb = mailbox.BabylMailbox(
open("/home/students/kurlberg/ggg", "r"))
t = mb.next()
print t.headers
print "\nThe message-id is:", t.getheader("Message-ID")
------------------------------------------------------------------

produces:

------------------------------------------------------------------
['X-Sender: clancey@alpha.muga.com\012', 'Date: Wed, 28
Feb 2001 11:41:43 -0500\012', 'To:
faculty@muga.com\012', 'From: Kevin Clancey
<clancey@muga.com>\012', 'Subject: Travel Funds\012',
'Content-Type: text/plain; charset="us-ascii"\012',
'Content-Length: 183\012']

The message-id is: None
------------------------------------------------------------------

The file ggg contains: (I replaced the real domain by
muga.com to
avoid spambots.)

--------- ggg start:
---------------------------------------------
BABYL OPTIONS: -*- rmail -*-
Version: 5
Labels:
Note:   This is the header of an rmail file.
Note:   If you are seeing it in rmail,
Note:    it means the file has no messages in it.
  
1,,
Summary-line: 28-Feb       clancey@muga.com  [23]
#Travel Funds
X-Coding-System: nil
Mail-from: From clancey@muga.com Wed Feb 28 11:50 EST
2001
Received: from clancey.muga.com (clancey
[128.192.3.198])
	by alpha.muga.com (8.9.1/8.9.1) with SMTP id LAA28223
	for <faculty@muga.com>; Wed, 28 Feb 2001 11:48:43
-0500 (EST)
Message-Id:
<3.0.6.32.20010228114143.00921510@alpha.muga.com>
X-Sender: clancey@alpha.muga.com
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6
(32)
Date: Wed, 28 Feb 2001 11:41:43 -0500
To: faculty@muga.com
From: Kevin Clancey <clancey@muga.com>
Subject: Travel Funds
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Length: 183

*** EOOH ***
X-Sender: clancey@alpha.muga.com
Date: Wed, 28 Feb 2001 11:41:43 -0500
To: faculty@muga.com
From: Kevin Clancey <clancey@muga.com>
Subject: Travel Funds
Content-Type: text/plain; charset="us-ascii"
Content-Length: 183

Please try to submit any travel requests to the
department for travel
during this fiscal year by Friday, March 30, 2001. (FYI
the fiscal
year ends on June 30, 2001.)  Thanks.
-Kevin


 
--------- End of ggg:
-----------------------------------


On the other hand, message-id is found in the following
example:

-------- mail where message-id is
detected---------------

  
0, unseen,,
Summary-line:  4-Aug    root@gauss.muga.com  [18]
#gauss.muga.com 08/04/00:17.01 system check
*** EOOH ***
X-Coding-System: undecided-unix
Mail-from: From root  Fri Aug  4 17:01:01 2000
Return-Path: <root>
Received: (from root@localhost)
	by gauss.muga.com (8.9.3/8.9.3) id RAA13973
	for root; Fri, 4 Aug 2000 17:01:01 -0400
Date: Fri, 4 Aug 2000 17:01:01 -0400
From: root <root@gauss.muga.com>
Message-Id: <200008042101.RAA13973@gauss.muga.com>
To: root@gauss.muga.com
Subject: gauss.muga.com 08/04/00:17.01 system check


Unusual System Events
=-=-=-=-=-=-=-=-=-=-=
Aug  4 16:12:55 gauss sshd[381]: log: Generating new
768 bit RSA key.
Aug  4 16:12:55 gauss sshd[381]: log: RSA key
generation complete.

  
-------- end of mail where message-id is detected
----------


Is there a bug in mailbox/mailbox.BabylMailbox? 

P.S. The above program was run with python version
1.6b1. However,
there are similar problems with python 2.0.

Sorry about the ugly line breaks.
History
Date User Action Args
2007-08-23 13:53:45adminlinkissue412230 messages
2007-08-23 13:53:45admincreate