Re: advice re mail
David Bear wrote: I need to write a program the grabs mail from a standard mail folder and processes it. 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. 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? More than likely it's mbox format. Since you're running postfix Maildir has to be enabled in the config file by the entry home_mailbox=Maildir/. If you don't have that configured, you're using mbox formatted mailboxes. HTH ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: advice re mail
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. > > 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. > > 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 -- 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 pgp0.pgp Description: PGP signature
Re: advice re mail
Hi, David Bear wrote: I need to write a program the grabs mail from a standard mail folder and processes it. 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. the default behaviour is - afaict - mbox format. Thus you'll have all mail in ``one'' more or less big file per user. These files are stored in /var/mail (at least by default whilst using postfix1 on a 4.3 and 4.7 fbsd) and carry the name of their respective account. 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? Well I've once hacked/reorganized (with the help of the cyrus ML/archives) sth to convert such an single mbox into cyrus imapd format (it utilizes `man 1 formmail`) ... since this process walks through every single mail in given ``mbox'' files it might be of interest for you or at least give you an idea on how to deal with this issue - if so - please drop me a line and I'll happily sent you the necessary scripts. btw - these scripts are in perl - but not perl specific (doesnt use specific perl modules). best regards, frank -- 43rd Law of Computing: Anything that can go wr fortune: Segmentation violation -- Core dumped ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: advice re mail
On Wednesday 24 September 2003 03:55 pm, David Bear wrote: > I need to write a program the grabs mail from a standard mail folder > and processes it. > > 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. > > 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? At one point, I started writing a Python script to parse email and store various parts in a database. It was a low priority; so I didn't get very far. If you'd like to look at it, I'll try to find it. I started with the maildir format for ease; because each email is in its own file. Andrew Gould ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
advice re mail
I need to write a program the grabs mail from a standard mail folder and processes it. 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. 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? -- David Bear phone: 480-965-8257 fax:480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing" ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"