Date: Wed, 24 Sep 2003 22:27:31 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: David Bear <David.Bear@asu.edu> Cc: freebsd-questions@freebsd.org Subject: Re: advice re mail Message-ID: <20030924212731.GA6347@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <20030924135543.F16613@asu.edu> References: <20030924135543.F16613@asu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030924212731.GA6347>