Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 102013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:52:55+00:00 2026-05-11T00:52:55+00:00

I have a single spool mbox file that was created with evolution, containing a

  • 0

I have a single spool mbox file that was created with evolution, containing a selection of emails that I wish to print. My problem is that the emails are not placed into the mbox file chronologically. I would like to know the best way to place order the files from first to last using bash, perl or python. I would like to oder by received for files addressed to me, and sent for files sent by me. Would it perhaps be easier to use maildir files or such?

The emails currently exist in the format:

From x@blah.com Fri Aug 12 09:34:09 2005 Message-ID: <42FBEE81.9090701@blah.com> Date: Fri, 12 Aug 2005 09:34:09 +0900 From: me <x@blah.com> User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: someone <someone@hotmail.com> Subject: Re: (no subject) References: <BAY101-F9353854000A4758A7E2CCA9BD0@phx.gbl> In-Reply-To: <BAY101-F9353854000A4758A7E2CCA9BD0@phx.gbl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Status: RO X-Status:  X-Keywords:                  X-UID: 371 X-Evolution-Source: imap://x+blah.com@blah.com/ X-Evolution: 00000002-0010  Hey  the actual content of the email  someone wrote:  > lines of quotedtext 

I am wondering if there is a way to use this information to easily reorganize the file, perhaps with perl or such.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:52:55+00:00Added an answer on May 11, 2026 at 12:52 am

    This is how you could do it in python:

    #!/usr/bin/python2.5 from email.utils import parsedate import mailbox  def extract_date(email):     date = email.get('Date')     return parsedate(date)  the_mailbox = mailbox.mbox('/path/to/mbox') sorted_mails = sorted(the_mailbox, key=extract_date) the_mailbox.update(enumerate(sorted_mails)) the_mailbox.flush() 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 211k
  • Answers 211k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I used events to signal when a serial port received… May 12, 2026 at 10:04 pm
  • Editorial Team
    Editorial Team added an answer Have you tried this example? Post status to Facebook profile… May 12, 2026 at 10:04 pm
  • Editorial Team
    Editorial Team added an answer If you don't need selection, use an ItemsControl rather than… May 12, 2026 at 10:04 pm

Related Questions

I have a directory /var/spool and inside that, directories named a b c d
Edit : Solved, there was a trigger with a loop on the table (read
The basics: I have a contact form that uses php to validate the forms.
I want to take an XML file and replace an element's value. For example

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.