From owner-freebsd-questions@FreeBSD.ORG Wed Sep 24 14:28:19 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54B6F16A4B3 for ; Wed, 24 Sep 2003 14:28:19 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37DA14401A for ; Wed, 24 Sep 2003 14:28:17 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h8OLRVtF006737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Sep 2003 22:28:07 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id h8OLRV5D006736; Wed, 24 Sep 2003 22:27:31 +0100 (BST) (envelope-from matthew) Date: Wed, 24 Sep 2003 22:27:31 +0100 From: Matthew Seaman To: David Bear Message-ID: <20030924212731.GA6347@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , David Bear , freebsd-questions@freebsd.org References: <20030924135543.F16613@asu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <20030924135543.F16613@asu.edu> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-11.5 required=5.0 tests=AWL,BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: advice re mail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 21:28:19 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 24, 2003 at 01:55:43PM -0700, David Bear wrote: > I need to write a program the grabs mail from a standard mail folder > and processes it. >=20 > The trouble is I have no idea what mail file format FreeBSD uses by > default. I am using postfix, and currently postfix is my mta and mda. > I will be adding procmail as the mda. I'm guessing procmail writes > the same kind of file the postfix does... but here I'm showing my > ignorance. =20 >=20 > I will be using python as my language and there are modules for MH, > maildir, mbox, and mailbox... Anyone have any recommended reading for > me to better understand what I need to do? By default FreeBSD uses the Berkeley mbox format. That's essentially just concatenating all of the e-mails together into one file, where each message starts with m/^From / (as a perl style regexp.) and ends with a blank line. There are also usually 'Content-Length:', 'Lines:' and 'Status:' lines added towards the end of the mail headers, but these are just for the convenience of the MUA. procmail(1) can write either to mbox style mail boxes, or to maildirs -- in that case, the mailbox name corresponds to a directory and individual messages are stored inside it as numbered files. Since you're installing procmail(1), you'll also get the formail(1) program, which can do all sorts of tricks with mailboxes. For instance: % formail -s sh -c 'cat > msg.$FILENO' < mbox will read the mailbox file, mbox, split it up into individual messages and write them out as numbered files: msg.000, msg.001, msg.002 etc. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cgxDdtESqEQa7a0RAt0VAKCVunhARMa5mDnLUt2Dr2zRDC7OwgCffAgj J9/h8WlhQtPHzMHvPR2gszg= =ZqsW -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q--