[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] writing to floppy
> > Nice thing about nmh is that it splits each message into a
> > seperate file - a system I've grown rather fond of :)
>
> Is that Maildir, or something customised? I know Qmail likes that format
> too..
It's the way mail handler has always created its files, and mh predates
qmail :) nmh is a recent rewrite of mh. mh itself is just a MUA, so all the
delivery is still left to qmail/exim/sendmail/postfix et al.
So when mail gets delivered to your mail spool, you run "inc" (or have inc
run from cron) to incorporate your spool into the mh inbox. Then there are
command line programs ... "scan" (scan a folder), "show" (show a message),
"forw" (forward a message), "repl" (reply), "comp" (compose message) etc.
Folders can be nested to a pretty much infinite level (limited only my
file-system or max length of command line in $SHELL).
Each email is then just stored in the folder as a number ... so the first
message in the folder is 1, the second is 2, the third 3, etc. What I like
about this way of storing emails (one a file), is the ability to then use
shell tools to do things to the mailbox - even if its a quick grep to find
a particular email :)
Quite flexible. Also allows complete customisation of the headers, so you
can say how you want In-Reply-to: formatted (or just delete the header
entirely) etc.
It is very powerful. But this is why I'm still learning it - so many
tweaks, config locations, that it gets a little too much to all know at
once :)
> A noddy "grep 'Subject:' mbox | wc -l" (is there a better way? I looked
> for some mbox tools, couldn't find any, and that seemed good enough...)
> tells me that there are 12667 emails in there - there are probably a
> couple of whoppers in there tho'. Average of about 20k, if my math is
> close.
Subject is bad to grep for if some messages, in their follow-ups, include
Subject somewhere in quoting the previous message. Or any other reason
Subject: could appear really :)
Better to grep for '^From ' (yes there is a trailing space there) as this
is the marker that splits mbox messages up. If "From" appearsin a message
at the start of the line, then the MTA/MUA must prefix a ">" or similar,
so that MUA's don't get confused about messages boundries when scanning
mailboxes.
And as Richard posted, you can lose the pipe by passing "-c" to grep :)
Chris...
--
\ Chris Johnson \ NP: CreamLive - 02. Madison Avenue - Don't Call
\ cej [at] nightwolf.org.uk ~-----, Me Baby (The Dronez Old School Vocal Mi
\ http://cej.nightwolf.org.uk/ ~-----------------------------------,
\ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.