Mail file on typical Linux install?

C

Chris

Been running Linux for years, but never really paid any attention to
the internal mail and mail files on my distribution since I have an
external web host and run my POP mail through there.

But now I want to automate reading all the mail coming into the root
account (from failed cron jobx, etc.) using Perl and Mail::Box and
Mail::Box::Manager. When I try to use Mail::Box::Manager to open the
mail at location $MAIL (shell environment -- or $ENV{MAIL} in Perl), it
keeps saying I need to specify the folder. The examples I have in Perl
for Mail::Box don't show a folder is need to open, nor do specify a
folder I when I open mail in the shell ($ mail); I just see the mail.

In the shell when I say 'echo $MAIL' I get '/var/spool/mail/root' as
the return value. Is this the same as an mbox? I don't think so. I
think I've seen an 'mbox' folder or '.mbox' folder in some Unix
accounts I have in other places. I need to know what kind of mail is
this and I'm not sure how to determine this. I've been a Unix user for
years, but I've never paid any attention to mail on Unix systems
because I've never needed to.

c.l.p.m, sorry for the cross-post. I realize this is not technically a
Perl issue, but maybe there is some nuance with Mail::Box::Manager that
I am missing. This seems to me like this should be straight forward.
The Perl code that comes back undefined is:

#!/usr/bin/perl
$|++;

use strict;
use warnings qw( all );

use Data::Dumper;
use Mail::Box::Manager;

my $mgr = Mail::Box::Manager->new;
my $folder = $mgr->open( folder => $ENV{MAIL} );
print Dumper( $folder ); ## $folder comes back undef

## $ENV{MAIL} eq '/var/spool/mail/root'

Thanks,
-ceo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top