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

  • Home
  • SEARCH
  • 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 6059957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:46:13+00:00 2026-05-23T08:46:13+00:00

For some reason I need to fetch emails from /var/mail/username file. It seems like

  • 0

For some reason I need to fetch emails from /var/mail/username file. It seems like an append only file.

My question is, is it safe to parse the content of the /var/email/username file depending on the first line From username@host Mon Jun 20 16:50:15 2011? What if the similar pattern found inside the email body?

Furthermore, is there any opensource ruby script available for reference?

  • 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. Editorial Team
    Editorial Team
    2026-05-23T08:46:14+00:00Added an answer on May 23, 2026 at 8:46 am

    Yes, that seems like more or less the right way to parse the mbox format – from a quick scan of the RFC specification:

    The structure of the separator lines
    vary across implementations, but
    usually contain the exact character
    sequence of "From", followed by a
    single Space character (0x20), an
    email address of some kind, another
    Space character, a timestamp sequence
    of some kind, and an end-of- line
    marker.

    And…

    Many implementations are also known
    to escape message body lines that
    begin with the character sequence of
    "From ", so as to prevent confusion
    with overly-liberal parsers that do
    not search for full separator
    lines. In the common case, a leading
    Greater-Than symbol (0x3E) is used
    for this purpose (with "From "
    becoming ">From "). However, other
    implementations are known not to
    escape such lines unless they are
    immediately preceded by a blank line
    or if they also appear to contain
    an email address and a timestamp.
    Other implementations are also
    known to perform secondary escapes
    against these lines if they are
    already escaped or quoted, while
    others ignore these mechanisms
    altogether.

    Update:
    There’s also this: https://github.com/meh/ruby-mbox

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason we need the xdb.jar from the Oracle XDK. This jar depends
For some reason I need to check in a couple of files in the
i have a large user Database (13k+), and for some reason i need to
I have some classes that, for one reason or another, cannot be or need
For some reason I need to cast/convert a DateTime into one of many custom
for some reason I need to query 'case-sensitive' in MySql + doctrine 2. Is
I have some classes and for some reason I need a procedure that create
I'm working a page that needs to fetch info from some other pages and
For some reason I need to use CentOS 4.8. I installed Java 1.6.26 and
for some reason I need to use a variable as the selector for events

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.