On Sun, Dec 29, 2002 at 10:25:47AM +0200, Ishai Parasol wrote:

> I'm looking for a way to know (using the command line) the number of emails
> that a /var/spool/mail/USERNAME file contains. Right now I'm using "less
> /var/spool/mail/USERNAME | grep -c Subject:  ", but it's not accurate enough
> (cases of forwarded mails etc.). Any better ideas ?

You can use one of the many mbox reading libraries out there. I worked
with the python one and it's very convenient to use. Another option is
to look for a blank line followed by 'From xxx', which seems to be
unique in my mbox file. 

See also: http://www.everything2.com/index.pl?node_id=1096280

> Another question. Is it possible to run pine with another user email file
> (/var/spool/mail/USER) ?  for example, I'm logged as root and want to read
> USER2 emails (ofcourse, USER2 can't login, he's only a mail account and not
> a "full user"). If it's impossible with pine, is there a client (not for X)
> that can do it ?

No idea about pine, I don't use that *expletive*, but mutt can
certainly do it.
-- 
Muli Ben-Yehuda

"The speed of light really is too slow nowdays." -- Alan Cox 

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to